Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[pandora-kernel.git] / fs / nfsctl.c
index 1c72c7f..51f1b31 100644 (file)
@@ -4,7 +4,6 @@
  *     This should eventually move to userland.
  *
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/file.h>
 #include <linux/fs.h>
 static struct file *do_open(char *name, int flags)
 {
        struct nameidata nd;
+       struct vfsmount *mnt;
        int error;
 
-       nd.mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
+       mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
+       if (IS_ERR(mnt))
+               return (struct file *)mnt;
 
-       if (IS_ERR(nd.mnt))
-               return (struct file *)nd.mnt;
-
-       nd.dentry = dget(nd.mnt->mnt_root);
-       nd.last_type = LAST_ROOT;
-       nd.flags = 0;
-       nd.depth = 0;
-
-       error = path_walk(name, &nd);
+       error = vfs_path_lookup(mnt->mnt_root, mnt, name, 0, &nd);
+       mntput(mnt);    /* drop do_kern_mount reference */
        if (error)
                return ERR_PTR(error);
 
@@ -101,7 +96,7 @@ asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *r
        if (version != NFSCTL_VERSION)
                return -EINVAL;
 
-       if (cmd < 0 || cmd >= sizeof(map)/sizeof(map[0]) || !map[cmd].name)
+       if (cmd < 0 || cmd >= ARRAY_SIZE(map) || !map[cmd].name)
                return -EINVAL;
 
        file = do_open(map[cmd].name, map[cmd].rsize ? O_RDWR : O_WRONLY);