aboutsummaryrefslogtreecommitdiff
path: root/fs/dlm/plock.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-07-16 04:21:39 +0000
committerSteve French <sfrench@us.ibm.com>2009-07-16 04:21:39 +0000
commitf6c43385435640e056424034caac0d765c45e370 (patch)
tree54c2ba0a7d3abb156bc51f6b9f02e00f0a260f85 /fs/dlm/plock.c
parent65bc98b0059360e458aebd208587be44641227c1 (diff)
parent35b5c55fee08e6e4001ba98060a2d0b82f70b5f4 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/dlm/plock.c')
-rw-r--r--fs/dlm/plock.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index 894a32d438d..16f682e26c0 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -353,7 +353,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
{
struct dlm_plock_info info;
struct plock_op *op;
- int found = 0;
+ int found = 0, do_callback = 0;
if (count != sizeof(info))
return -EINVAL;
@@ -366,21 +366,24 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
spin_lock(&ops_lock);
list_for_each_entry(op, &recv_list, list) {
- if (op->info.fsid == info.fsid && op->info.number == info.number &&
+ if (op->info.fsid == info.fsid &&
+ op->info.number == info.number &&
op->info.owner == info.owner) {
+ struct plock_xop *xop = (struct plock_xop *)op;
list_del_init(&op->list);
- found = 1;
- op->done = 1;
memcpy(&op->info, &info, sizeof(info));
+ if (xop->callback)
+ do_callback = 1;
+ else
+ op->done = 1;
+ found = 1;
break;
}
}
spin_unlock(&ops_lock);
if (found) {
- struct plock_xop *xop;
- xop = (struct plock_xop *)op;
- if (xop->callback)
+ if (do_callback)
dlm_plock_callback(op);
else
wake_up(&recv_wq);