From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Thu, 21 Oct 2010 11:07:30 +0100 Subject: [Cluster-devel] GFS2: Don't use trylocks when converting dlm locks Message-ID: <1287655650.2946.8.camel@dolmen> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit There is no need to use a try lock when up converting a dlm lock because the dlm will return -EDEADLK if the conversion would otherwise result in a deadlock. GFS2 can already handle the -EDEADLK return on conversion. This should make GFS2 a bit more efficient when it comes to locking during contention situations, although tests haven't shown any measurable improvement so far. Also this is a clean up of the code. Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 8777885..41fea85 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -590,10 +590,6 @@ __acquires(&gl->gl_spin) clear_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags); gfs2_glock_hold(gl); - if (target != LM_ST_UNLOCKED && (gl->gl_state == LM_ST_SHARED || - gl->gl_state == LM_ST_DEFERRED) && - !(lck_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))) - lck_flags |= LM_FLAG_TRY_1CB; ret = gfs2_lm_lock(sdp, gl, target, lck_flags); if (!(ret & LM_OUT_ASYNC)) {