* [PATCH] gfs2/locking/dlm: use an temp variable to reduce a spin_unlock
@ 2007-07-25 9:53 Denis Cheng
2007-07-25 14:09 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Denis Cheng @ 2007-07-25 9:53 UTC (permalink / raw)
To: Steven Whitehouse; +Cc: cluster-devel, linux-kernel, Denis Cheng
this is more clear.
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
fs/gfs2/locking/dlm/plock.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
index fba1f1d..1f7b038 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 = {
--
1.5.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] gfs2/locking/dlm: use an temp variable to reduce a spin_unlock
2007-07-25 9:53 [PATCH] gfs2/locking/dlm: use an temp variable to reduce a spin_unlock Denis Cheng
@ 2007-07-25 14:09 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2007-07-25 14:09 UTC (permalink / raw)
To: Denis Cheng; +Cc: cluster-devel, linux-kernel
Hi,
Now applied to the GFS2 -nmw git tree. Thanks,
Steve.
On Wed, 2007-07-25 at 17:53 +0800, Denis Cheng wrote:
> this is more clear.
>
> Signed-off-by: Denis Cheng <crquan@gmail.com>
> ---
> fs/gfs2/locking/dlm/plock.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
> index fba1f1d..1f7b038 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 = {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-25 14:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25 9:53 [PATCH] gfs2/locking/dlm: use an temp variable to reduce a spin_unlock Denis Cheng
2007-07-25 14:09 ` Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox