From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 17 Oct 2012 13:36:08 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Allow minimum hold time for all glocks Message-ID: <584006122.19791652.1350495368405.JavaMail.root@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Before this patch, only inode glocks were held for a minimum length of time. This patch extends that to all glocks, unless the locking protocol is lock_nolock. Regards, Bob Peterson Red Hat File Systems Signed-off-by: Bob Peterson --- diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index beaa834..3f1df8b 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -683,7 +683,7 @@ static void glock_work_func(struct work_struct *work) if (!delay) gfs2_glock_put(gl); else { - if (gl->gl_name.ln_type != LM_TYPE_INODE) + if (gl->gl_sbd->sd_lockstruct.ls_ops->lm_lock == NULL) delay = 0; if (queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) gfs2_glock_put(gl); @@ -1110,7 +1110,7 @@ void gfs2_glock_dq(struct gfs2_holder *gh) gfs2_glock_hold(gl); if (test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && !test_bit(GLF_DEMOTE, &gl->gl_flags) && - gl->gl_name.ln_type == LM_TYPE_INODE) + gl->gl_sbd->sd_lockstruct.ls_ops->lm_lock != NULL) delay = gl->gl_hold_time; if (queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) gfs2_glock_put(gl); @@ -1293,7 +1293,7 @@ void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state) gfs2_glock_hold(gl); holdtime = gl->gl_tchange + gl->gl_hold_time; if (test_bit(GLF_QUEUED, &gl->gl_flags) && - gl->gl_name.ln_type == LM_TYPE_INODE) { + gl->gl_sbd->sd_lockstruct.ls_ops->lm_lock != NULL) { if (time_before(now, holdtime)) delay = holdtime - now; if (test_bit(GLF_REPLY_PENDING, &gl->gl_flags))