Skip to content

Commit 182b335

Browse files
committed
gfs2: Remove LM_FLAG_PRIORITY flag
jira LE-12345 Rebuild_History Non-Buildable kernel-5.14.0-570.12.1.el9_6 commit-author Andreas Gruenbacher <agruenba@redhat.com> commit 0b93bac The last user of this flag was removed in commit b77b4a4 ("gfs2: Rework freeze / thaw logic"). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> (cherry picked from commit 0b93bac) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent bc6a159 commit 182b335

File tree

4 files changed

+7
-33
lines changed

4 files changed

+7
-33
lines changed

Documentation/filesystems/gfs2-glocks.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ The gl_holders list contains all the queued lock requests (not
2020
just the holders) associated with the glock. If there are any
2121
held locks, then they will be contiguous entries at the head
2222
of the list. Locks are granted in strictly the order that they
23-
are queued, except for those marked LM_FLAG_PRIORITY which are
24-
used only during recovery, and even then only for journal locks.
23+
are queued.
2524

2625
There are three lock states that users of the glock layer can request,
2726
namely shared (SH), deferred (DF) and exclusive (EX). Those translate

fs/gfs2/glock.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,7 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
610610
if (gh && !test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) {
611611
/* move to back of queue and try next entry */
612612
if (ret & LM_OUT_CANCELED) {
613-
if ((gh->gh_flags & LM_FLAG_PRIORITY) == 0)
614-
list_move_tail(&gh->gh_list, &gl->gl_holders);
613+
list_move_tail(&gh->gh_list, &gl->gl_holders);
615614
gh = find_first_waiter(gl);
616615
gl->gl_target = gh->gh_state;
617616
if (do_promote(gl))
@@ -699,8 +698,7 @@ __acquires(&gl->gl_lockref.lock)
699698
gh && !(gh->gh_flags & LM_FLAG_NOEXP))
700699
goto skip_inval;
701700

702-
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
703-
LM_FLAG_PRIORITY);
701+
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP);
704702
GLOCK_BUG_ON(gl, gl->gl_state == target);
705703
GLOCK_BUG_ON(gl, gl->gl_state == gl->gl_target);
706704
if ((target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) &&
@@ -1523,27 +1521,20 @@ __acquires(&gl->gl_lockref.lock)
15231521
}
15241522
if (test_bit(HIF_HOLDER, &gh2->gh_iflags))
15251523
continue;
1526-
if (unlikely((gh->gh_flags & LM_FLAG_PRIORITY) && !insert_pt))
1527-
insert_pt = &gh2->gh_list;
15281524
}
15291525
trace_gfs2_glock_queue(gh, 1);
15301526
gfs2_glstats_inc(gl, GFS2_LKS_QCOUNT);
15311527
gfs2_sbstats_inc(gl, GFS2_LKS_QCOUNT);
15321528
if (likely(insert_pt == NULL)) {
15331529
list_add_tail(&gh->gh_list, &gl->gl_holders);
1534-
if (unlikely(gh->gh_flags & LM_FLAG_PRIORITY))
1535-
goto do_cancel;
15361530
return;
15371531
}
15381532
list_add_tail(&gh->gh_list, insert_pt);
1539-
do_cancel:
15401533
gh = list_first_entry(&gl->gl_holders, struct gfs2_holder, gh_list);
1541-
if (!(gh->gh_flags & LM_FLAG_PRIORITY)) {
1542-
spin_unlock(&gl->gl_lockref.lock);
1543-
if (sdp->sd_lockstruct.ls_ops->lm_cancel)
1544-
sdp->sd_lockstruct.ls_ops->lm_cancel(gl);
1545-
spin_lock(&gl->gl_lockref.lock);
1546-
}
1534+
spin_unlock(&gl->gl_lockref.lock);
1535+
if (sdp->sd_lockstruct.ls_ops->lm_cancel)
1536+
sdp->sd_lockstruct.ls_ops->lm_cancel(gl);
1537+
spin_lock(&gl->gl_lockref.lock);
15471538
return;
15481539

15491540
trap_recursive:
@@ -2263,8 +2254,6 @@ static const char *hflags2str(char *buf, u16 flags, unsigned long iflags)
22632254
*p++ = 'e';
22642255
if (flags & LM_FLAG_ANY)
22652256
*p++ = 'A';
2266-
if (flags & LM_FLAG_PRIORITY)
2267-
*p++ = 'p';
22682257
if (flags & LM_FLAG_NODE_SCOPE)
22692258
*p++ = 'n';
22702259
if (flags & GL_ASYNC)

fs/gfs2/glock.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ enum {
6868
* also be granted in SHARED. The preferred state is whichever is compatible
6969
* with other granted locks, or the specified state if no other locks exist.
7070
*
71-
* LM_FLAG_PRIORITY
72-
* Override fairness considerations. Suppose a lock is held in a shared state
73-
* and there is a pending request for the deferred state. A shared lock
74-
* request with the priority flag would be allowed to bypass the deferred
75-
* request and directly join the other shared lock. A shared lock request
76-
* without the priority flag might be forced to wait until the deferred
77-
* requested had acquired and released the lock.
78-
*
7971
* LM_FLAG_NODE_SCOPE
8072
* This holder agrees to share the lock within this node. In other words,
8173
* the glock is held in EX mode according to DLM, but local holders on the
@@ -86,7 +78,6 @@ enum {
8678
#define LM_FLAG_TRY_1CB 0x0002
8779
#define LM_FLAG_NOEXP 0x0004
8880
#define LM_FLAG_ANY 0x0008
89-
#define LM_FLAG_PRIORITY 0x0010
9081
#define LM_FLAG_NODE_SCOPE 0x0020
9182
#define GL_ASYNC 0x0040
9283
#define GL_EXACT 0x0080

fs/gfs2/lock_dlm.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
240240
lkf |= DLM_LKF_NOQUEUEBAST;
241241
}
242242

243-
if (gfs_flags & LM_FLAG_PRIORITY) {
244-
lkf |= DLM_LKF_NOORDER;
245-
lkf |= DLM_LKF_HEADQUE;
246-
}
247-
248243
if (gfs_flags & LM_FLAG_ANY) {
249244
if (req == DLM_LOCK_PR)
250245
lkf |= DLM_LKF_ALTCW;

0 commit comments

Comments
 (0)