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
798798 return spufs_create_root(sb, data);
799799 }
800800
801−static int
802−spufs_get_sb(struct file_system_type *fstype, int flags,
803− const char *name, void *data, struct vfsmount *mnt)
801+static struct dentry *
802+spufs_mount(struct file_system_type *fstype, int flags,
803+ const char *name, void *data)
804804 {
805− return get_sb_single(fstype, flags, data, spufs_fill_super, mnt);
805+ return mount_single(fstype, flags, data, spufs_fill_super);
806806 }
807807
808808 static struct file_system_type spufs_type = {
809809 .owner = THIS_MODULE,
810810 .name = "spufs",
811− .get_sb = spufs_get_sb,
811+ .mount = spufs_mount,
812812 .kill_sb = kill_litter_super,
813813 };
814814
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
316316 return 0;
317317 }
318318
319−static int hypfs_get_super(struct file_system_type *fst, int flags,
320− const char *devname, void *data, struct vfsmount *mnt)
319+static struct dentry *hypfs_mount(struct file_system_type *fst, int flags,
320+ const char *devname, void *data)
321321 {
322− return get_sb_single(fst, flags, data, hypfs_fill_super, mnt);
322+ return mount_single(fst, flags, data, hypfs_fill_super);
323323 }
324324
325325 static void hypfs_kill_super(struct super_block *sb)
@@ -455,7 +455,7 @@ static const struct file_operations hypfs_file_ops = { · 129 unmodified lines
455455 static struct file_system_type hypfs_type = {
456456 .owner = THIS_MODULE,
457457 .name = "s390_hypfs",
458− .get_sb = hypfs_get_super,
458+ .mount = hypfs_mount,
459459 .kill_sb = hypfs_kill_super
460460 };
461461
drivers/base/devtmpfs.c+9−9
@@ -29,33 +29,33 @@ · 28 unmodified lines
2929 static struct vfsmount *dev_mnt;
3030
3131 #if defined CONFIG_DEVTMPFS_MOUNT
32−static int dev_mount = 1;
32+static int mount_dev = 1;
3333 #else
34−static int dev_mount;
34+static int mount_dev;
3535 #endif
3636
3737 static DEFINE_MUTEX(dirlock);
3838
3939 static int __init mount_param(char *str)
4040 {
41− dev_mount = simple_strtoul(str, NULL, 0);
41+ mount_dev = simple_strtoul(str, NULL, 0);
4242 return 1;
4343 }
4444 __setup("devtmpfs.mount=", mount_param);
4545
46−static int dev_get_sb(struct file_system_type *fs_type, int flags,
47− const char *dev_name, void *data, struct vfsmount *mnt)
46+static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
47+ const char *dev_name, void *data)
4848 {
4949 #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);
5151 #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);
5353 #endif
5454 }
5555
5656 static struct file_system_type dev_fs_type = {
5757 .name = "devtmpfs",
58− .get_sb = dev_get_sb,
58+ .mount = dev_mount,
5959 .kill_sb = kill_litter_super,
6060 };
6161
@@ -351,7 +351,7 @@ int devtmpfs_mount(const char *mntdir) · 289 unmodified lines
351351 {
352352 int err;
353353
354− if (!dev_mount)
354+ if (!mount_dev)
355355 return 0;
356356
357357 if (!dev_mnt)
drivers/infiniband/hw/ipath/ipath_fs.c+7−7
@@ -362,13 +362,13 @@ bail: · 361 unmodified lines
362362 return ret;
363363 }
364364
365−static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
366− const char *dev_name, void *data, struct vfsmount *mnt)
365+static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
366+ int flags, const char *dev_name, void *data)
367367 {
368− int ret = get_sb_single(fs_type, flags, data,
369− ipathfs_fill_super, mnt);
370− if (ret >= 0)
371− ipath_super = mnt->mnt_sb;
368+ struct dentry *ret;
369+ ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
370+ if (!IS_ERR(ret))
371+ ipath_super = ret->d_sb;
372372 return ret;
373373 }
374374
@@ -411,7 +411,7 @@ bail: · 36 unmodified lines
411411 static struct file_system_type ipathfs_fs_type = {
412412 .owner = THIS_MODULE,
413413 .name = "ipathfs",
414− .get_sb = ipathfs_get_sb,
414+ .mount = ipathfs_mount,
415415 .kill_sb = ipathfs_kill_super,
416416 };
417417
drivers/infiniband/hw/qib/qib_fs.c+7−7
@@ -555,13 +555,13 @@ bail: · 554 unmodified lines
555555 return ret;
556556 }
557557
558−static int qibfs_get_sb(struct file_system_type *fs_type, int flags,
559− const char *dev_name, void *data, struct vfsmount *mnt)
558+static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
559+ const char *dev_name, void *data)
560560 {
561− int ret = get_sb_single(fs_type, flags, data,
562− qibfs_fill_super, mnt);
563− if (ret >= 0)
564− qib_super = mnt->mnt_sb;
561+ struct dentry *ret;
562+ ret = mount_single(fs_type, flags, data, qibfs_fill_super);
563+ if (!IS_ERR(ret))
564+ qib_super = ret->d_sb;
565565 return ret;
566566 }
567567
@@ -603,7 +603,7 @@ int qibfs_remove(struct qib_devdata *dd) · 35 unmodified lines
603603 static struct file_system_type qibfs_fs_type = {
604604 .owner = THIS_MODULE,
605605 .name = "ipathfs",
606− .get_sb = qibfs_get_sb,
606+ .mount = qibfs_mount,
607607 .kill_sb = qibfs_kill_super,
608608 };
609609
drivers/isdn/capi/capifs.c+4−4
@@ -125,16 +125,16 @@ fail: · 124 unmodified lines
125125 return -ENOMEM;
126126 }
127127
128−static int capifs_get_sb(struct file_system_type *fs_type,
129− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
128+static struct dentry *capifs_mount(struct file_system_type *fs_type,
129+ int flags, const char *dev_name, void *data)
130130 {
131− return get_sb_single(fs_type, flags, data, capifs_fill_super, mnt);
131+ return mount_single(fs_type, flags, data, capifs_fill_super);
132132 }
133133
134134 static struct file_system_type capifs_fs_type = {
135135 .owner = THIS_MODULE,
136136 .name = "capifs",
137− .get_sb = capifs_get_sb,
137+ .mount = capifs_mount,
138138 .kill_sb = kill_anon_super,
139139 };
140140
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
9191 static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
9292
9393
94−static int ibmasmfs_get_super(struct file_system_type *fst,
95− int flags, const char *name, void *data,
96− struct vfsmount *mnt)
94+static struct dentry *ibmasmfs_mount(struct file_system_type *fst,
95+ int flags, const char *name, void *data)
9796 {
98− return get_sb_single(fst, flags, data, ibmasmfs_fill_super, mnt);
97+ return mount_single(fst, flags, data, ibmasmfs_fill_super);
9998 }
10099
101100 static 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
108107 static struct file_system_type ibmasmfs_type = {
109108 .owner = THIS_MODULE,
110109 .name = "ibmasmfs",
111− .get_sb = ibmasmfs_get_super,
110+ .mount = ibmasmfs_mount,
112111 .kill_sb = kill_litter_super,
113112 };
114113
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
259259 }
260260
261261
262−static int oprofilefs_get_sb(struct file_system_type *fs_type,
263− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
262+static struct dentry *oprofilefs_mount(struct file_system_type *fs_type,
263+ int flags, const char *dev_name, void *data)
264264 {
265− return get_sb_single(fs_type, flags, data, oprofilefs_fill_super, mnt);
265+ return mount_single(fs_type, flags, data, oprofilefs_fill_super);
266266 }
267267
268268
269269 static struct file_system_type oprofilefs_type = {
270270 .owner = THIS_MODULE,
271271 .name = "oprofilefs",
272− .get_sb = oprofilefs_get_sb,
272+ .mount = oprofilefs_mount,
273273 .kill_sb = kill_litter_super,
274274 };
275275
drivers/usb/core/inode.c+4−4
@@ -574,16 +574,16 @@ static void fs_remove_file (struct dentry *dentry) · 573 unmodified lines
574574
575575 /* --------------------------------------------------------------------- */
576576
577−static int usb_get_sb(struct file_system_type *fs_type,
578− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
577+static struct dentry *usb_mount(struct file_system_type *fs_type,
578+ int flags, const char *dev_name, void *data)
579579 {
580− return get_sb_single(fs_type, flags, data, usbfs_fill_super, mnt);
580+ return mount_single(fs_type, flags, data, usbfs_fill_super);
581581 }
582582
583583 static struct file_system_type usb_fs_type = {
584584 .owner = THIS_MODULE,
585585 .name = "usbfs",
586− .get_sb = usb_get_sb,
586+ .mount = usb_mount,
587587 .kill_sb = kill_litter_super,
588588 };
589589
drivers/usb/gadget/f_fs.c+7−7
@@ -1176,9 +1176,9 @@ invalid: · 1175 unmodified lines
11761176
11771177 /* "mount -t functionfs dev_name /dev/function" ends up here */
11781178
1179−static int
1180−ffs_fs_get_sb(struct file_system_type *t, int flags,
1181− const char *dev_name, void *opts, struct vfsmount *mnt)
1179+static struct dentry *
1180+ffs_fs_mount(struct file_system_type *t, int flags,
1181+ const char *dev_name, void *opts)
11821182 {
11831183 struct ffs_sb_fill_data data = {
11841184 .perms = {
@@ -1194,14 +1194,14 @@ ffs_fs_get_sb(struct file_system_type *t, int flags, · 9 unmodified lines
11941194
11951195 ret = functionfs_check_dev_callback(dev_name);
11961196 if (unlikely(ret < 0))
1197− return ret;
1197+ return ERR_PTR(ret);
11981198
11991199 ret = ffs_fs_parse_opts(&data, opts);
12001200 if (unlikely(ret < 0))
1201− return ret;
1201+ return ERR_PTR(ret);
12021202
12031203 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);
12051205 }
12061206
12071207 static void
@@ -1220,7 +1220,7 @@ ffs_fs_kill_sb(struct super_block *sb) · 12 unmodified lines
12201220 static struct file_system_type ffs_fs_type = {
12211221 .owner = THIS_MODULE,
12221222 .name = "functionfs",
1223− .get_sb = ffs_fs_get_sb,
1223+ .mount = ffs_fs_mount,
12241224 .kill_sb = ffs_fs_kill_sb,
12251225 };
12261226
drivers/usb/gadget/inode.c+5−5
@@ -2097,11 +2097,11 @@ enomem0: · 2096 unmodified lines
20972097 }
20982098
20992099 /* "mount -t gadgetfs path /dev/gadget" ends up here */
2100−static int
2101−gadgetfs_get_sb (struct file_system_type *t, int flags,
2102− const char *path, void *opts, struct vfsmount *mnt)
2100+static struct dentry *
2101+gadgetfs_mount (struct file_system_type *t, int flags,
2102+ const char *path, void *opts)
21032103 {
2104− return get_sb_single (t, flags, opts, gadgetfs_fill_super, mnt);
2104+ return mount_single (t, flags, opts, gadgetfs_fill_super);
21052105 }
21062106
21072107 static void
@@ -2119,7 +2119,7 @@ gadgetfs_kill_sb (struct super_block *sb) · 11 unmodified lines
21192119 static struct file_system_type gadgetfs_type = {
21202120 .owner = THIS_MODULE,
21212121 .name = shortname,
2122− .get_sb = gadgetfs_get_sb,
2122+ .mount = gadgetfs_mount,
21232123 .kill_sb = gadgetfs_kill_sb,
21242124 };
21252125
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
121121 return rc;
122122 }
123123
124−static int xenfs_get_sb(struct file_system_type *fs_type,
124+static int xenfs_mount(struct file_system_type *fs_type,
125125 int flags, const char *dev_name,
126− void *data, struct vfsmount *mnt)
126+ void *data)
127127 {
128− return get_sb_single(fs_type, flags, data, xenfs_fill_super, mnt);
128+ return mount_single(fs_type, flags, data, xenfs_fill_super);
129129 }
130130
131131 static struct file_system_type xenfs_type = {
132132 .owner = THIS_MODULE,
133133 .name = "xenfs",
134− .get_sb = xenfs_get_sb,
134+ .mount = xenfs_mount,
135135 .kill_sb = kill_litter_super,
136136 };
137137
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
706706 return err;
707707 }
708708
709−static int bm_get_sb(struct file_system_type *fs_type,
710− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
709+static struct dentry *bm_mount(struct file_system_type *fs_type,
710+ int flags, const char *dev_name, void *data)
711711 {
712− return get_sb_single(fs_type, flags, data, bm_fill_super, mnt);
712+ return mount_single(fs_type, flags, data, bm_fill_super);
713713 }
714714
715715 static struct linux_binfmt misc_format = {
@@ -720,7 +720,7 @@ static struct linux_binfmt misc_format = { · 4 unmodified lines
720720 static struct file_system_type bm_fs_type = {
721721 .owner = THIS_MODULE,
722722 .name = "binfmt_misc",
723− .get_sb = bm_get_sb,
723+ .mount = bm_mount,
724724 .kill_sb = kill_litter_super,
725725 };
726726
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
104104 return 0;
105105 }
106106
107−static int configfs_get_sb(struct file_system_type *fs_type,
108− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
107+static struct dentry *configfs_do_mount(struct file_system_type *fs_type,
108+ int flags, const char *dev_name, void *data)
109109 {
110− return get_sb_single(fs_type, flags, data, configfs_fill_super, mnt);
110+ return mount_single(fs_type, flags, data, configfs_fill_super);
111111 }
112112
113113 static struct file_system_type configfs_fs_type = {
114114 .owner = THIS_MODULE,
115115 .name = "configfs",
116− .get_sb = configfs_get_sb,
116+ .mount = configfs_do_mount,
117117 .kill_sb = kill_litter_super,
118118 };
119119
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
135135 return simple_fill_super(sb, DEBUGFS_MAGIC, debug_files);
136136 }
137137
138−static int debug_get_sb(struct file_system_type *fs_type,
138+static struct dentry *debug_mount(struct file_system_type *fs_type,
139139 int flags, const char *dev_name,
140− void *data, struct vfsmount *mnt)
140+ void *data)
141141 {
142− return get_sb_single(fs_type, flags, data, debug_fill_super, mnt);
142+ return mount_single(fs_type, flags, data, debug_fill_super);
143143 }
144144
145145 static struct file_system_type debug_fs_type = {
146146 .owner = THIS_MODULE,
147147 .name = "debugfs",
148− .get_sb = debug_get_sb,
148+ .mount = debug_mount,
149149 .kill_sb = kill_litter_super,
150150 };
151151
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
331331 }
332332
333333 /*
334− * devpts_get_sb()
334+ * devpts_mount()
335335 *
336336 * If the '-o newinstance' mount option was specified, mount a new
337337 * (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
345345 * semantics in devpts while preserving backward compatibility of the
346346 * current 'single-namespace' semantics. i.e all mounts of devpts
347347 * without the 'newinstance' mount option should bind to the initial
348− * kernel mount, like get_sb_single().
348+ * kernel mount, like mount_single().
349349 *
350350 * Mounts with 'newinstance' option create a new, private namespace.
351351 *
352352 * NOTE:
353353 *
354− * For single-mount semantics, devpts cannot use get_sb_single(),
355− * because get_sb_single()/sget() find and use the super-block from
354+ * For single-mount semantics, devpts cannot use mount_single(),
355+ * because mount_single()/sget() find and use the super-block from
356356 * the most recent mount of devpts. But that recent mount may be a
357− * 'newinstance' mount and get_sb_single() would pick the newinstance
357+ * 'newinstance' mount and mount_single() would pick the newinstance
358358 * super-block instead of the initial super-block.
359359 */
360−static int devpts_get_sb(struct file_system_type *fs_type,
361− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
360+static struct dentry *devpts_mount(struct file_system_type *fs_type,
361+ int flags, const char *dev_name, void *data)
362362 {
363363 int error;
364364 struct pts_mount_opts opts;
@@ -366,7 +366,7 @@ static int devpts_get_sb(struct file_system_type *fs_type, · 1 unmodified line
366366
367367 error = parse_mount_options(data, PARSE_MOUNT, &opts);
368368 if (error)
369− return error;
369+ return ERR_PTR(error);
370370
371371 if (opts.newinstance)
372372 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
374374 s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
375375
376376 if (IS_ERR(s))
377− return PTR_ERR(s);
377+ return ERR_CAST(s);
378378
379379 if (!s->s_root) {
380380 s->s_flags = flags;
@@ -390,13 +390,11 @@ static int devpts_get_sb(struct file_system_type *fs_type, · 9 unmodified lines
390390 if (error)
391391 goto out_undo_sget;
392392
393− simple_set_mnt(mnt, s);
394−
395− return 0;
393+ return dget(s->s_root);
396394
397395 out_undo_sget:
398396 deactivate_locked_super(s);
399− return error;
397+ return ERR_PTR(error);
400398 }
401399
402400 #else
@@ -404,10 +402,10 @@ out_undo_sget: · 1 unmodified line
404402 * This supports only the legacy single-instance semantics (no
405403 * multiple-instance semantics)
406404 */
407−static int devpts_get_sb(struct file_system_type *fs_type, int flags,
408− const char *dev_name, void *data, struct vfsmount *mnt)
405+static struct dentry *devpts_mount(struct file_system_type *fs_type, int flags,
406+ const char *dev_name, void *data)
409407 {
410− return get_sb_single(fs_type, flags, data, devpts_fill_super, mnt);
408+ return mount_single(fs_type, flags, data, devpts_fill_super);
411409 }
412410 #endif
413411
@@ -421,7 +419,7 @@ static void devpts_kill_sb(struct super_block *sb) · 7 unmodified lines
421419
422420 static struct file_system_type devpts_fs_type = {
423421 .name = "devpts",
424− .get_sb = devpts_get_sb,
422+ .mount = devpts_mount,
425423 .kill_sb = devpts_kill_sb,
426424 };
427425
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
322322 return 0;
323323 }
324324
325−static int fuse_ctl_get_sb(struct file_system_type *fs_type, int flags,
326− const char *dev_name, void *raw_data,
327− struct vfsmount *mnt)
325+static struct dentry *fuse_ctl_mount(struct file_system_type *fs_type,
326+ int flags, const char *dev_name, void *raw_data)
328327 {
329− return get_sb_single(fs_type, flags, raw_data,
330− fuse_ctl_fill_super, mnt);
328+ return mount_single(fs_type, flags, raw_data, fuse_ctl_fill_super);
331329 }
332330
333331 static 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
346344 static struct file_system_type fuse_ctl_fs_type = {
347345 .owner = THIS_MODULE,
348346 .name = "fusectl",
349− .get_sb = fuse_ctl_get_sb,
347+ .mount = fuse_ctl_mount,
350348 .kill_sb = fuse_ctl_kill_sb,
351349 };
352350
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
14051405 return simple_fill_super(sb, 0x6e667364, nfsd_files);
14061406 }
14071407
1408−static int nfsd_get_sb(struct file_system_type *fs_type,
1409− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
1408+static struct dentry *nfsd_mount(struct file_system_type *fs_type,
1409+ int flags, const char *dev_name, void *data)
14101410 {
1411− return get_sb_single(fs_type, flags, data, nfsd_fill_super, mnt);
1411+ return mount_single(fs_type, flags, data, nfsd_fill_super);
14121412 }
14131413
14141414 static struct file_system_type nfsd_fs_type = {
14151415 .owner = THIS_MODULE,
14161416 .name = "nfsd",
1417− .get_sb = nfsd_get_sb,
1417+ .mount = nfsd_mount,
14181418 .kill_sb = kill_litter_super,
14191419 };
14201420
fs/openpromfs/inode.c+4−4
@@ -415,16 +415,16 @@ out_no_root: · 414 unmodified lines
415415 return ret;
416416 }
417417
418−static int openprom_get_sb(struct file_system_type *fs_type,
419− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
418+static struct dentry *openprom_mount(struct file_system_type *fs_type,
419+ int flags, const char *dev_name, void *data)
420420 {
421− return get_sb_single(fs_type, flags, data, openprom_fill_super, mnt);
421+ return mount_single(fs_type, flags, data, openprom_fill_super)
422422 }
423423
424424 static struct file_system_type openprom_fs_type = {
425425 .owner = THIS_MODULE,
426426 .name = "openpromfs",
427− .get_sb = openprom_get_sb,
427+ .mount = openprom_mount,
428428 .kill_sb = kill_anon_super,
429429 };
430430
fs/super.c+19−6
@@ -900,29 +900,42 @@ static int compare_single(struct super_block *s, void *p) · 899 unmodified lines
900900 return 1;
901901 }
902902
903−int get_sb_single(struct file_system_type *fs_type,
903+struct dentry *mount_single(struct file_system_type *fs_type,
904904 int flags, void *data,
905− int (*fill_super)(struct super_block *, void *, int),
906− struct vfsmount *mnt)
905+ int (*fill_super)(struct super_block *, void *, int))
907906 {
908907 struct super_block *s;
909908 int error;
910909
911910 s = sget(fs_type, compare_single, set_anon_super, NULL);
912911 if (IS_ERR(s))
913− return PTR_ERR(s);
912+ return ERR_CAST(s);
914913 if (!s->s_root) {
915914 s->s_flags = flags;
916915 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
917916 if (error) {
918917 deactivate_locked_super(s);
919− return error;
918+ return ERR_PTR(error);
920919 }
921920 s->s_flags |= MS_ACTIVE;
922921 } else {
923922 do_remount_sb(s, flags, data, 0);
924923 }
925− simple_set_mnt(mnt, s);
924+ return dget(s->s_root);
925+}
926+EXPORT_SYMBOL(mount_single);
927+
928+int 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;
926939 return 0;
927940 }
928941
include/linux/fs.h+3−0
@@ -1799,6 +1799,9 @@ extern int get_sb_bdev(struct file_system_type *fs_type, · 1798 unmodified lines
17991799 int flags, const char *dev_name, void *data,
18001800 int (*fill_super)(struct super_block *, void *, int),
18011801 struct vfsmount *mnt);
1802+extern struct dentry *mount_single(struct file_system_type *fs_type,
1803+ int flags, void *data,
1804+ int (*fill_super)(struct super_block *, void *, int));
18021805 extern int get_sb_single(struct file_system_type *fs_type,
18031806 int flags, void *data,
18041807 int (*fill_super)(struct super_block *, void *, int),
net/sunrpc/rpc_pipe.c+9−9
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <linux/sunrpc/rpc_pipe_fs.h>
2929 #include <linux/sunrpc/cache.h>
3030
31−static struct vfsmount *rpc_mount __read_mostly;
31+static struct vfsmount *rpc_mnt __read_mostly;
3232 static int rpc_mount_count;
3333
3434 static struct file_system_type rpc_pipe_fs_type;
@@ -417,16 +417,16 @@ struct vfsmount *rpc_get_mount(void) · 382 unmodified lines
417417 {
418418 int err;
419419
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);
421421 if (err != 0)
422422 return ERR_PTR(err);
423− return rpc_mount;
423+ return rpc_mnt;
424424 }
425425 EXPORT_SYMBOL_GPL(rpc_get_mount);
426426
427427 void rpc_put_mount(void)
428428 {
429− simple_release_fs(&rpc_mount, &rpc_mount_count);
429+ simple_release_fs(&rpc_mnt, &rpc_mount_count);
430430 }
431431 EXPORT_SYMBOL_GPL(rpc_put_mount);
432432
@@ -1018,17 +1018,17 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) · 585 unmodified lines
10181018 return 0;
10191019 }
10201020
1021−static int
1022−rpc_get_sb(struct file_system_type *fs_type,
1023− int flags, const char *dev_name, void *data, struct vfsmount *mnt)
1021+static struct dentry *
1022+rpc_mount(struct file_system_type *fs_type,
1023+ int flags, const char *dev_name, void *data)
10241024 {
1025− return get_sb_single(fs_type, flags, data, rpc_fill_super, mnt);
1025+ return mount_single(fs_type, flags, data, rpc_fill_super);
10261026 }
10271027
10281028 static struct file_system_type rpc_pipe_fs_type = {
10291029 .owner = THIS_MODULE,
10301030 .name = "rpc_pipefs",
1031− .get_sb = rpc_get_sb,
1031+ .mount = rpc_mount,
10321032 .kill_sb = kill_litter_super,
10331033 };
10341034
security/inode.c+4−4
@@ -131,17 +131,17 @@ static int fill_super(struct super_block *sb, void *data, int silent) · 130 unmodified lines
131131 return simple_fill_super(sb, SECURITYFS_MAGIC, files);
132132 }
133133
134−static int get_sb(struct file_system_type *fs_type,
134+static struct dentry *get_sb(struct file_system_type *fs_type,
135135 int flags, const char *dev_name,
136− void *data, struct vfsmount *mnt)
136+ void *data)
137137 {
138− return get_sb_single(fs_type, flags, data, fill_super, mnt);
138+ return mount_single(fs_type, flags, data, fill_super);
139139 }
140140
141141 static struct file_system_type fs_type = {
142142 .owner = THIS_MODULE,
143143 .name = "securityfs",
144− .get_sb = get_sb,
144+ .mount = get_sb,
145145 .kill_sb = kill_litter_super,
146146 };
147147
security/selinux/selinuxfs.c+4−5
@@ -1909,16 +1909,15 @@ err: · 1908 unmodified lines
19091909 goto out;
19101910 }
19111911
1912−static int sel_get_sb(struct file_system_type *fs_type,
1913− int flags, const char *dev_name, void *data,
1914− struct vfsmount *mnt)
1912+static struct dentry *sel_mount(struct file_system_type *fs_type,
1913+ int flags, const char *dev_name, void *data)
19151914 {
1916− return get_sb_single(fs_type, flags, data, sel_fill_super, mnt);
1915+ return mount_single(fs_type, flags, data, sel_fill_super);
19171916 }
19181917
19191918 static struct file_system_type sel_fs_type = {
19201919 .name = "selinuxfs",
1921− .get_sb = sel_get_sb,
1920+ .mount = sel_mount,
19221921 .kill_sb = kill_litter_super,
19231922 };
19241923
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
13101310 }
13111311
13121312 /**
1313− * smk_get_sb - get the smackfs superblock
1313+ * smk_mount - get the smackfs superblock
13141314 * @fs_type: passed along without comment
13151315 * @flags: passed along without comment
13161316 * @dev_name: passed along without comment
13171317 * @data: passed along without comment
1318− * @mnt: passed along without comment
13191318 *
13201319 * Just passes everything along.
13211320 *
13221321 * Returns what the lower level code does.
13231322 */
1324−static int smk_get_sb(struct file_system_type *fs_type,
1325− int flags, const char *dev_name, void *data,
1326− struct vfsmount *mnt)
1323+static struct dentry *smk_mount(struct file_system_type *fs_type,
1324+ int flags, const char *dev_name, void *data)
13271325 {
1328− return get_sb_single(fs_type, flags, data, smk_fill_super, mnt);
1326+ return mount_single(fs_type, flags, data, smk_fill_super);
13291327 }
13301328
13311329 static struct file_system_type smk_fs_type = {
13321330 .name = "smackfs",
1333− .get_sb = smk_get_sb,
1331+ .mount = smk_mount,
13341332 .kill_sb = kill_litter_super,
13351333 };
13361334