summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/dlm/plock.c
diff options
context:
space:
mode:
authorDenis Cheng2007-07-25 11:53:58 +0200
committerSteven Whitehouse2007-10-10 09:54:58 +0200
commitcee23c79d08c57bbbb9923703409af3b17518c58 (patch)
tree57a09aa5c4d846a1fc65e8c576b5fd9bfbe8bc4f /fs/gfs2/locking/dlm/plock.c
parent[GFS2] Prevent infinite loop in try_rgrp_unlink() (diff)
downloadkernel-qcow2-linux-cee23c79d08c57bbbb9923703409af3b17518c58.tar.gz
kernel-qcow2-linux-cee23c79d08c57bbbb9923703409af3b17518c58.tar.xz
kernel-qcow2-linux-cee23c79d08c57bbbb9923703409af3b17518c58.zip
[GFS2] use an temp variable to reduce a spin_unlock
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>
Diffstat (limited to 'fs/gfs2/locking/dlm/plock.c')
-rw-r--r--fs/gfs2/locking/dlm/plock.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
index fba1f1d87e4f..1f7b038530b4 100644
--- a/fs/gfs2/locking/dlm/plock.c
+++ b/fs/gfs2/locking/dlm/plock.c
@@ -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 = {