aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-25 03:46:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-29 04:16:31 -0400
commit3c26ff6e499ee7e6f9f2bc7da5f2f30d80862ecf (patch)
treebd758d7f15f24aed225a64de77cc535785c50f96 /fs
parentfc14f2fef682df677d64a145256dbd263df2aa7b (diff)
convert get_sb_nodev() users
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/autofs4/init.c8
-rw-r--r--fs/coda/inode.c8
-rw-r--r--fs/exofs/super.c10
-rw-r--r--fs/fuse/inode.c8
-rw-r--r--fs/hostfs/hostfs_kern.c8
-rw-r--r--fs/hppfs/hppfs.c8
-rw-r--r--fs/hugetlbfs/inode.c8
-rw-r--r--fs/ncpfs/inode.c8
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c8
-rw-r--r--fs/ramfs/inode.c17
-rw-r--r--fs/super.c27
11 files changed, 65 insertions, 53 deletions
diff --git a/fs/autofs4/init.c b/fs/autofs4/init.c
index 9722e4bd8957..c038727b4050 100644
--- a/fs/autofs4/init.c
+++ b/fs/autofs4/init.c
@@ -14,16 +14,16 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include "autofs_i.h" 15#include "autofs_i.h"
16 16
17static int autofs_get_sb(struct file_system_type *fs_type, 17static struct dentry *autofs_mount(struct file_system_type *fs_type,
18 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 18 int flags, const char *dev_name, void *data)
19{ 19{
20 return get_sb_nodev(fs_type, flags, data, autofs4_fill_super, mnt); 20 return mount_nodev(fs_type, flags, data, autofs4_fill_super);
21} 21}
22 22
23static struct file_system_type autofs_fs_type = { 23static struct file_system_type autofs_fs_type = {
24 .owner = THIS_MODULE, 24 .owner = THIS_MODULE,
25 .name = "autofs", 25 .name = "autofs",
26 .get_sb = autofs_get_sb, 26 .mount = autofs_mount,
27 .kill_sb = autofs4_kill_sb, 27 .kill_sb = autofs4_kill_sb,
28}; 28};
29 29
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 7993b96ca348..5ea57c8c7f97 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -306,16 +306,16 @@ static int coda_statfs(struct dentry *dentry, struct kstatfs *buf)
306 306
307/* init_coda: used by filesystems.c to register coda */ 307/* init_coda: used by filesystems.c to register coda */
308 308
309static int coda_get_sb(struct file_system_type *fs_type, 309static struct dentry *coda_mount(struct file_system_type *fs_type,
310 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 310 int flags, const char *dev_name, void *data)
311{ 311{
312 return get_sb_nodev(fs_type, flags, data, coda_fill_super, mnt); 312 return mount_nodev(fs_type, flags, data, coda_fill_super);
313} 313}
314 314
315struct file_system_type coda_fs_type = { 315struct file_system_type coda_fs_type = {
316 .owner = THIS_MODULE, 316 .owner = THIS_MODULE,
317 .name = "coda", 317 .name = "coda",
318 .get_sb = coda_get_sb, 318 .mount = coda_mount,
319 .kill_sb = kill_anon_super, 319 .kill_sb = kill_anon_super,
320 .fs_flags = FS_BINARY_MOUNTDATA, 320 .fs_flags = FS_BINARY_MOUNTDATA,
321}; 321};
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 047e92fa3af8..79c3ae6e0456 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -659,19 +659,19 @@ free_bdi:
659/* 659/*
660 * Set up the superblock (calls exofs_fill_super eventually) 660 * Set up the superblock (calls exofs_fill_super eventually)
661 */ 661 */
662static int exofs_get_sb(struct file_system_type *type, 662static struct dentry *exofs_mount(struct file_system_type *type,
663 int flags, const char *dev_name, 663 int flags, const char *dev_name,
664 void *data, struct vfsmount *mnt) 664 void *data)
665{ 665{
666 struct exofs_mountopt opts; 666 struct exofs_mountopt opts;
667 int ret; 667 int ret;
668 668
669 ret = parse_options(data, &opts); 669 ret = parse_options(data, &opts);
670 if (ret) 670 if (ret)
671 return ret; 671 return ERR_PTR(ret);
672 672
673 opts.dev_name = dev_name; 673 opts.dev_name = dev_name;
674 return get_sb_nodev(type, flags, &opts, exofs_fill_super, mnt); 674 return mount_nodev(type, flags, &opts, exofs_fill_super);
675} 675}
676 676
677/* 677/*
@@ -809,7 +809,7 @@ static const struct export_operations exofs_export_ops = {
809static struct file_system_type exofs_type = { 809static struct file_system_type exofs_type = {
810 .owner = THIS_MODULE, 810 .owner = THIS_MODULE,
811 .name = "exofs", 811 .name = "exofs",
812 .get_sb = exofs_get_sb, 812 .mount = exofs_mount,
813 .kill_sb = generic_shutdown_super, 813 .kill_sb = generic_shutdown_super,
814}; 814};
815 815
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index edf6a1843533..cfce3ad86a92 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1041,11 +1041,11 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
1041 return err; 1041 return err;
1042} 1042}
1043 1043
1044static int fuse_get_sb(struct file_system_type *fs_type, 1044static struct dentry *fuse_mount(struct file_system_type *fs_type,
1045 int flags, const char *dev_name, 1045 int flags, const char *dev_name,
1046 void *raw_data, struct vfsmount *mnt) 1046 void *raw_data)
1047{ 1047{
1048 return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt); 1048 return mount_nodev(fs_type, flags, raw_data, fuse_fill_super);
1049} 1049}
1050 1050
1051static void fuse_kill_sb_anon(struct super_block *sb) 1051static void fuse_kill_sb_anon(struct super_block *sb)
@@ -1065,7 +1065,7 @@ static struct file_system_type fuse_fs_type = {
1065 .owner = THIS_MODULE, 1065 .owner = THIS_MODULE,
1066 .name = "fuse", 1066 .name = "fuse",
1067 .fs_flags = FS_HAS_SUBTYPE, 1067 .fs_flags = FS_HAS_SUBTYPE,
1068 .get_sb = fuse_get_sb, 1068 .mount = fuse_mount,
1069 .kill_sb = fuse_kill_sb_anon, 1069 .kill_sb = fuse_kill_sb_anon,
1070}; 1070};
1071 1071
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index cd7c93917cc7..2c0f148a49e6 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -962,11 +962,11 @@ out:
962 return err; 962 return err;
963} 963}
964 964
965static int hostfs_read_sb(struct file_system_type *type, 965static struct dentry *hostfs_read_sb(struct file_system_type *type,
966 int flags, const char *dev_name, 966 int flags, const char *dev_name,
967 void *data, struct vfsmount *mnt) 967 void *data)
968{ 968{
969 return get_sb_nodev(type, flags, data, hostfs_fill_sb_common, mnt); 969 return mount_nodev(type, flags, data, hostfs_fill_sb_common);
970} 970}
971 971
972static void hostfs_kill_sb(struct super_block *s) 972static void hostfs_kill_sb(struct super_block *s)
@@ -978,7 +978,7 @@ static void hostfs_kill_sb(struct super_block *s)
978static struct file_system_type hostfs_type = { 978static struct file_system_type hostfs_type = {
979 .owner = THIS_MODULE, 979 .owner = THIS_MODULE,
980 .name = "hostfs", 980 .name = "hostfs",
981 .get_sb = hostfs_read_sb, 981 .mount = hostfs_read_sb,
982 .kill_sb = hostfs_kill_sb, 982 .kill_sb = hostfs_kill_sb,
983 .fs_flags = 0, 983 .fs_flags = 0,
984}; 984};
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 4e2a45ea6140..f702b5f713fc 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -748,17 +748,17 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
748 return(err); 748 return(err);
749} 749}
750 750
751static int hppfs_read_super(struct file_system_type *type, 751static struct dentry *hppfs_read_super(struct file_system_type *type,
752 int flags, const char *dev_name, 752 int flags, const char *dev_name,
753 void *data, struct vfsmount *mnt) 753 void *data)
754{ 754{
755 return get_sb_nodev(type, flags, data, hppfs_fill_super, mnt); 755 return mount_nodev(type, flags, data, hppfs_fill_super);
756} 756}
757 757
758static struct file_system_type hppfs_type = { 758static struct file_system_type hppfs_type = {
759 .owner = THIS_MODULE, 759 .owner = THIS_MODULE,
760 .name = "hppfs", 760 .name = "hppfs",
761 .get_sb = hppfs_read_super, 761 .mount = hppfs_read_super,
762 .kill_sb = kill_anon_super, 762 .kill_sb = kill_anon_super,
763 .fs_flags = 0, 763 .fs_flags = 0,
764}; 764};
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index b14be3f781c7..d6cfac1f0a40 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -896,15 +896,15 @@ void hugetlb_put_quota(struct address_space *mapping, long delta)
896 } 896 }
897} 897}
898 898
899static int hugetlbfs_get_sb(struct file_system_type *fs_type, 899static struct dentry *hugetlbfs_mount(struct file_system_type *fs_type,
900 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 900 int flags, const char *dev_name, void *data)
901{ 901{
902 return get_sb_nodev(fs_type, flags, data, hugetlbfs_fill_super, mnt); 902 return mount_nodev(fs_type, flags, data, hugetlbfs_fill_super);
903} 903}
904 904
905static struct file_system_type hugetlbfs_fs_type = { 905static struct file_system_type hugetlbfs_fs_type = {
906 .name = "hugetlbfs", 906 .name = "hugetlbfs",
907 .get_sb = hugetlbfs_get_sb, 907 .mount = hugetlbfs_mount,
908 .kill_sb = kill_litter_super, 908 .kill_sb = kill_litter_super,
909}; 909};
910 910
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 985fabb26aca..d290545aa0c4 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -1020,16 +1020,16 @@ out:
1020 return result; 1020 return result;
1021} 1021}
1022 1022
1023static int ncp_get_sb(struct file_system_type *fs_type, 1023static struct dentry *ncp_mount(struct file_system_type *fs_type,
1024 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 1024 int flags, const char *dev_name, void *data)
1025{ 1025{
1026 return get_sb_nodev(fs_type, flags, data, ncp_fill_super, mnt); 1026 return mount_nodev(fs_type, flags, data, ncp_fill_super);
1027} 1027}
1028 1028
1029static struct file_system_type ncp_fs_type = { 1029static struct file_system_type ncp_fs_type = {
1030 .owner = THIS_MODULE, 1030 .owner = THIS_MODULE,
1031 .name = "ncpfs", 1031 .name = "ncpfs",
1032 .get_sb = ncp_get_sb, 1032 .mount = ncp_mount,
1033 .kill_sb = kill_anon_super, 1033 .kill_sb = kill_anon_super,
1034 .fs_flags = FS_BINARY_MOUNTDATA, 1034 .fs_flags = FS_BINARY_MOUNTDATA,
1035}; 1035};
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 75e115f1bd73..b2df490a19ed 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -643,16 +643,16 @@ static const struct inode_operations dlmfs_file_inode_operations = {
643 .setattr = dlmfs_file_setattr, 643 .setattr = dlmfs_file_setattr,
644}; 644};
645 645
646static int dlmfs_get_sb(struct file_system_type *fs_type, 646static struct dentry *dlmfs_mount(struct file_system_type *fs_type,
647 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 647 int flags, const char *dev_name, void *data)
648{ 648{
649 return get_sb_nodev(fs_type, flags, data, dlmfs_fill_super, mnt); 649 return mount_nodev(fs_type, flags, data, dlmfs_fill_super);
650} 650}
651 651
652static struct file_system_type dlmfs_fs_type = { 652static struct file_system_type dlmfs_fs_type = {
653 .owner = THIS_MODULE, 653 .owner = THIS_MODULE,
654 .name = "ocfs2_dlmfs", 654 .name = "ocfs2_dlmfs",
655 .get_sb = dlmfs_get_sb, 655 .mount = dlmfs_mount,
656 .kill_sb = kill_litter_super, 656 .kill_sb = kill_litter_super,
657}; 657};
658 658
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 67fadb1ad2c1..eacb166fb259 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -255,17 +255,16 @@ fail:
255 return err; 255 return err;
256} 256}
257 257
258int ramfs_get_sb(struct file_system_type *fs_type, 258struct dentry *ramfs_mount(struct file_system_type *fs_type,
259 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 259 int flags, const char *dev_name, void *data)
260{ 260{
261 return get_sb_nodev(fs_type, flags, data, ramfs_fill_super, mnt); 261 return mount_nodev(fs_type, flags, data, ramfs_fill_super);
262} 262}
263 263
264static int rootfs_get_sb(struct file_system_type *fs_type, 264static struct dentry *rootfs_mount(struct file_system_type *fs_type,
265 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 265 int flags, const char *dev_name, void *data)
266{ 266{
267 return get_sb_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super, 267 return mount_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super);
268 mnt);
269} 268}
270 269
271static void ramfs_kill_sb(struct super_block *sb) 270static void ramfs_kill_sb(struct super_block *sb)
@@ -276,12 +275,12 @@ static void ramfs_kill_sb(struct super_block *sb)
276 275
277static struct file_system_type ramfs_fs_type = { 276static struct file_system_type ramfs_fs_type = {
278 .name = "ramfs", 277 .name = "ramfs",
279 .get_sb = ramfs_get_sb, 278 .mount = ramfs_mount,
280 .kill_sb = ramfs_kill_sb, 279 .kill_sb = ramfs_kill_sb,
281}; 280};
282static struct file_system_type rootfs_fs_type = { 281static struct file_system_type rootfs_fs_type = {
283 .name = "rootfs", 282 .name = "rootfs",
284 .get_sb = rootfs_get_sb, 283 .mount = rootfs_mount,
285 .kill_sb = kill_litter_super, 284 .kill_sb = kill_litter_super,
286}; 285};
287 286
diff --git a/fs/super.c b/fs/super.c
index 6f021a171ac6..f6a7bf1fff2b 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -870,29 +870,42 @@ void kill_block_super(struct super_block *sb)
870EXPORT_SYMBOL(kill_block_super); 870EXPORT_SYMBOL(kill_block_super);
871#endif 871#endif
872 872
873int get_sb_nodev(struct file_system_type *fs_type, 873struct dentry *mount_nodev(struct file_system_type *fs_type,
874 int flags, void *data, 874 int flags, void *data,
875 int (*fill_super)(struct super_block *, void *, int), 875 int (*fill_super)(struct super_block *, void *, int))
876 struct vfsmount *mnt)
877{ 876{
878 int error; 877 int error;
879 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); 878 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
880 879
881 if (IS_ERR(s)) 880 if (IS_ERR(s))
882 return PTR_ERR(s); 881 return ERR_CAST(s);
883 882
884 s->s_flags = flags; 883 s->s_flags = flags;
885 884
886 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); 885 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
887 if (error) { 886 if (error) {
888 deactivate_locked_super(s); 887 deactivate_locked_super(s);
889 return error; 888 return ERR_PTR(error);
890 } 889 }
891 s->s_flags |= MS_ACTIVE; 890 s->s_flags |= MS_ACTIVE;
892 simple_set_mnt(mnt, s); 891 return dget(s->s_root);
893 return 0;
894} 892}
893EXPORT_SYMBOL(mount_nodev);
894
895int get_sb_nodev(struct file_system_type *fs_type,
896 int flags, void *data,
897 int (*fill_super)(struct super_block *, void *, int),
898 struct vfsmount *mnt)
899{
900 struct dentry *root;
895 901
902 root = mount_nodev(fs_type, flags, data, fill_super);
903 if (IS_ERR(root))
904 return PTR_ERR(root);
905 mnt->mnt_root = root;
906 mnt->mnt_sb = root->d_sb;
907 return 0;
908}
896EXPORT_SYMBOL(get_sb_nodev); 909EXPORT_SYMBOL(get_sb_nodev);
897 910
898static int compare_single(struct super_block *s, void *p) 911static int compare_single(struct super_block *s, void *p)