Skip to content

Commit 0b93bac

Browse files
author
Andreas Gruenbacher
committed
gfs2: Remove LM_FLAG_PRIORITY flag
The last user of this flag was removed in commit b77b4a4 ("gfs2: Rework freeze / thaw logic"). Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent de3e7f9 commit 0b93bac

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
@@ -591,8 +591,7 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
591591
if (gh && !test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) {
592592
/* move to back of queue and try next entry */
593593
if (ret & LM_OUT_CANCELED) {
594-
if ((gh->gh_flags & LM_FLAG_PRIORITY) == 0)
595-
list_move_tail(&gh->gh_list, &gl->gl_holders);
594+
list_move_tail(&gh->gh_list, &gl->gl_holders);
596595
gh = find_first_waiter(gl);
597596
gl->gl_target = gh->gh_state;
598597
goto retry;
@@ -679,8 +678,7 @@ __acquires(&gl->gl_lockref.lock)
679678
gh && !(gh->gh_flags & LM_FLAG_NOEXP))
680679
goto skip_inval;
681680

682-
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
683-
LM_FLAG_PRIORITY);
681+
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP);
684682
GLOCK_BUG_ON(gl, gl->gl_state == target);
685683
GLOCK_BUG_ON(gl, gl->gl_state == gl->gl_target);
686684
if ((target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) &&
@@ -1515,27 +1513,20 @@ __acquires(&gl->gl_lockref.lock)
15151513
}
15161514
if (test_bit(HIF_HOLDER, &gh2->gh_iflags))
15171515
continue;
1518-
if (unlikely((gh->gh_flags & LM_FLAG_PRIORITY) && !insert_pt))
1519-
insert_pt = &gh2->gh_list;
15201516
}
15211517
trace_gfs2_glock_queue(gh, 1);
15221518
gfs2_glstats_inc(gl, GFS2_LKS_QCOUNT);
15231519
gfs2_sbstats_inc(gl, GFS2_LKS_QCOUNT);
15241520
if (likely(insert_pt == NULL)) {
15251521
list_add_tail(&gh->gh_list, &gl->gl_holders);
1526-
if (unlikely(gh->gh_flags & LM_FLAG_PRIORITY))
1527-
goto do_cancel;
15281522
return;
15291523
}
15301524
list_add_tail(&gh->gh_list, insert_pt);
1531-
do_cancel:
15321525
gh = list_first_entry(&gl->gl_holders, struct gfs2_holder, gh_list);
1533-
if (!(gh->gh_flags & LM_FLAG_PRIORITY)) {
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);
1538-
}
1526+
spin_unlock(&gl->gl_lockref.lock);
1527+
if (sdp->sd_lockstruct.ls_ops->lm_cancel)
1528+
sdp->sd_lockstruct.ls_ops->lm_cancel(gl);
1529+
spin_lock(&gl->gl_lockref.lock);
15391530
return;
15401531

15411532
trap_recursive:
@@ -2227,8 +2218,6 @@ static const char *hflags2str(char *buf, u16 flags, unsigned long iflags)
22272218
*p++ = 'e';
22282219
if (flags & LM_FLAG_ANY)
22292220
*p++ = 'A';
2230-
if (flags & LM_FLAG_PRIORITY)
2231-
*p++ = 'p';
22322221
if (flags & LM_FLAG_NODE_SCOPE)
22332222
*p++ = 'n';
22342223
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
@@ -222,11 +222,6 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
222222
lkf |= DLM_LKF_NOQUEUEBAST;
223223
}
224224

225-
if (gfs_flags & LM_FLAG_PRIORITY) {
226-
lkf |= DLM_LKF_NOORDER;
227-
lkf |= DLM_LKF_HEADQUE;
228-
}
229-
230225
if (gfs_flags & LM_FLAG_ANY) {
231226
if (req == DLM_LOCK_PR)
232227
lkf |= DLM_LKF_ALTCW;

0 commit comments

Comments
 (0)