Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
[safe/jmp/linux-2.6] / fs / lockd / clntproc.c
index 273e229..7932c39 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <linux/module.h>
+#include <linux/smp_lock.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -126,7 +128,6 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
        struct nlm_lock *lock = &argp->lock;
 
        nlmclnt_next_cookie(&argp->cookie);
-       argp->state   = nsm_local_state;
        memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh));
        lock->caller  = utsname()->nodename;
        lock->oh.data = req->a_owner;
@@ -458,7 +459,7 @@ static void nlmclnt_locks_release_private(struct file_lock *fl)
        nlm_put_lockowner(fl->fl_u.nfs_fl.owner);
 }
 
-static struct file_lock_operations nlmclnt_lock_ops = {
+static const struct file_lock_operations nlmclnt_lock_ops = {
        .fl_copy_lock = nlmclnt_locks_copy_lock,
        .fl_release_private = nlmclnt_locks_release_private,
 };
@@ -521,6 +522,7 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
 
        if (nsm_monitor(host) < 0)
                goto out;
+       req->a_args.state = nsm_local_state;
 
        fl->fl_flags |= FL_ACCESS;
        status = do_vfs_lock(fl);