From: Denis Cheng Date: Wed, 25 Jul 2007 09:53:58 +0000 (+0800) Subject: [GFS2] use an temp variable to reduce a spin_unlock X-Git-Tag: v2.6.24-rc1~1405^2~42 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=cee23c79d08c57bbbb9923703409af3b17518c58;p=~emulex%2Finfiniband.git [GFS2] use an temp variable to reduce a spin_unlock this is more clear. Signed-off-by: Denis Cheng Signed-off-by: David Teigland Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c index fba1f1d87e4..1f7b038530b 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 = {