History

convert get_sb_single() users

Al Viro committed 16 years ago

Commit fc14f2f1 parent 848b83a25 files · +147 −139Browse files

Unified · Split

25 files
  1. arch/powerpc/platforms/cell/spufs/inode.c +5 −5
  2. arch/s390/hypfs/inode.c +4 −4
  3. drivers/base/devtmpfs.c +9 −9
  4. drivers/infiniband/hw/ipath/ipath_fs.c +7 −7
  5. drivers/infiniband/hw/qib/qib_fs.c +7 −7
  6. drivers/isdn/capi/capifs.c +4 −4
  7. drivers/misc/ibmasm/ibmasmfs.c +4 −5
  8. drivers/oprofile/oprofilefs.c +4 −4
  9. drivers/usb/core/inode.c +4 −4
  10. drivers/usb/gadget/f_fs.c +7 −7
  11. drivers/usb/gadget/inode.c +5 −5
  12. drivers/xen/xenfs/super.c +4 −4
  13. fs/binfmt_misc.c +4 −4
  14. fs/configfs/mount.c +4 −4
  15. fs/debugfs/inode.c +4 −4
  16. fs/devpts/inode.c +15 −17
  17. fs/fuse/control.c +4 −6
  18. fs/nfsd/nfsctl.c +4 −4
  19. fs/openpromfs/inode.c +4 −4
  20. fs/super.c +19 −6
  21. include/linux/fs.h +3 −0
  22. net/sunrpc/rpc_pipe.c +9 −9
  23. security/inode.c +4 −4
  24. security/selinux/selinuxfs.c +4 −5
  25. security/smack/smackfs.c +5 −7
arch/powerpc/platforms/cell/spufs/inode.c+5−5
@@ -798,17 +798,17 @@ spufs_fill_super(struct super_block *sb, void *data, int silent) · 797 unmodified lines
798 return spufs_create_root(sb, data);798 return spufs_create_root(sb, data);
799}799}
800 800
801static int801static struct dentry *
802spufs_get_sb(struct file_system_type *fstype, int flags,802spufs_mount(struct file_system_type *fstype, int flags,
803 const char *name, void *data, struct vfsmount *mnt)803 const char *name, void *data)
804{804{
805 return get_sb_single(fstype, flags, data, spufs_fill_super, mnt);805 return mount_single(fstype, flags, data, spufs_fill_super);
806}806}
807 807
808static struct file_system_type spufs_type = {808static struct file_system_type spufs_type = {
809 .owner = THIS_MODULE,809 .owner = THIS_MODULE,
810 .name = "spufs",810 .name = "spufs",
811 .get_sb = spufs_get_sb,811 .mount = spufs_mount,
812 .kill_sb = kill_litter_super,812 .kill_sb = kill_litter_super,
813};813};
814 814
arch/s390/hypfs/inode.c+4−4
@@ -316,10 +316,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) · 315 unmodified lines
316 return 0;316 return 0;
317}317}
318 318
319static int hypfs_get_super(struct file_system_type *fst, int flags,319static struct dentry *hypfs_mount(struct file_system_type *fst, int flags,
320 const char *devname, void *data, struct vfsmount *mnt)320 const char *devname, void *data)
321{321{
322 return get_sb_single(fst, flags, data, hypfs_fill_super, mnt);322 return mount_single(fst, flags, data, hypfs_fill_super);
323}323}
324 324
325static void hypfs_kill_super(struct super_block *sb)325static void hypfs_kill_super(struct super_block *sb)
@@ -455,7 +455,7 @@ static const struct file_operations hypfs_file_ops = { · 129 unmodified lines
455static struct file_system_type hypfs_type = {455static struct file_system_type hypfs_type = {
456 .owner = THIS_MODULE,456 .owner = THIS_MODULE,
457 .name = "s390_hypfs",457 .name = "s390_hypfs",
458 .get_sb = hypfs_get_super,458 .mount = hypfs_mount,
459 .kill_sb = hypfs_kill_super459 .kill_sb = hypfs_kill_super
460};460};
461 461
drivers/base/devtmpfs.c+9−9
@@ -29,33 +29,33 @@ · 28 unmodified lines
29static struct vfsmount *dev_mnt;29static struct vfsmount *dev_mnt;
30 30
31#if defined CONFIG_DEVTMPFS_MOUNT31#if defined CONFIG_DEVTMPFS_MOUNT
32static int dev_mount = 1;32static int mount_dev = 1;
33#else33#else
34static int dev_mount;34static int mount_dev;
35#endif35#endif
36 36
37static DEFINE_MUTEX(dirlock);37static DEFINE_MUTEX(dirlock);
38 38
39static int __init mount_param(char *str)39static int __init mount_param(char *str)
40{40{
41 dev_mount = simple_strtoul(str, NULL, 0);41 mount_dev = simple_strtoul(str, NULL, 0);
42 return 1;42 return 1;
43}43}
44__setup("devtmpfs.mount=", mount_param);44__setup("devtmpfs.mount=", mount_param);
45 45
46static int dev_get_sb(struct file_system_type *fs_type, int flags,46static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
47 const char *dev_name, void *data, struct vfsmount *mnt)47 const char *dev_name, void *data)
48{48{
49#ifdef CONFIG_TMPFS49#ifdef CONFIG_TMPFS
50 return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt);50 return mount_single(fs_type, flags, data, shmem_fill_super);
51#else51#else
52 return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt);52 return mount_single(fs_type, flags, data, ramfs_fill_super);
53#endif53#endif
54}54}
55 55
56static struct file_system_type dev_fs_type = {56static struct file_system_type dev_fs_type = {
57 .name = "devtmpfs",57 .name = "devtmpfs",
58 .get_sb = dev_get_sb,58 .mount = dev_mount,
59 .kill_sb = kill_litter_super,59 .kill_sb = kill_litter_super,
60};60};
61 61
@@ -351,7 +351,7 @@ int devtmpfs_mount(const char *mntdir) · 289 unmodified lines
351{351{
352 int err;352 int err;
353 353
354 if (!dev_mount)354 if (!mount_dev)
355 return 0;355 return 0;
356 356
357 if (!dev_mnt)357 if (!dev_mnt)
drivers/infiniband/hw/ipath/ipath_fs.c+7−7
@@ -362,13 +362,13 @@ bail: · 361 unmodified lines
362 return ret;362 return ret;
363}363}
364 364
365static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,365static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
366 const char *dev_name, void *data, struct vfsmount *mnt)366 int flags, const char *dev_name, void *data)
367{367{
368 int ret = get_sb_single(fs_type, flags, data,368 struct dentry *ret;
369 ipathfs_fill_super, mnt);369 ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
370 if (ret >= 0)370 if (!IS_ERR(ret))
371 ipath_super = mnt->mnt_sb;371 ipath_super = ret->d_sb;
372 return ret;372 return ret;
373}373}
374 374
@@ -411,7 +411,7 @@ bail: · 36 unmodified lines
411static struct file_system_type ipathfs_fs_type = {411static struct file_system_type ipathfs_fs_type = {
412 .owner = THIS_MODULE,412 .owner = THIS_MODULE,
413 .name = "ipathfs",413 .name = "ipathfs",
414 .get_sb = ipathfs_get_sb,414 .mount = ipathfs_mount,
415 .kill_sb = ipathfs_kill_super,415 .kill_sb = ipathfs_kill_super,
416};416};
417 417
drivers/infiniband/hw/qib/qib_fs.c+7−7
@@ -555,13 +555,13 @@ bail: · 554 unmodified lines
555 return ret;555 return ret;
556}556}
557 557
558static int qibfs_get_sb(struct file_system_type *fs_type, int flags,558static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
559 const char *dev_name, void *data, struct vfsmount *mnt)559 const char *dev_name, void *data)
560{560{
561 int ret = get_sb_single(fs_type, flags, data,561 struct dentry *ret;
562 qibfs_fill_super, mnt);562 ret = mount_single(fs_type, flags, data, qibfs_fill_super);
563 if (ret >= 0)563 if (!IS_ERR(ret))
564 qib_super = mnt->mnt_sb;564 qib_super = ret->d_sb;
565 return ret;565 return ret;
566}566}
567 567
@@ -603,7 +603,7 @@ int qibfs_remove(struct qib_devdata *dd) · 35 unmodified lines
603static struct file_system_type qibfs_fs_type = {603static struct file_system_type qibfs_fs_type = {
604 .owner = THIS_MODULE,604 .owner = THIS_MODULE,
605 .name = "ipathfs",605 .name = "ipathfs",
606 .get_sb = qibfs_get_sb,606 .mount = qibfs_mount,
607 .kill_sb = qibfs_kill_super,607 .kill_sb = qibfs_kill_super,
608};608};
609 609
drivers/isdn/capi/capifs.c+4−4
@@ -125,16 +125,16 @@ fail: · 124 unmodified lines
125 return -ENOMEM;125 return -ENOMEM;
126}126}
127 127
128static int capifs_get_sb(struct file_system_type *fs_type,128static struct dentry *capifs_mount(struct file_system_type *fs_type,
129 int flags, const char *dev_name, void *data, struct vfsmount *mnt)129 int flags, const char *dev_name, void *data)
130{130{
131 return get_sb_single(fs_type, flags, data, capifs_fill_super, mnt);131 return mount_single(fs_type, flags, data, capifs_fill_super);
132}132}
133 133
134static struct file_system_type capifs_fs_type = {134static struct file_system_type capifs_fs_type = {
135 .owner = THIS_MODULE,135 .owner = THIS_MODULE,
136 .name = "capifs",136 .name = "capifs",
137 .get_sb = capifs_get_sb,137 .mount = capifs_mount,
138 .kill_sb = kill_anon_super,138 .kill_sb = kill_anon_super,
139};139};
140 140
drivers/misc/ibmasm/ibmasmfs.c+4−5
@@ -91,11 +91,10 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root); · 90 unmodified lines
91static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);91static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
92 92
93 93
94static int ibmasmfs_get_super(struct file_system_type *fst,94static struct dentry *ibmasmfs_mount(struct file_system_type *fst,
95 int flags, const char *name, void *data,95 int flags, const char *name, void *data)
96 struct vfsmount *mnt)
97{96{
98 return get_sb_single(fst, flags, data, ibmasmfs_fill_super, mnt);97 return mount_single(fst, flags, data, ibmasmfs_fill_super);
99}98}
100 99
101static const struct super_operations ibmasmfs_s_ops = {100static const struct super_operations ibmasmfs_s_ops = {
@@ -108,7 +107,7 @@ static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations; · 6 unmodified lines
108static struct file_system_type ibmasmfs_type = {107static struct file_system_type ibmasmfs_type = {
109 .owner = THIS_MODULE,108 .owner = THIS_MODULE,
110 .name = "ibmasmfs",109 .name = "ibmasmfs",
111 .get_sb = ibmasmfs_get_super,110 .mount = ibmasmfs_mount,
112 .kill_sb = kill_litter_super,111 .kill_sb = kill_litter_super,
113};112};
114 113
drivers/oprofile/oprofilefs.c+4−4
@@ -259,17 +259,17 @@ static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) · 258 unmodified lines
259}259}
260 260
261 261
262static int oprofilefs_get_sb(struct file_system_type *fs_type,262static struct dentry *oprofilefs_mount(struct file_system_type *fs_type,
263 int flags, const char *dev_name, void *data, struct vfsmount *mnt)263 int flags, const char *dev_name, void *data)
264{264{
265 return get_sb_single(fs_type, flags, data, oprofilefs_fill_super, mnt);265 return mount_single(fs_type, flags, data, oprofilefs_fill_super);
266}266}
267 267
268 268
269static struct file_system_type oprofilefs_type = {269static struct file_system_type oprofilefs_type = {
270 .owner = THIS_MODULE,270 .owner = THIS_MODULE,
271 .name = "oprofilefs",271 .name = "oprofilefs",
272 .get_sb = oprofilefs_get_sb,272 .mount = oprofilefs_mount,
273 .kill_sb = kill_litter_super,273 .kill_sb = kill_litter_super,
274};274};
275 275
drivers/usb/core/inode.c+4−4
@@ -574,16 +574,16 @@ static void fs_remove_file (struct dentry *dentry) · 573 unmodified lines
574 574
575/* --------------------------------------------------------------------- */575/* --------------------------------------------------------------------- */
576 576
577static int usb_get_sb(struct file_system_type *fs_type,577static struct dentry *usb_mount(struct file_system_type *fs_type,
578 int flags, const char *dev_name, void *data, struct vfsmount *mnt)578 int flags, const char *dev_name, void *data)
579{579{
580 return get_sb_single(fs_type, flags, data, usbfs_fill_super, mnt);580 return mount_single(fs_type, flags, data, usbfs_fill_super);
581}581}
582 582
583static struct file_system_type usb_fs_type = {583static struct file_system_type usb_fs_type = {
584 .owner = THIS_MODULE,584 .owner = THIS_MODULE,
585 .name = "usbfs",585 .name = "usbfs",
586 .get_sb = usb_get_sb,586 .mount = usb_mount,
587 .kill_sb = kill_litter_super,587 .kill_sb = kill_litter_super,
588};588};
589 589
drivers/usb/gadget/f_fs.c+7−7
@@ -1176,9 +1176,9 @@ invalid: · 1175 unmodified lines
1176 1176
1177/* "mount -t functionfs dev_name /dev/function" ends up here */1177/* "mount -t functionfs dev_name /dev/function" ends up here */
1178 1178
1179static int1179static struct dentry *
1180ffs_fs_get_sb(struct file_system_type *t, int flags,1180ffs_fs_mount(struct file_system_type *t, int flags,
1181 const char *dev_name, void *opts, struct vfsmount *mnt)1181 const char *dev_name, void *opts)
1182{1182{
1183 struct ffs_sb_fill_data data = {1183 struct ffs_sb_fill_data data = {
1184 .perms = {1184 .perms = {
@@ -1194,14 +1194,14 @@ ffs_fs_get_sb(struct file_system_type *t, int flags, · 9 unmodified lines
1194 1194
1195 ret = functionfs_check_dev_callback(dev_name);1195 ret = functionfs_check_dev_callback(dev_name);
1196 if (unlikely(ret < 0))1196 if (unlikely(ret < 0))
1197 return ret;1197 return ERR_PTR(ret);
1198 1198
1199 ret = ffs_fs_parse_opts(&data, opts);1199 ret = ffs_fs_parse_opts(&data, opts);
1200 if (unlikely(ret < 0))1200 if (unlikely(ret < 0))
1201 return ret;1201 return ERR_PTR(ret);
1202 1202
1203 data.dev_name = dev_name;1203 data.dev_name = dev_name;
1204 return get_sb_single(t, flags, &data, ffs_sb_fill, mnt);1204 return mount_single(t, flags, &data, ffs_sb_fill);
1205}1205}
1206 1206
1207static void1207static void
@@ -1220,7 +1220,7 @@ ffs_fs_kill_sb(struct super_block *sb) · 12 unmodified lines
1220static struct file_system_type ffs_fs_type = {1220static struct file_system_type ffs_fs_type = {
1221 .owner = THIS_MODULE,1221 .owner = THIS_MODULE,
1222 .name = "functionfs",1222 .name = "functionfs",
1223 .get_sb = ffs_fs_get_sb,1223 .mount = ffs_fs_mount,
1224 .kill_sb = ffs_fs_kill_sb,1224 .kill_sb = ffs_fs_kill_sb,
1225};1225};
1226 1226
drivers/usb/gadget/inode.c+5−5
@@ -2097,11 +2097,11 @@ enomem0: · 2096 unmodified lines
2097}2097}
2098 2098
2099/* "mount -t gadgetfs path /dev/gadget" ends up here */2099/* "mount -t gadgetfs path /dev/gadget" ends up here */
2100static int2100static struct dentry *
2101gadgetfs_get_sb (struct file_system_type *t, int flags,2101gadgetfs_mount (struct file_system_type *t, int flags,
2102 const char *path, void *opts, struct vfsmount *mnt)2102 const char *path, void *opts)
2103{2103{
2104 return get_sb_single (t, flags, opts, gadgetfs_fill_super, mnt);2104 return mount_single (t, flags, opts, gadgetfs_fill_super);
2105}2105}
2106 2106
2107static void2107static void
@@ -2119,7 +2119,7 @@ gadgetfs_kill_sb (struct super_block *sb) · 11 unmodified lines
2119static struct file_system_type gadgetfs_type = {2119static struct file_system_type gadgetfs_type = {
2120 .owner = THIS_MODULE,2120 .owner = THIS_MODULE,
2121 .name = shortname,2121 .name = shortname,
2122 .get_sb = gadgetfs_get_sb,2122 .mount = gadgetfs_mount,
2123 .kill_sb = gadgetfs_kill_sb,2123 .kill_sb = gadgetfs_kill_sb,
2124};2124};
2125 2125
drivers/xen/xenfs/super.c+4−4
@@ -121,17 +121,17 @@ static int xenfs_fill_super(struct super_block *sb, void *data, int silent) · 120 unmodified lines
121 return rc;121 return rc;
122}122}
123 123
124static int xenfs_get_sb(struct file_system_type *fs_type,124static int xenfs_mount(struct file_system_type *fs_type,
125 int flags, const char *dev_name,125 int flags, const char *dev_name,
126 void *data, struct vfsmount *mnt)126 void *data)
127{127{
128 return get_sb_single(fs_type, flags, data, xenfs_fill_super, mnt);128 return mount_single(fs_type, flags, data, xenfs_fill_super);
129}129}
130 130
131static struct file_system_type xenfs_type = {131static struct file_system_type xenfs_type = {
132 .owner = THIS_MODULE,132 .owner = THIS_MODULE,
133 .name = "xenfs",133 .name = "xenfs",
134 .get_sb = xenfs_get_sb,134 .mount = xenfs_mount,
135 .kill_sb = kill_litter_super,135 .kill_sb = kill_litter_super,
136};136};
137 137
fs/binfmt_misc.c+4−4
@@ -706,10 +706,10 @@ static int bm_fill_super(struct super_block * sb, void * data, int silent) · 705 unmodified lines
706 return err;706 return err;
707}707}
708 708
709static int bm_get_sb(struct file_system_type *fs_type,709static struct dentry *bm_mount(struct file_system_type *fs_type,
710 int flags, const char *dev_name, void *data, struct vfsmount *mnt)710 int flags, const char *dev_name, void *data)
711{711{
712 return get_sb_single(fs_type, flags, data, bm_fill_super, mnt);712 return mount_single(fs_type, flags, data, bm_fill_super);
713}713}
714 714
715static struct linux_binfmt misc_format = {715static struct linux_binfmt misc_format = {
@@ -720,7 +720,7 @@ static struct linux_binfmt misc_format = { · 4 unmodified lines
720static struct file_system_type bm_fs_type = {720static struct file_system_type bm_fs_type = {
721 .owner = THIS_MODULE,721 .owner = THIS_MODULE,
722 .name = "binfmt_misc",722 .name = "binfmt_misc",
723 .get_sb = bm_get_sb,723 .mount = bm_mount,
724 .kill_sb = kill_litter_super,724 .kill_sb = kill_litter_super,
725};725};
726 726
fs/configfs/mount.c+4−4
@@ -104,16 +104,16 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent) · 103 unmodified lines
104 return 0;104 return 0;
105}105}
106 106
107static int configfs_get_sb(struct file_system_type *fs_type,107static struct dentry *configfs_do_mount(struct file_system_type *fs_type,
108 int flags, const char *dev_name, void *data, struct vfsmount *mnt)108 int flags, const char *dev_name, void *data)
109{109{
110 return get_sb_single(fs_type, flags, data, configfs_fill_super, mnt);110 return mount_single(fs_type, flags, data, configfs_fill_super);
111}111}
112 112
113static struct file_system_type configfs_fs_type = {113static struct file_system_type configfs_fs_type = {
114 .owner = THIS_MODULE,114 .owner = THIS_MODULE,
115 .name = "configfs",115 .name = "configfs",
116 .get_sb = configfs_get_sb,116 .mount = configfs_do_mount,
117 .kill_sb = kill_litter_super,117 .kill_sb = kill_litter_super,
118};118};
119 119
fs/debugfs/inode.c+4−4
@@ -135,17 +135,17 @@ static int debug_fill_super(struct super_block *sb, void *data, int silent) · 134 unmodified lines
135 return simple_fill_super(sb, DEBUGFS_MAGIC, debug_files);135 return simple_fill_super(sb, DEBUGFS_MAGIC, debug_files);
136}136}
137 137
138static int debug_get_sb(struct file_system_type *fs_type,138static struct dentry *debug_mount(struct file_system_type *fs_type,
139 int flags, const char *dev_name,139 int flags, const char *dev_name,
140 void *data, struct vfsmount *mnt)140 void *data)
141{141{
142 return get_sb_single(fs_type, flags, data, debug_fill_super, mnt);142 return mount_single(fs_type, flags, data, debug_fill_super);
143}143}
144 144
145static struct file_system_type debug_fs_type = {145static struct file_system_type debug_fs_type = {
146 .owner = THIS_MODULE,146 .owner = THIS_MODULE,
147 .name = "debugfs",147 .name = "debugfs",
148 .get_sb = debug_get_sb,148 .mount = debug_mount,
149 .kill_sb = kill_litter_super,149 .kill_sb = kill_litter_super,
150};150};
151 151
fs/devpts/inode.c+15−17
@@ -331,7 +331,7 @@ static int compare_init_pts_sb(struct super_block *s, void *p) · 330 unmodified lines
331}331}
332 332
333/*333/*
334 * devpts_get_sb()334 * devpts_mount()
335 *335 *
336 * If the '-o newinstance' mount option was specified, mount a new336 * If the '-o newinstance' mount option was specified, mount a new
337 * (private) instance of devpts. PTYs created in this instance are337 * (private) instance of devpts. PTYs created in this instance are
@@ -345,20 +345,20 @@ static int compare_init_pts_sb(struct super_block *s, void *p) · 7 unmodified lines
345 * semantics in devpts while preserving backward compatibility of the345 * semantics in devpts while preserving backward compatibility of the
346 * current 'single-namespace' semantics. i.e all mounts of devpts346 * current 'single-namespace' semantics. i.e all mounts of devpts
347 * without the 'newinstance' mount option should bind to the initial347 * without the 'newinstance' mount option should bind to the initial
348 * kernel mount, like get_sb_single().348 * kernel mount, like mount_single().
349 *349 *
350 * Mounts with 'newinstance' option create a new, private namespace.350 * Mounts with 'newinstance' option create a new, private namespace.
351 *351 *
352 * NOTE:352 * NOTE:
353 *353 *
354 * For single-mount semantics, devpts cannot use get_sb_single(),354 * For single-mount semantics, devpts cannot use mount_single(),
355 * because get_sb_single()/sget() find and use the super-block from355 * because mount_single()/sget() find and use the super-block from
356 * the most recent mount of devpts. But that recent mount may be a356 * the most recent mount of devpts. But that recent mount may be a
357 * 'newinstance' mount and get_sb_single() would pick the newinstance357 * 'newinstance' mount and mount_single() would pick the newinstance
358 * super-block instead of the initial super-block.358 * super-block instead of the initial super-block.
359 */359 */
360static int devpts_get_sb(struct file_system_type *fs_type,360static struct dentry *devpts_mount(struct file_system_type *fs_type,
361 int flags, const char *dev_name, void *data, struct vfsmount *mnt)361 int flags, const char *dev_name, void *data)
362{362{
363 int error;363 int error;
364 struct pts_mount_opts opts;364 struct pts_mount_opts opts;
@@ -366,7 +366,7 @@ static int devpts_get_sb(struct file_system_type *fs_type, · 1 unmodified line
366 366
367 error = parse_mount_options(data, PARSE_MOUNT, &opts);367 error = parse_mount_options(data, PARSE_MOUNT, &opts);
368 if (error)368 if (error)
369 return error;369 return ERR_PTR(error);
370 370
371 if (opts.newinstance)371 if (opts.newinstance)
372 s = sget(fs_type, NULL, set_anon_super, NULL);372 s = sget(fs_type, NULL, set_anon_super, NULL);
@@ -374,7 +374,7 @@ static int devpts_get_sb(struct file_system_type *fs_type, · 1 unmodified line
374 s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);374 s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
375 375
376 if (IS_ERR(s))376 if (IS_ERR(s))
377 return PTR_ERR(s);377 return ERR_CAST(s);
378 378
379 if (!s->s_root) {379 if (!s->s_root) {
380 s->s_flags = flags;380 s->s_flags = flags;
@@ -390,13 +390,11 @@ static int devpts_get_sb(struct file_system_type *fs_type, · 9 unmodified lines
390 if (error)390 if (error)
391 goto out_undo_sget;391 goto out_undo_sget;
392 392
393 simple_set_mnt(mnt, s);393 return dget(s->s_root);
394
395 return 0;
396 394
397out_undo_sget:395out_undo_sget:
398 deactivate_locked_super(s);396 deactivate_locked_super(s);
399 return error;397 return ERR_PTR(error);
400}398}
401 399
402#else400#else
@@ -404,10 +402,10 @@ out_undo_sget: · 1 unmodified line
404 * This supports only the legacy single-instance semantics (no402 * This supports only the legacy single-instance semantics (no
405 * multiple-instance semantics)403 * multiple-instance semantics)
406 */404 */
407static int devpts_get_sb(struct file_system_type *fs_type, int flags,405static struct dentry *devpts_mount(struct file_system_type *fs_type, int flags,
408 const char *dev_name, void *data, struct vfsmount *mnt)406 const char *dev_name, void *data)
409{407{
410 return get_sb_single(fs_type, flags, data, devpts_fill_super, mnt);408 return mount_single(fs_type, flags, data, devpts_fill_super);
411}409}
412#endif410#endif
413 411
@@ -421,7 +419,7 @@ static void devpts_kill_sb(struct super_block *sb) · 7 unmodified lines
421 419
422static struct file_system_type devpts_fs_type = {420static struct file_system_type devpts_fs_type = {
423 .name = "devpts",421 .name = "devpts",
424 .get_sb = devpts_get_sb,422 .mount = devpts_mount,
425 .kill_sb = devpts_kill_sb,423 .kill_sb = devpts_kill_sb,
426};424};
427 425
fs/fuse/control.c+4−6
@@ -322,12 +322,10 @@ static int fuse_ctl_fill_super(struct super_block *sb, void *data, int silent) · 321 unmodified lines
322 return 0;322 return 0;
323}323}
324 324
325static int fuse_ctl_get_sb(struct file_system_type *fs_type, int flags,325static struct dentry *fuse_ctl_mount(struct file_system_type *fs_type,
326 const char *dev_name, void *raw_data,326 int flags, const char *dev_name, void *raw_data)
327 struct vfsmount *mnt)
328{327{
329 return get_sb_single(fs_type, flags, raw_data,328 return mount_single(fs_type, flags, raw_data, fuse_ctl_fill_super);
330 fuse_ctl_fill_super, mnt);
331}329}
332 330
333static void fuse_ctl_kill_sb(struct super_block *sb)331static void fuse_ctl_kill_sb(struct super_block *sb)
@@ -346,7 +344,7 @@ static void fuse_ctl_kill_sb(struct super_block *sb) · 12 unmodified lines
346static struct file_system_type fuse_ctl_fs_type = {344static struct file_system_type fuse_ctl_fs_type = {
347 .owner = THIS_MODULE,345 .owner = THIS_MODULE,
348 .name = "fusectl",346 .name = "fusectl",
349 .get_sb = fuse_ctl_get_sb,347 .mount = fuse_ctl_mount,
350 .kill_sb = fuse_ctl_kill_sb,348 .kill_sb = fuse_ctl_kill_sb,
351};349};
352 350
fs/nfsd/nfsctl.c+4−4
@@ -1405,16 +1405,16 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent) · 1404 unmodified lines
1405 return simple_fill_super(sb, 0x6e667364, nfsd_files);1405 return simple_fill_super(sb, 0x6e667364, nfsd_files);
1406}1406}
1407 1407
1408static int nfsd_get_sb(struct file_system_type *fs_type,1408static struct dentry *nfsd_mount(struct file_system_type *fs_type,
1409 int flags, const char *dev_name, void *data, struct vfsmount *mnt)1409 int flags, const char *dev_name, void *data)
1410{1410{
1411 return get_sb_single(fs_type, flags, data, nfsd_fill_super, mnt);1411 return mount_single(fs_type, flags, data, nfsd_fill_super);
1412}1412}
1413 1413
1414static struct file_system_type nfsd_fs_type = {1414static struct file_system_type nfsd_fs_type = {
1415 .owner = THIS_MODULE,1415 .owner = THIS_MODULE,
1416 .name = "nfsd",1416 .name = "nfsd",
1417 .get_sb = nfsd_get_sb,1417 .mount = nfsd_mount,
1418 .kill_sb = kill_litter_super,1418 .kill_sb = kill_litter_super,
1419};1419};
1420 1420
fs/openpromfs/inode.c+4−4
@@ -415,16 +415,16 @@ out_no_root: · 414 unmodified lines
415 return ret;415 return ret;
416}416}
417 417
418static int openprom_get_sb(struct file_system_type *fs_type,418static struct dentry *openprom_mount(struct file_system_type *fs_type,
419 int flags, const char *dev_name, void *data, struct vfsmount *mnt)419 int flags, const char *dev_name, void *data)
420{420{
421 return get_sb_single(fs_type, flags, data, openprom_fill_super, mnt);421 return mount_single(fs_type, flags, data, openprom_fill_super)
422}422}
423 423
424static struct file_system_type openprom_fs_type = {424static struct file_system_type openprom_fs_type = {
425 .owner = THIS_MODULE,425 .owner = THIS_MODULE,
426 .name = "openpromfs",426 .name = "openpromfs",
427 .get_sb = openprom_get_sb,427 .mount = openprom_mount,
428 .kill_sb = kill_anon_super,428 .kill_sb = kill_anon_super,
429};429};
430 430
fs/super.c+19−6
@@ -900,29 +900,42 @@ static int compare_single(struct super_block *s, void *p) · 899 unmodified lines
900 return 1;900 return 1;
901}901}
902 902
903int get_sb_single(struct file_system_type *fs_type,903struct dentry *mount_single(struct file_system_type *fs_type,
904 int flags, void *data,904 int flags, void *data,
905 int (*fill_super)(struct super_block *, void *, int),905 int (*fill_super)(struct super_block *, void *, int))
906 struct vfsmount *mnt)
907{906{
908 struct super_block *s;907 struct super_block *s;
909 int error;908 int error;
910 909
911 s = sget(fs_type, compare_single, set_anon_super, NULL);910 s = sget(fs_type, compare_single, set_anon_super, NULL);
912 if (IS_ERR(s))911 if (IS_ERR(s))
913 return PTR_ERR(s);912 return ERR_CAST(s);
914 if (!s->s_root) {913 if (!s->s_root) {
915 s->s_flags = flags;914 s->s_flags = flags;
916 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);915 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
917 if (error) {916 if (error) {
918 deactivate_locked_super(s);917 deactivate_locked_super(s);
919 return error;918 return ERR_PTR(error);
920 }919 }
921 s->s_flags |= MS_ACTIVE;920 s->s_flags |= MS_ACTIVE;
922 } else {921 } else {
923 do_remount_sb(s, flags, data, 0);922 do_remount_sb(s, flags, data, 0);
924 }923 }
925 simple_set_mnt(mnt, s);924 return dget(s->s_root);
925}
926EXPORT_SYMBOL(mount_single);
927
928int get_sb_single(struct file_system_type *fs_type,
929 int flags, void *data,
930 int (*fill_super)(struct super_block *, void *, int),
931 struct vfsmount *mnt)
932{
933 struct dentry *root;
934 root = mount_single(fs_type, flags, data, fill_super);
935 if (IS_ERR(root))
936 return PTR_ERR(root);
937 mnt->mnt_root = root;
938 mnt->mnt_sb = root->d_sb;
926 return 0;939 return 0;
927}940}
928 941
include/linux/fs.h+3−0
@@ -1799,6 +1799,9 @@ extern int get_sb_bdev(struct file_system_type *fs_type, · 1798 unmodified lines
1799 int flags, const char *dev_name, void *data,1799 int flags, const char *dev_name, void *data,
1800 int (*fill_super)(struct super_block *, void *, int),1800 int (*fill_super)(struct super_block *, void *, int),
1801 struct vfsmount *mnt);1801 struct vfsmount *mnt);
1802extern struct dentry *mount_single(struct file_system_type *fs_type,
1803 int flags, void *data,
1804 int (*fill_super)(struct super_block *, void *, int));
1802extern int get_sb_single(struct file_system_type *fs_type,1805extern int get_sb_single(struct file_system_type *fs_type,
1803 int flags, void *data,1806 int flags, void *data,
1804 int (*fill_super)(struct super_block *, void *, int),1807 int (*fill_super)(struct super_block *, void *, int),
net/sunrpc/rpc_pipe.c+9−9
@@ -28,7 +28,7 @@ · 27 unmodified lines
28#include <linux/sunrpc/rpc_pipe_fs.h>28#include <linux/sunrpc/rpc_pipe_fs.h>
29#include <linux/sunrpc/cache.h>29#include <linux/sunrpc/cache.h>
30 30
31static struct vfsmount *rpc_mount __read_mostly;31static struct vfsmount *rpc_mnt __read_mostly;
32static int rpc_mount_count;32static int rpc_mount_count;
33 33
34static struct file_system_type rpc_pipe_fs_type;34static struct file_system_type rpc_pipe_fs_type;
@@ -417,16 +417,16 @@ struct vfsmount *rpc_get_mount(void) · 382 unmodified lines
417{417{
418 int err;418 int err;
419 419
420 err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mount, &rpc_mount_count);420 err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mnt, &rpc_mount_count);
421 if (err != 0)421 if (err != 0)
422 return ERR_PTR(err);422 return ERR_PTR(err);
423 return rpc_mount;423 return rpc_mnt;
424}424}
425EXPORT_SYMBOL_GPL(rpc_get_mount);425EXPORT_SYMBOL_GPL(rpc_get_mount);
426 426
427void rpc_put_mount(void)427void rpc_put_mount(void)
428{428{
429 simple_release_fs(&rpc_mount, &rpc_mount_count);429 simple_release_fs(&rpc_mnt, &rpc_mount_count);
430}430}
431EXPORT_SYMBOL_GPL(rpc_put_mount);431EXPORT_SYMBOL_GPL(rpc_put_mount);
432 432
@@ -1018,17 +1018,17 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) · 585 unmodified lines
1018 return 0;1018 return 0;
1019}1019}
1020 1020
1021static int1021static struct dentry *
1022rpc_get_sb(struct file_system_type *fs_type,1022rpc_mount(struct file_system_type *fs_type,
1023 int flags, const char *dev_name, void *data, struct vfsmount *mnt)1023 int flags, const char *dev_name, void *data)
1024{1024{
1025 return get_sb_single(fs_type, flags, data, rpc_fill_super, mnt);1025 return mount_single(fs_type, flags, data, rpc_fill_super);
1026}1026}
1027 1027
1028static struct file_system_type rpc_pipe_fs_type = {1028static struct file_system_type rpc_pipe_fs_type = {
1029 .owner = THIS_MODULE,1029 .owner = THIS_MODULE,
1030 .name = "rpc_pipefs",1030 .name = "rpc_pipefs",
1031 .get_sb = rpc_get_sb,1031 .mount = rpc_mount,
1032 .kill_sb = kill_litter_super,1032 .kill_sb = kill_litter_super,
1033};1033};
1034 1034
security/inode.c+4−4
@@ -131,17 +131,17 @@ static int fill_super(struct super_block *sb, void *data, int silent) · 130 unmodified lines
131 return simple_fill_super(sb, SECURITYFS_MAGIC, files);131 return simple_fill_super(sb, SECURITYFS_MAGIC, files);
132}132}
133 133
134static int get_sb(struct file_system_type *fs_type,134static struct dentry *get_sb(struct file_system_type *fs_type,
135 int flags, const char *dev_name,135 int flags, const char *dev_name,
136 void *data, struct vfsmount *mnt)136 void *data)
137{137{
138 return get_sb_single(fs_type, flags, data, fill_super, mnt);138 return mount_single(fs_type, flags, data, fill_super);
139}139}
140 140
141static struct file_system_type fs_type = {141static struct file_system_type fs_type = {
142 .owner = THIS_MODULE,142 .owner = THIS_MODULE,
143 .name = "securityfs",143 .name = "securityfs",
144 .get_sb = get_sb,144 .mount = get_sb,
145 .kill_sb = kill_litter_super,145 .kill_sb = kill_litter_super,
146};146};
147 147
security/selinux/selinuxfs.c+4−5
@@ -1909,16 +1909,15 @@ err: · 1908 unmodified lines
1909 goto out;1909 goto out;
1910}1910}
1911 1911
1912static int sel_get_sb(struct file_system_type *fs_type,1912static struct dentry *sel_mount(struct file_system_type *fs_type,
1913 int flags, const char *dev_name, void *data,1913 int flags, const char *dev_name, void *data)
1914 struct vfsmount *mnt)
1915{1914{
1916 return get_sb_single(fs_type, flags, data, sel_fill_super, mnt);1915 return mount_single(fs_type, flags, data, sel_fill_super);
1917}1916}
1918 1917
1919static struct file_system_type sel_fs_type = {1918static struct file_system_type sel_fs_type = {
1920 .name = "selinuxfs",1919 .name = "selinuxfs",
1921 .get_sb = sel_get_sb,1920 .mount = sel_mount,
1922 .kill_sb = kill_litter_super,1921 .kill_sb = kill_litter_super,
1923};1922};
1924 1923
security/smack/smackfs.c+5−7
@@ -1310,27 +1310,25 @@ static int smk_fill_super(struct super_block *sb, void *data, int silent) · 1309 unmodified lines
1310}1310}
1311 1311
1312/**1312/**
1313 * smk_get_sb - get the smackfs superblock1313 * smk_mount - get the smackfs superblock
1314 * @fs_type: passed along without comment1314 * @fs_type: passed along without comment
1315 * @flags: passed along without comment1315 * @flags: passed along without comment
1316 * @dev_name: passed along without comment1316 * @dev_name: passed along without comment
1317 * @data: passed along without comment1317 * @data: passed along without comment
1318 * @mnt: passed along without comment
1319 *1318 *
1320 * Just passes everything along.1319 * Just passes everything along.
1321 *1320 *
1322 * Returns what the lower level code does.1321 * Returns what the lower level code does.
1323 */1322 */
1324static int smk_get_sb(struct file_system_type *fs_type,1323static struct dentry *smk_mount(struct file_system_type *fs_type,
1325 int flags, const char *dev_name, void *data,1324 int flags, const char *dev_name, void *data)
1326 struct vfsmount *mnt)
1327{1325{
1328 return get_sb_single(fs_type, flags, data, smk_fill_super, mnt);1326 return mount_single(fs_type, flags, data, smk_fill_super);
1329}1327}
1330 1328
1331static struct file_system_type smk_fs_type = {1329static struct file_system_type smk_fs_type = {
1332 .name = "smackfs",1330 .name = "smackfs",
1333 .get_sb = smk_get_sb,1331 .mount = smk_mount,
1334 .kill_sb = kill_litter_super,1332 .kill_sb = kill_litter_super,
1335};1333};
1336 1334