Skip to content

Commit 2b813a7

Browse files
author
Andreas Gruenbacher
committed
gfs2: Remove DLM_LKF_ALTCW / DLM_LKF_ALTPR code
Commit 6802e34 ("[GFS2] Clean up the glock core") stopped passing the LM_FLAG_ANY flag down to gdlm_lock() (then gfs2_lm_lock()). Since then, gfs2 effectively hasn't been using dlm's DLM_LKF_ALTCW / DLM_LKF_ALTPR flags, but the code still suggests that it does. Recent testing shows that those flags don't even work reliably anymore, so instead of fixing code that hasn't been used since 2008, remove it. In addition, clean up how the flags are passed to [gd]lm_lock(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Andrew Price <anprice@redhat.com>
1 parent fd70ab7 commit 2b813a7

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

fs/gfs2/glock.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,12 @@ __acquires(&gl->gl_lockref.lock)
695695
const struct gfs2_glock_operations *glops = gl->gl_ops;
696696
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
697697
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
698-
unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0);
699698
int ret;
700699

701700
if (target != LM_ST_UNLOCKED && glock_blocked_by_withdraw(gl) &&
702701
gh && !(gh->gh_flags & LM_FLAG_NOEXP))
703702
goto skip_inval;
704703

705-
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP);
706704
GLOCK_BUG_ON(gl, gl->gl_state == target);
707705
GLOCK_BUG_ON(gl, gl->gl_state == gl->gl_target);
708706
if ((target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) &&
@@ -809,7 +807,7 @@ __acquires(&gl->gl_lockref.lock)
809807
if (ls->ls_ops->lm_lock) {
810808
set_bit(GLF_PENDING_REPLY, &gl->gl_flags);
811809
spin_unlock(&gl->gl_lockref.lock);
812-
ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
810+
ret = ls->ls_ops->lm_lock(gl, target, gh ? gh->gh_flags : 0);
813811
spin_lock(&gl->gl_lockref.lock);
814812

815813
if (!ret) {

fs/gfs2/lock_dlm.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,6 @@ static void gdlm_ast(void *arg)
162162
}
163163

164164
ret = gl->gl_req;
165-
if (gl->gl_lksb.sb_flags & DLM_SBF_ALTMODE) {
166-
if (gl->gl_req == LM_ST_SHARED)
167-
ret = LM_ST_DEFERRED;
168-
else if (gl->gl_req == LM_ST_DEFERRED)
169-
ret = LM_ST_SHARED;
170-
else
171-
BUG();
172-
}
173165

174166
/*
175167
* The GLF_INITIAL flag is initially set for new glocks. Upon the
@@ -261,15 +253,6 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
261253
lkf |= DLM_LKF_NOQUEUEBAST;
262254
}
263255

264-
if (gfs_flags & LM_FLAG_ANY) {
265-
if (req == DLM_LOCK_PR)
266-
lkf |= DLM_LKF_ALTCW;
267-
else if (req == DLM_LOCK_CW)
268-
lkf |= DLM_LKF_ALTPR;
269-
else
270-
BUG();
271-
}
272-
273256
if (!test_bit(GLF_INITIAL, &gl->gl_flags)) {
274257
lkf |= DLM_LKF_CONVERT;
275258

0 commit comments

Comments
 (0)