diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-03-18 05:38:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-18 05:39:00 -0400 |
commit | 8dd8997d2c56c9f248294805e129e1fc69444380 (patch) | |
tree | 3b030a04295fc031db98746c4074c2df1ed6a19f /fs/nfsctl.c | |
parent | 1eda75c131ea42ec173323b6c34aeed78ae637c1 (diff) | |
parent | 016aa2ed1cc9cf704cf76d8df07751b6daa9750f (diff) |
Merge branch 'linus' into x86/urgent
Merge reason: Merge upstream commits to avoid conflicts in upcoming patches.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/nfsctl.c')
-rw-r--r-- | fs/nfsctl.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/fs/nfsctl.c b/fs/nfsctl.c index bf9cbd242dd..124e8fcb0dd 100644 --- a/fs/nfsctl.c +++ b/fs/nfsctl.c | |||
@@ -22,30 +22,17 @@ | |||
22 | 22 | ||
23 | static struct file *do_open(char *name, int flags) | 23 | static struct file *do_open(char *name, int flags) |
24 | { | 24 | { |
25 | struct nameidata nd; | ||
26 | struct vfsmount *mnt; | 25 | struct vfsmount *mnt; |
27 | int error; | 26 | struct file *file; |
28 | 27 | ||
29 | mnt = do_kern_mount("nfsd", 0, "nfsd", NULL); | 28 | mnt = do_kern_mount("nfsd", 0, "nfsd", NULL); |
30 | if (IS_ERR(mnt)) | 29 | if (IS_ERR(mnt)) |
31 | return (struct file *)mnt; | 30 | return (struct file *)mnt; |
32 | 31 | ||
33 | error = vfs_path_lookup(mnt->mnt_root, mnt, name, 0, &nd); | 32 | file = file_open_root(mnt->mnt_root, mnt, name, flags); |
34 | mntput(mnt); /* drop do_kern_mount reference */ | ||
35 | if (error) | ||
36 | return ERR_PTR(error); | ||
37 | |||
38 | if (flags == O_RDWR) | ||
39 | error = may_open(&nd.path, MAY_READ|MAY_WRITE, flags); | ||
40 | else | ||
41 | error = may_open(&nd.path, MAY_WRITE, flags); | ||
42 | 33 | ||
43 | if (!error) | 34 | mntput(mnt); /* drop do_kern_mount reference */ |
44 | return dentry_open(nd.path.dentry, nd.path.mnt, flags, | 35 | return file; |
45 | current_cred()); | ||
46 | |||
47 | path_put(&nd.path); | ||
48 | return ERR_PTR(error); | ||
49 | } | 36 | } |
50 | 37 | ||
51 | static struct { | 38 | static struct { |