Commit 5bef3e7c authored by Bob Peterson's avatar Bob Peterson Committed by Steven Whitehouse

GFS2: Allow flocks to use normal glock dq rather than dq_wait

This patch allows flock glocks to use a non-blocking dequeue rather
than dq_wait. It also reverts the previous patch I had posted regarding
dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
this might avoid unforeseen side effects, and was therefore safer.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 6ec43b18
...@@ -991,7 +991,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) ...@@ -991,7 +991,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
goto out; goto out;
flock_lock_file_wait(file, flock_lock_file_wait(file,
&(struct file_lock){.fl_type = F_UNLCK}); &(struct file_lock){.fl_type = F_UNLCK});
gfs2_glock_dq_wait(fl_gh); gfs2_glock_dq(fl_gh);
gfs2_holder_reinit(state, flags, fl_gh); gfs2_holder_reinit(state, flags, fl_gh);
} else { } else {
error = gfs2_glock_get(GFS2_SB(&ip->i_inode), ip->i_no_addr, error = gfs2_glock_get(GFS2_SB(&ip->i_inode), ip->i_no_addr,
......
...@@ -1128,9 +1128,7 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh) ...@@ -1128,9 +1128,7 @@ void gfs2_glock_dq_wait(struct gfs2_holder *gh)
struct gfs2_glock *gl = gh->gh_gl; struct gfs2_glock *gl = gh->gh_gl;
gfs2_glock_dq(gh); gfs2_glock_dq(gh);
might_sleep(); might_sleep();
if (!find_first_holder(gl)) wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait, TASK_UNINTERRUPTIBLE);
wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs2_glock_demote_wait,
TASK_UNINTERRUPTIBLE);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment