diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 11:06:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 11:06:25 -0400 |
commit | 53113b06e48c6c38f7612c1f8043b8a0d2adf72b (patch) | |
tree | b50f098b72b6389fde956d8272c08169ff2b53cc /fs/proc/root.c | |
parent | 37542b6a7e73e81f8c066a48e6911e476ee3b22f (diff) | |
parent | a4cdbd8bfb87ceff455aae85727077889b75001b (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (29 commits)
braino in internal.h
convert simple cases of nfs-related ->get_sb() to ->mount()
convert btrfs
convert ceph
convert gfs2
convert afs
convert ecryptfs
convert sysfs
convert cgroup and cpuset
switch get_sb_ns() users
switch procfs to ->mount()
setting ->proc_mnt doesn't belong in proc_get_sb()
convert cifs
convert nilfs
switch logfs to ->mount()
logfs: fix a leak in get_sb
logfs get_sb, part 3
logfs get_sb, part 2
logfs get_sb massage, part 1
convert v9fs
...
Diffstat (limited to 'fs/proc/root.c')
-rw-r--r-- | fs/proc/root.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c index 93d99b316325..ef9fa8e24ad6 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c | |||
@@ -35,8 +35,8 @@ static int proc_set_super(struct super_block *sb, void *data) | |||
35 | return set_anon_super(sb, NULL); | 35 | return set_anon_super(sb, NULL); |
36 | } | 36 | } |
37 | 37 | ||
38 | static int proc_get_sb(struct file_system_type *fs_type, | 38 | static struct dentry *proc_mount(struct file_system_type *fs_type, |
39 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) | 39 | int flags, const char *dev_name, void *data) |
40 | { | 40 | { |
41 | int err; | 41 | int err; |
42 | struct super_block *sb; | 42 | struct super_block *sb; |
@@ -61,14 +61,14 @@ static int proc_get_sb(struct file_system_type *fs_type, | |||
61 | 61 | ||
62 | sb = sget(fs_type, proc_test_super, proc_set_super, ns); | 62 | sb = sget(fs_type, proc_test_super, proc_set_super, ns); |
63 | if (IS_ERR(sb)) | 63 | if (IS_ERR(sb)) |
64 | return PTR_ERR(sb); | 64 | return ERR_CAST(sb); |
65 | 65 | ||
66 | if (!sb->s_root) { | 66 | if (!sb->s_root) { |
67 | sb->s_flags = flags; | 67 | sb->s_flags = flags; |
68 | err = proc_fill_super(sb); | 68 | err = proc_fill_super(sb); |
69 | if (err) { | 69 | if (err) { |
70 | deactivate_locked_super(sb); | 70 | deactivate_locked_super(sb); |
71 | return err; | 71 | return ERR_PTR(err); |
72 | } | 72 | } |
73 | 73 | ||
74 | ei = PROC_I(sb->s_root->d_inode); | 74 | ei = PROC_I(sb->s_root->d_inode); |
@@ -79,11 +79,9 @@ static int proc_get_sb(struct file_system_type *fs_type, | |||
79 | } | 79 | } |
80 | 80 | ||
81 | sb->s_flags |= MS_ACTIVE; | 81 | sb->s_flags |= MS_ACTIVE; |
82 | ns->proc_mnt = mnt; | ||
83 | } | 82 | } |
84 | 83 | ||
85 | simple_set_mnt(mnt, sb); | 84 | return dget(sb->s_root); |
86 | return 0; | ||
87 | } | 85 | } |
88 | 86 | ||
89 | static void proc_kill_sb(struct super_block *sb) | 87 | static void proc_kill_sb(struct super_block *sb) |
@@ -97,7 +95,7 @@ static void proc_kill_sb(struct super_block *sb) | |||
97 | 95 | ||
98 | static struct file_system_type proc_fs_type = { | 96 | static struct file_system_type proc_fs_type = { |
99 | .name = "proc", | 97 | .name = "proc", |
100 | .get_sb = proc_get_sb, | 98 | .mount = proc_mount, |
101 | .kill_sb = proc_kill_sb, | 99 | .kill_sb = proc_kill_sb, |
102 | }; | 100 | }; |
103 | 101 | ||
@@ -115,6 +113,7 @@ void __init proc_root_init(void) | |||
115 | return; | 113 | return; |
116 | } | 114 | } |
117 | 115 | ||
116 | init_pid_ns.proc_mnt = proc_mnt; | ||
118 | proc_symlink("mounts", NULL, "self/mounts"); | 117 | proc_symlink("mounts", NULL, "self/mounts"); |
119 | 118 | ||
120 | proc_net_init(); | 119 | proc_net_init(); |
@@ -213,6 +212,7 @@ int pid_ns_prepare_proc(struct pid_namespace *ns) | |||
213 | if (IS_ERR(mnt)) | 212 | if (IS_ERR(mnt)) |
214 | return PTR_ERR(mnt); | 213 | return PTR_ERR(mnt); |
215 | 214 | ||
215 | ns->proc_mnt = mnt; | ||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||