Unified · Split
| @@ -798,17 +798,17 @@ spufs_fill_super(struct super_block *sb, void *data, int silent) · 797 unmodified lines | ||
| 798 | 798 | return spufs_create_root(sb, data); |
| 799 | 799 | } |
| 800 | 800 | |
| 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) | |
| 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 | |
| 808 | 808 | static struct file_system_type spufs_type = { |
| 809 | 809 | .owner = THIS_MODULE, |
| 810 | 810 | .name = "spufs", |
| 811 | − .get_sb = spufs_get_sb, | |
| 811 | + .mount = spufs_mount, | |
| 812 | 812 | .kill_sb = kill_litter_super, |
| 813 | 813 | }; |
| 814 | 814 | |
| @@ -316,10 +316,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) · 315 unmodified lines | ||
| 316 | 316 | return 0; |
| 317 | 317 | } |
| 318 | 318 | |
| 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) | |
| 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 | |
| 325 | 325 | static void hypfs_kill_super(struct super_block *sb) |
| @@ -455,7 +455,7 @@ static const struct file_operations hypfs_file_ops = { · 129 unmodified lines | ||
| 455 | 455 | static struct file_system_type hypfs_type = { |
| 456 | 456 | .owner = THIS_MODULE, |
| 457 | 457 | .name = "s390_hypfs", |
| 458 | − .get_sb = hypfs_get_super, | |
| 458 | + .mount = hypfs_mount, | |
| 459 | 459 | .kill_sb = hypfs_kill_super |
| 460 | 460 | }; |
| 461 | 461 | |
| @@ -29,33 +29,33 @@ · 28 unmodified lines | ||
| 29 | 29 | static struct vfsmount *dev_mnt; |
| 30 | 30 | |
| 31 | 31 | #if defined CONFIG_DEVTMPFS_MOUNT |
| 32 | −static int dev_mount = 1; | |
| 32 | +static int mount_dev = 1; | |
| 33 | 33 | #else |
| 34 | −static int dev_mount; | |
| 34 | +static int mount_dev; | |
| 35 | 35 | #endif |
| 36 | 36 | |
| 37 | 37 | static DEFINE_MUTEX(dirlock); |
| 38 | 38 | |
| 39 | 39 | static 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 | 42 | return 1; |
| 43 | 43 | } |
| 44 | 44 | __setup("devtmpfs.mount=", mount_param); |
| 45 | 45 | |
| 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) | |
| 48 | 48 | { |
| 49 | 49 | #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 | 51 | #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 | 53 | #endif |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static struct file_system_type dev_fs_type = { |
| 57 | 57 | .name = "devtmpfs", |
| 58 | − .get_sb = dev_get_sb, | |
| 58 | + .mount = dev_mount, | |
| 59 | 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 | 352 | int err; |
| 353 | 353 | |
| 354 | − if (!dev_mount) | |
| 354 | + if (!mount_dev) | |
| 355 | 355 | return 0; |
| 356 | 356 | |
| 357 | 357 | if (!dev_mnt) |
| @@ -362,13 +362,13 @@ bail: · 361 unmodified lines | ||
| 362 | 362 | return ret; |
| 363 | 363 | } |
| 364 | 364 | |
| 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) | |
| 367 | 367 | { |
| 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; | |
| 372 | 372 | return ret; |
| 373 | 373 | } |
| 374 | 374 | |
| @@ -411,7 +411,7 @@ bail: · 36 unmodified lines | ||
| 411 | 411 | static struct file_system_type ipathfs_fs_type = { |
| 412 | 412 | .owner = THIS_MODULE, |
| 413 | 413 | .name = "ipathfs", |
| 414 | − .get_sb = ipathfs_get_sb, | |
| 414 | + .mount = ipathfs_mount, | |
| 415 | 415 | .kill_sb = ipathfs_kill_super, |
| 416 | 416 | }; |
| 417 | 417 | |
| @@ -555,13 +555,13 @@ bail: · 554 unmodified lines | ||
| 555 | 555 | return ret; |
| 556 | 556 | } |
| 557 | 557 | |
| 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) | |
| 560 | 560 | { |
| 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; | |
| 565 | 565 | return ret; |
| 566 | 566 | } |
| 567 | 567 | |
| @@ -603,7 +603,7 @@ int qibfs_remove(struct qib_devdata *dd) · 35 unmodified lines | ||
| 603 | 603 | static struct file_system_type qibfs_fs_type = { |
| 604 | 604 | .owner = THIS_MODULE, |
| 605 | 605 | .name = "ipathfs", |
| 606 | − .get_sb = qibfs_get_sb, | |
| 606 | + .mount = qibfs_mount, | |
| 607 | 607 | .kill_sb = qibfs_kill_super, |
| 608 | 608 | }; |
| 609 | 609 | |
| @@ -125,16 +125,16 @@ fail: · 124 unmodified lines | ||
| 125 | 125 | return -ENOMEM; |
| 126 | 126 | } |
| 127 | 127 | |
| 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) | |
| 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 | |
| 134 | 134 | static struct file_system_type capifs_fs_type = { |
| 135 | 135 | .owner = THIS_MODULE, |
| 136 | 136 | .name = "capifs", |
| 137 | − .get_sb = capifs_get_sb, | |
| 137 | + .mount = capifs_mount, | |
| 138 | 138 | .kill_sb = kill_anon_super, |
| 139 | 139 | }; |
| 140 | 140 | |
| @@ -91,11 +91,10 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root); · 90 unmodified lines | ||
| 91 | 91 | static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent); |
| 92 | 92 | |
| 93 | 93 | |
| 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) | |
| 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 | |
| 101 | 100 | 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 | ||
| 108 | 107 | static struct file_system_type ibmasmfs_type = { |
| 109 | 108 | .owner = THIS_MODULE, |
| 110 | 109 | .name = "ibmasmfs", |
| 111 | − .get_sb = ibmasmfs_get_super, | |
| 110 | + .mount = ibmasmfs_mount, | |
| 112 | 111 | .kill_sb = kill_litter_super, |
| 113 | 112 | }; |
| 114 | 113 | |
| @@ -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 | |
| 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) | |
| 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 | |
| 269 | 269 | static struct file_system_type oprofilefs_type = { |
| 270 | 270 | .owner = THIS_MODULE, |
| 271 | 271 | .name = "oprofilefs", |
| 272 | − .get_sb = oprofilefs_get_sb, | |
| 272 | + .mount = oprofilefs_mount, | |
| 273 | 273 | .kill_sb = kill_litter_super, |
| 274 | 274 | }; |
| 275 | 275 | |
| @@ -574,16 +574,16 @@ static void fs_remove_file (struct dentry *dentry) · 573 unmodified lines | ||
| 574 | 574 | |
| 575 | 575 | /* --------------------------------------------------------------------- */ |
| 576 | 576 | |
| 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) | |
| 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 | |
| 583 | 583 | static struct file_system_type usb_fs_type = { |
| 584 | 584 | .owner = THIS_MODULE, |
| 585 | 585 | .name = "usbfs", |
| 586 | − .get_sb = usb_get_sb, | |
| 586 | + .mount = usb_mount, | |
| 587 | 587 | .kill_sb = kill_litter_super, |
| 588 | 588 | }; |
| 589 | 589 | |
| @@ -1176,9 +1176,9 @@ invalid: · 1175 unmodified lines | ||
| 1176 | 1176 | |
| 1177 | 1177 | /* "mount -t functionfs dev_name /dev/function" ends up here */ |
| 1178 | 1178 | |
| 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) | |
| 1182 | 1182 | { |
| 1183 | 1183 | struct ffs_sb_fill_data data = { |
| 1184 | 1184 | .perms = { |
| @@ -1194,14 +1194,14 @@ ffs_fs_get_sb(struct file_system_type *t, int flags, · 9 unmodified lines | ||
| 1194 | 1194 | |
| 1195 | 1195 | ret = functionfs_check_dev_callback(dev_name); |
| 1196 | 1196 | if (unlikely(ret < 0)) |
| 1197 | − return ret; | |
| 1197 | + return ERR_PTR(ret); | |
| 1198 | 1198 | |
| 1199 | 1199 | ret = ffs_fs_parse_opts(&data, opts); |
| 1200 | 1200 | if (unlikely(ret < 0)) |
| 1201 | − return ret; | |
| 1201 | + return ERR_PTR(ret); | |
| 1202 | 1202 | |
| 1203 | 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 | |
| 1207 | 1207 | static void |
| @@ -1220,7 +1220,7 @@ ffs_fs_kill_sb(struct super_block *sb) · 12 unmodified lines | ||
| 1220 | 1220 | static struct file_system_type ffs_fs_type = { |
| 1221 | 1221 | .owner = THIS_MODULE, |
| 1222 | 1222 | .name = "functionfs", |
| 1223 | − .get_sb = ffs_fs_get_sb, | |
| 1223 | + .mount = ffs_fs_mount, | |
| 1224 | 1224 | .kill_sb = ffs_fs_kill_sb, |
| 1225 | 1225 | }; |
| 1226 | 1226 | |
| @@ -2097,11 +2097,11 @@ enomem0: · 2096 unmodified lines | ||
| 2097 | 2097 | } |
| 2098 | 2098 | |
| 2099 | 2099 | /* "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) | |
| 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 | |
| 2107 | 2107 | static void |
| @@ -2119,7 +2119,7 @@ gadgetfs_kill_sb (struct super_block *sb) · 11 unmodified lines | ||
| 2119 | 2119 | static struct file_system_type gadgetfs_type = { |
| 2120 | 2120 | .owner = THIS_MODULE, |
| 2121 | 2121 | .name = shortname, |
| 2122 | − .get_sb = gadgetfs_get_sb, | |
| 2122 | + .mount = gadgetfs_mount, | |
| 2123 | 2123 | .kill_sb = gadgetfs_kill_sb, |
| 2124 | 2124 | }; |
| 2125 | 2125 | |
| @@ -121,17 +121,17 @@ static int xenfs_fill_super(struct super_block *sb, void *data, int silent) · 120 unmodified lines | ||
| 121 | 121 | return rc; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | −static int xenfs_get_sb(struct file_system_type *fs_type, | |
| 124 | +static int xenfs_mount(struct file_system_type *fs_type, | |
| 125 | 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 | |
| 131 | 131 | static struct file_system_type xenfs_type = { |
| 132 | 132 | .owner = THIS_MODULE, |
| 133 | 133 | .name = "xenfs", |
| 134 | − .get_sb = xenfs_get_sb, | |
| 134 | + .mount = xenfs_mount, | |
| 135 | 135 | .kill_sb = kill_litter_super, |
| 136 | 136 | }; |
| 137 | 137 | |
| @@ -706,10 +706,10 @@ static int bm_fill_super(struct super_block * sb, void * data, int silent) · 705 unmodified lines | ||
| 706 | 706 | return err; |
| 707 | 707 | } |
| 708 | 708 | |
| 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) | |
| 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 | |
| 715 | 715 | static struct linux_binfmt misc_format = { |
| @@ -720,7 +720,7 @@ static struct linux_binfmt misc_format = { · 4 unmodified lines | ||
| 720 | 720 | static struct file_system_type bm_fs_type = { |
| 721 | 721 | .owner = THIS_MODULE, |
| 722 | 722 | .name = "binfmt_misc", |
| 723 | − .get_sb = bm_get_sb, | |
| 723 | + .mount = bm_mount, | |
| 724 | 724 | .kill_sb = kill_litter_super, |
| 725 | 725 | }; |
| 726 | 726 | |
| @@ -104,16 +104,16 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent) · 103 unmodified lines | ||
| 104 | 104 | return 0; |
| 105 | 105 | } |
| 106 | 106 | |
| 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) | |
| 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 | |
| 113 | 113 | static struct file_system_type configfs_fs_type = { |
| 114 | 114 | .owner = THIS_MODULE, |
| 115 | 115 | .name = "configfs", |
| 116 | − .get_sb = configfs_get_sb, | |
| 116 | + .mount = configfs_do_mount, | |
| 117 | 117 | .kill_sb = kill_litter_super, |
| 118 | 118 | }; |
| 119 | 119 | |
| @@ -135,17 +135,17 @@ static int debug_fill_super(struct super_block *sb, void *data, int silent) · 134 unmodified lines | ||
| 135 | 135 | return simple_fill_super(sb, DEBUGFS_MAGIC, debug_files); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | −static int debug_get_sb(struct file_system_type *fs_type, | |
| 138 | +static struct dentry *debug_mount(struct file_system_type *fs_type, | |
| 139 | 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 | |
| 145 | 145 | static struct file_system_type debug_fs_type = { |
| 146 | 146 | .owner = THIS_MODULE, |
| 147 | 147 | .name = "debugfs", |
| 148 | − .get_sb = debug_get_sb, | |
| 148 | + .mount = debug_mount, | |
| 149 | 149 | .kill_sb = kill_litter_super, |
| 150 | 150 | }; |
| 151 | 151 | |
| @@ -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 | 336 | * If the '-o newinstance' mount option was specified, mount a new |
| 337 | 337 | * (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 | 345 | * semantics in devpts while preserving backward compatibility of the |
| 346 | 346 | * current 'single-namespace' semantics. i.e all mounts of devpts |
| 347 | 347 | * 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 | 350 | * Mounts with 'newinstance' option create a new, private namespace. |
| 351 | 351 | * |
| 352 | 352 | * NOTE: |
| 353 | 353 | * |
| 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 | |
| 356 | 356 | * 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 | |
| 358 | 358 | * super-block instead of the initial super-block. |
| 359 | 359 | */ |
| 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) | |
| 362 | 362 | { |
| 363 | 363 | int error; |
| 364 | 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 | 367 | error = parse_mount_options(data, PARSE_MOUNT, &opts); |
| 368 | 368 | if (error) |
| 369 | − return error; | |
| 369 | + return ERR_PTR(error); | |
| 370 | 370 | |
| 371 | 371 | if (opts.newinstance) |
| 372 | 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 | 374 | s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL); |
| 375 | 375 | |
| 376 | 376 | if (IS_ERR(s)) |
| 377 | − return PTR_ERR(s); | |
| 377 | + return ERR_CAST(s); | |
| 378 | 378 | |
| 379 | 379 | if (!s->s_root) { |
| 380 | 380 | s->s_flags = flags; |
| @@ -390,13 +390,11 @@ static int devpts_get_sb(struct file_system_type *fs_type, · 9 unmodified lines | ||
| 390 | 390 | if (error) |
| 391 | 391 | goto out_undo_sget; |
| 392 | 392 | |
| 393 | − simple_set_mnt(mnt, s); | |
| 394 | − | |
| 395 | − return 0; | |
| 393 | + return dget(s->s_root); | |
| 396 | 394 | |
| 397 | 395 | out_undo_sget: |
| 398 | 396 | deactivate_locked_super(s); |
| 399 | − return error; | |
| 397 | + return ERR_PTR(error); | |
| 400 | 398 | } |
| 401 | 399 | |
| 402 | 400 | #else |
| @@ -404,10 +402,10 @@ out_undo_sget: · 1 unmodified line | ||
| 404 | 402 | * This supports only the legacy single-instance semantics (no |
| 405 | 403 | * multiple-instance semantics) |
| 406 | 404 | */ |
| 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) | |
| 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 | 410 | #endif |
| 413 | 411 | |
| @@ -421,7 +419,7 @@ static void devpts_kill_sb(struct super_block *sb) · 7 unmodified lines | ||
| 421 | 419 | |
| 422 | 420 | static struct file_system_type devpts_fs_type = { |
| 423 | 421 | .name = "devpts", |
| 424 | − .get_sb = devpts_get_sb, | |
| 422 | + .mount = devpts_mount, | |
| 425 | 423 | .kill_sb = devpts_kill_sb, |
| 426 | 424 | }; |
| 427 | 425 | |
| @@ -322,12 +322,10 @@ static int fuse_ctl_fill_super(struct super_block *sb, void *data, int silent) · 321 unmodified lines | ||
| 322 | 322 | return 0; |
| 323 | 323 | } |
| 324 | 324 | |
| 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) | |
| 328 | 327 | { |
| 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); | |
| 331 | 329 | } |
| 332 | 330 | |
| 333 | 331 | 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 | ||
| 346 | 344 | static struct file_system_type fuse_ctl_fs_type = { |
| 347 | 345 | .owner = THIS_MODULE, |
| 348 | 346 | .name = "fusectl", |
| 349 | − .get_sb = fuse_ctl_get_sb, | |
| 347 | + .mount = fuse_ctl_mount, | |
| 350 | 348 | .kill_sb = fuse_ctl_kill_sb, |
| 351 | 349 | }; |
| 352 | 350 | |
| @@ -1405,16 +1405,16 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent) · 1404 unmodified lines | ||
| 1405 | 1405 | return simple_fill_super(sb, 0x6e667364, nfsd_files); |
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 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) | |
| 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 | |
| 1414 | 1414 | static struct file_system_type nfsd_fs_type = { |
| 1415 | 1415 | .owner = THIS_MODULE, |
| 1416 | 1416 | .name = "nfsd", |
| 1417 | − .get_sb = nfsd_get_sb, | |
| 1417 | + .mount = nfsd_mount, | |
| 1418 | 1418 | .kill_sb = kill_litter_super, |
| 1419 | 1419 | }; |
| 1420 | 1420 | |
| @@ -415,16 +415,16 @@ out_no_root: · 414 unmodified lines | ||
| 415 | 415 | return ret; |
| 416 | 416 | } |
| 417 | 417 | |
| 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) | |
| 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 | |
| 424 | 424 | static struct file_system_type openprom_fs_type = { |
| 425 | 425 | .owner = THIS_MODULE, |
| 426 | 426 | .name = "openpromfs", |
| 427 | − .get_sb = openprom_get_sb, | |
| 427 | + .mount = openprom_mount, | |
| 428 | 428 | .kill_sb = kill_anon_super, |
| 429 | 429 | }; |
| 430 | 430 | |
| @@ -900,29 +900,42 @@ static int compare_single(struct super_block *s, void *p) · 899 unmodified lines | ||
| 900 | 900 | return 1; |
| 901 | 901 | } |
| 902 | 902 | |
| 903 | −int get_sb_single(struct file_system_type *fs_type, | |
| 903 | +struct dentry *mount_single(struct file_system_type *fs_type, | |
| 904 | 904 | 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)) | |
| 907 | 906 | { |
| 908 | 907 | struct super_block *s; |
| 909 | 908 | int error; |
| 910 | 909 | |
| 911 | 910 | s = sget(fs_type, compare_single, set_anon_super, NULL); |
| 912 | 911 | if (IS_ERR(s)) |
| 913 | − return PTR_ERR(s); | |
| 912 | + return ERR_CAST(s); | |
| 914 | 913 | if (!s->s_root) { |
| 915 | 914 | s->s_flags = flags; |
| 916 | 915 | error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); |
| 917 | 916 | if (error) { |
| 918 | 917 | deactivate_locked_super(s); |
| 919 | − return error; | |
| 918 | + return ERR_PTR(error); | |
| 920 | 919 | } |
| 921 | 920 | s->s_flags |= MS_ACTIVE; |
| 922 | 921 | } else { |
| 923 | 922 | do_remount_sb(s, flags, data, 0); |
| 924 | 923 | } |
| 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; | |
| 926 | 939 | return 0; |
| 927 | 940 | } |
| 928 | 941 | |
| @@ -1799,6 +1799,9 @@ extern int get_sb_bdev(struct file_system_type *fs_type, · 1798 unmodified lines | ||
| 1799 | 1799 | int flags, const char *dev_name, void *data, |
| 1800 | 1800 | int (*fill_super)(struct super_block *, void *, int), |
| 1801 | 1801 | 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)); | |
| 1802 | 1805 | extern int get_sb_single(struct file_system_type *fs_type, |
| 1803 | 1806 | int flags, void *data, |
| 1804 | 1807 | int (*fill_super)(struct super_block *, void *, int), |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/sunrpc/rpc_pipe_fs.h> |
| 29 | 29 | #include <linux/sunrpc/cache.h> |
| 30 | 30 | |
| 31 | −static struct vfsmount *rpc_mount __read_mostly; | |
| 31 | +static struct vfsmount *rpc_mnt __read_mostly; | |
| 32 | 32 | static int rpc_mount_count; |
| 33 | 33 | |
| 34 | 34 | static struct file_system_type rpc_pipe_fs_type; |
| @@ -417,16 +417,16 @@ struct vfsmount *rpc_get_mount(void) · 382 unmodified lines | ||
| 417 | 417 | { |
| 418 | 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 | 421 | if (err != 0) |
| 422 | 422 | return ERR_PTR(err); |
| 423 | − return rpc_mount; | |
| 423 | + return rpc_mnt; | |
| 424 | 424 | } |
| 425 | 425 | EXPORT_SYMBOL_GPL(rpc_get_mount); |
| 426 | 426 | |
| 427 | 427 | void 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 | } |
| 431 | 431 | EXPORT_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 | 1018 | return 0; |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 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) | |
| 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 | |
| 1028 | 1028 | static struct file_system_type rpc_pipe_fs_type = { |
| 1029 | 1029 | .owner = THIS_MODULE, |
| 1030 | 1030 | .name = "rpc_pipefs", |
| 1031 | − .get_sb = rpc_get_sb, | |
| 1031 | + .mount = rpc_mount, | |
| 1032 | 1032 | .kill_sb = kill_litter_super, |
| 1033 | 1033 | }; |
| 1034 | 1034 | |
| @@ -131,17 +131,17 @@ static int fill_super(struct super_block *sb, void *data, int silent) · 130 unmodified lines | ||
| 131 | 131 | return simple_fill_super(sb, SECURITYFS_MAGIC, files); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | −static int get_sb(struct file_system_type *fs_type, | |
| 134 | +static struct dentry *get_sb(struct file_system_type *fs_type, | |
| 135 | 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 | |
| 141 | 141 | static struct file_system_type fs_type = { |
| 142 | 142 | .owner = THIS_MODULE, |
| 143 | 143 | .name = "securityfs", |
| 144 | − .get_sb = get_sb, | |
| 144 | + .mount = get_sb, | |
| 145 | 145 | .kill_sb = kill_litter_super, |
| 146 | 146 | }; |
| 147 | 147 | |
| @@ -1909,16 +1909,15 @@ err: · 1908 unmodified lines | ||
| 1909 | 1909 | goto out; |
| 1910 | 1910 | } |
| 1911 | 1911 | |
| 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) | |
| 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 | |
| 1919 | 1918 | static struct file_system_type sel_fs_type = { |
| 1920 | 1919 | .name = "selinuxfs", |
| 1921 | − .get_sb = sel_get_sb, | |
| 1920 | + .mount = sel_mount, | |
| 1922 | 1921 | .kill_sb = kill_litter_super, |
| 1923 | 1922 | }; |
| 1924 | 1923 | |
| @@ -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 superblock | |
| 1313 | + * smk_mount - get the smackfs superblock | |
| 1314 | 1314 | * @fs_type: passed along without comment |
| 1315 | 1315 | * @flags: passed along without comment |
| 1316 | 1316 | * @dev_name: passed along without comment |
| 1317 | 1317 | * @data: passed along without comment |
| 1318 | − * @mnt: passed along without comment | |
| 1319 | 1318 | * |
| 1320 | 1319 | * Just passes everything along. |
| 1321 | 1320 | * |
| 1322 | 1321 | * Returns what the lower level code does. |
| 1323 | 1322 | */ |
| 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) | |
| 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 | |
| 1331 | 1329 | static struct file_system_type smk_fs_type = { |
| 1332 | 1330 | .name = "smackfs", |
| 1333 | − .get_sb = smk_get_sb, | |
| 1331 | + .mount = smk_mount, | |
| 1334 | 1332 | .kill_sb = kill_litter_super, |
| 1335 | 1333 | }; |
| 1336 | 1334 | |