dlm: use fl_owner from lockd
[linux-2.6-microblaze.git] / fs / dlm / plock.c
index e6b4c1a..ee6e023 100644 (file)
@@ -145,6 +145,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
        op->info.number         = number;
        op->info.start          = fl->fl_start;
        op->info.end            = fl->fl_end;
+       op->info.owner = (__u64)(long)fl->fl_owner;
        /* async handling */
        if (fl->fl_lmops && fl->fl_lmops->lm_grant) {
                op_data = kzalloc(sizeof(*op_data), GFP_NOFS);
@@ -154,9 +155,6 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
                        goto out;
                }
 
-               /* fl_owner is lockd which doesn't distinguish
-                  processes on the nfs client */
-               op->info.owner  = (__u64) fl->fl_pid;
                op_data->callback = fl->fl_lmops->lm_grant;
                locks_init_lock(&op_data->flc);
                locks_copy_lock(&op_data->flc, fl);
@@ -168,8 +166,6 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
                send_op(op);
                rv = FILE_LOCK_DEFERRED;
                goto out;
-       } else {
-               op->info.owner  = (__u64)(long) fl->fl_owner;
        }
 
        send_op(op);
@@ -326,10 +322,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
        op->info.number         = number;
        op->info.start          = fl->fl_start;
        op->info.end            = fl->fl_end;
-       if (fl->fl_lmops && fl->fl_lmops->lm_grant)
-               op->info.owner  = (__u64) fl->fl_pid;
-       else
-               op->info.owner  = (__u64)(long) fl->fl_owner;
+       op->info.owner = (__u64)(long)fl->fl_owner;
 
        if (fl->fl_flags & FL_CLOSE) {
                op->info.flags |= DLM_PLOCK_FL_CLOSE;
@@ -389,7 +382,7 @@ int dlm_posix_cancel(dlm_lockspace_t *lockspace, u64 number, struct file *file,
        info.number = number;
        info.start = fl->fl_start;
        info.end = fl->fl_end;
-       info.owner = (__u64)fl->fl_pid;
+       info.owner = (__u64)(long)fl->fl_owner;
 
        rv = do_lock_cancel(&info);
        switch (rv) {
@@ -450,10 +443,7 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
        op->info.number         = number;
        op->info.start          = fl->fl_start;
        op->info.end            = fl->fl_end;
-       if (fl->fl_lmops && fl->fl_lmops->lm_grant)
-               op->info.owner  = (__u64) fl->fl_pid;
-       else
-               op->info.owner  = (__u64)(long) fl->fl_owner;
+       op->info.owner = (__u64)(long)fl->fl_owner;
 
        send_op(op);
        wait_event(recv_wq, (op->done != 0));