Skip to content

Commit

Permalink
[GFS2] use an temp variable to reduce a spin_unlock
Browse files Browse the repository at this point in the history
this is more clear.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Denis Cheng authored and Steven Whitehouse committed Oct 10, 2007
1 parent 6760bdc commit cee23c7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fs/gfs2/locking/dlm/plock.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,16 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,

static unsigned int dev_poll(struct file *file, poll_table *wait)
{
unsigned int mask = 0;

poll_wait(file, &send_wq, wait);

spin_lock(&ops_lock);
if (!list_empty(&send_list)) {
spin_unlock(&ops_lock);
return POLLIN | POLLRDNORM;
}
if (!list_empty(&send_list))
mask = POLLIN | POLLRDNORM;
spin_unlock(&ops_lock);
return 0;

return mask;
}

static const struct file_operations dev_fops = {
Expand Down

0 comments on commit cee23c7

Please sign in to comment.