Skip to content

Commit 4117efd

Browse files
author
Andreas Gruenbacher
committed
gfs2: Minor gfs2_glock_cb cleanup
In gfs2_glock_cb(), we only need to calculate the glock hold time for inode glocks; the value is unused otherwise. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 6706415 commit 4117efd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/gfs2/glock.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,14 +1885,16 @@ void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs)
18851885
void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state)
18861886
{
18871887
unsigned long delay = 0;
1888-
unsigned long holdtime;
1889-
unsigned long now = jiffies;
18901888

18911889
gfs2_glock_hold(gl);
18921890
spin_lock(&gl->gl_lockref.lock);
1893-
holdtime = gl->gl_tchange + gl->gl_hold_time;
18941891
if (!list_empty(&gl->gl_holders) &&
18951892
gl->gl_name.ln_type == LM_TYPE_INODE) {
1893+
unsigned long now = jiffies;
1894+
unsigned long holdtime;
1895+
1896+
holdtime = gl->gl_tchange + gl->gl_hold_time;
1897+
18961898
if (time_before(now, holdtime))
18971899
delay = holdtime - now;
18981900
if (test_bit(GLF_HAVE_REPLY, &gl->gl_flags))

0 commit comments

Comments
 (0)