]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - fs/nfsctl.c
[CIFS] Use ecb des kernel crypto APIs instead of
[linux-2.6.git] / fs / nfsctl.c
index c043136a82caa862d9b72d7196047765490064a0..124e8fcb0dd6ad1fbe55c166ec30019abdd9c410 100644 (file)
@@ -7,9 +7,9 @@
 #include <linux/types.h>
 #include <linux/file.h>
 #include <linux/fs.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/syscall.h>
+#include <linux/cred.h>
+#include <linux/sched.h>
 #include <linux/linkage.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
 
 static struct file *do_open(char *name, int flags)
 {
-       struct nameidata nd;
-       int error;
-
-       nd.mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
-
-       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);
-       if (error)
-               return ERR_PTR(error);
+       struct vfsmount *mnt;
+       struct file *file;
 
-       if (flags == O_RDWR)
-               error = may_open(&nd,MAY_READ|MAY_WRITE,FMODE_READ|FMODE_WRITE);
-       else
-               error = may_open(&nd, MAY_WRITE, FMODE_WRITE);
+       mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
+       if (IS_ERR(mnt))
+               return (struct file *)mnt;
 
-       if (!error)
-               return dentry_open(nd.dentry, nd.mnt, flags);
+       file = file_open_root(mnt->mnt_root, mnt, name, flags);
 
-       path_release(&nd);
-       return ERR_PTR(error);
+       mntput(mnt);    /* drop do_kern_mount reference */
+       return file;
 }
 
 static struct {
@@ -86,8 +70,8 @@ static struct {
        },
 };
 
-long
-asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res)
+SYSCALL_DEFINE3(nfsservctl, int, cmd, struct nfsctl_arg __user *, arg,
+               void __user *, res)
 {
        struct file *file;
        void __user *p = &arg->u;