]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
convert get_sb_pseudo() users
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 25 Jul 2010 19:47:46 +0000 (23:47 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 Oct 2010 08:16:33 +0000 (04:16 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/ia64/kernel/perfmon.c
drivers/mtd/mtdchar.c
fs/anon_inodes.c
fs/block_dev.c
fs/libfs.c
fs/pipe.c
include/linux/fs.h
net/socket.c

index 6b1852f7f972b80fcccc06ba0214acc321cd84e5..39e534f5a3b05fc36c46d1e58b0c581c6c307bc5 100644 (file)
@@ -618,16 +618,15 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 }
 
 
-static int
-pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data,
-            struct vfsmount *mnt)
+static struct dentry *
+pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC, mnt);
+       return mount_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC);
 }
 
 static struct file_system_type pfm_fs_type = {
        .name     = "pfmfs",
-       .get_sb   = pfmfs_get_sb,
+       .mount    = pfmfs_mount,
        .kill_sb  = kill_anon_super,
 };
 
index 5ef45487b65f01c261222b35d5fd6ecc548bea7e..a34a0fe148841dc83007517e9adec2cca57bd25b 100644 (file)
@@ -1030,17 +1030,15 @@ static const struct file_operations mtd_fops = {
 #endif
 };
 
-static int mtd_inodefs_get_sb(struct file_system_type *fs_type, int flags,
-                               const char *dev_name, void *data,
-                               struct vfsmount *mnt)
+static struct dentry *mtd_inodefs_mount(struct file_system_type *fs_type,
+                               int flags, const char *dev_name, void *data)
 {
-        return get_sb_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC,
-                             mnt);
+        return mount_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC);
 }
 
 static struct file_system_type mtd_inodefs_type = {
        .name = "mtd_inodefs",
-       .get_sb = mtd_inodefs_get_sb,
+       .mount = mtd_inodefs_mount,
        .kill_sb = kill_anon_super,
 };
 
index 5365527ca43fec37cdc021afbc21acf76c321889..57ce55b2564cf38159638fa146c2b653c5fc66a6 100644 (file)
@@ -26,12 +26,10 @@ static struct vfsmount *anon_inode_mnt __read_mostly;
 static struct inode *anon_inode_inode;
 static const struct file_operations anon_inode_fops;
 
-static int anon_inodefs_get_sb(struct file_system_type *fs_type, int flags,
-                              const char *dev_name, void *data,
-                              struct vfsmount *mnt)
+static struct dentry *anon_inodefs_mount(struct file_system_type *fs_type,
+                               int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "anon_inode:", NULL, ANON_INODE_FS_MAGIC,
-                            mnt);
+       return mount_pseudo(fs_type, "anon_inode:", NULL, ANON_INODE_FS_MAGIC);
 }
 
 /*
@@ -45,7 +43,7 @@ static char *anon_inodefs_dname(struct dentry *dentry, char *buffer, int buflen)
 
 static struct file_system_type anon_inode_fs_type = {
        .name           = "anon_inodefs",
-       .get_sb         = anon_inodefs_get_sb,
+       .mount          = anon_inodefs_mount,
        .kill_sb        = kill_anon_super,
 };
 static const struct dentry_operations anon_inodefs_dentry_operations = {
index dea3b628a6ce9a9058c24d2b13c364b7c6adb3c3..06e8ff12b97c8fa74d4b2eb05c900801b3adb150 100644 (file)
@@ -464,15 +464,15 @@ static const struct super_operations bdev_sops = {
        .evict_inode = bdev_evict_inode,
 };
 
-static int bd_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *bd_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576, mnt);
+       return mount_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576);
 }
 
 static struct file_system_type bd_type = {
        .name           = "bdev",
-       .get_sb         = bd_get_sb,
+       .mount          = bd_mount,
        .kill_sb        = kill_anon_super,
 };
 
index 304a5132ca270d018799d3003170bd813c23dd9b..a3accdf528add9161bd6dccfb84f7c08ccb28437 100644 (file)
@@ -201,9 +201,8 @@ static const struct super_operations simple_super_operations = {
  * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
  * will never be mountable)
  */
-int get_sb_pseudo(struct file_system_type *fs_type, char *name,
-       const struct super_operations *ops, unsigned long magic,
-       struct vfsmount *mnt)
+struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
+       const struct super_operations *ops, unsigned long magic)
 {
        struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
        struct dentry *dentry;
@@ -211,7 +210,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        struct qstr d_name = {.name = name, .len = strlen(name)};
 
        if (IS_ERR(s))
-               return PTR_ERR(s);
+               return ERR_CAST(s);
 
        s->s_flags = MS_NOUSER;
        s->s_maxbytes = MAX_LFS_FILESIZE;
@@ -241,12 +240,11 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        d_instantiate(dentry, root);
        s->s_root = dentry;
        s->s_flags |= MS_ACTIVE;
-       simple_set_mnt(mnt, s);
-       return 0;
+       return dget(s->s_root);
 
 Enomem:
        deactivate_locked_super(s);
-       return -ENOMEM;
+       return ERR_PTR(-ENOMEM);
 }
 
 int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
@@ -951,7 +949,7 @@ EXPORT_SYMBOL(dcache_dir_lseek);
 EXPORT_SYMBOL(dcache_dir_open);
 EXPORT_SYMBOL(dcache_readdir);
 EXPORT_SYMBOL(generic_read_dir);
-EXPORT_SYMBOL(get_sb_pseudo);
+EXPORT_SYMBOL(mount_pseudo);
 EXPORT_SYMBOL(simple_write_begin);
 EXPORT_SYMBOL(simple_write_end);
 EXPORT_SYMBOL(simple_dir_inode_operations);
index d2d7566ce68e5cb4fc9713e531670d8f05d52d02..a8012a955720418eb059b237ac68bd98760891bb 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1247,16 +1247,15 @@ out:
  * any operations on the root directory. However, we need a non-trivial
  * d_name - pipe: will go nicely and kill the special-casing in procfs.
  */
-static int pipefs_get_sb(struct file_system_type *fs_type,
-                        int flags, const char *dev_name, void *data,
-                        struct vfsmount *mnt)
+static struct dentry *pipefs_mount(struct file_system_type *fs_type,
+                        int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC, mnt);
+       return mount_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC);
 }
 
 static struct file_system_type pipe_fs_type = {
        .name           = "pipefs",
-       .get_sb         = pipefs_get_sb,
+       .mount          = pipefs_mount,
        .kill_sb        = kill_anon_super,
 };
 
index 4c3a29ddcacb742279fbbcbebf53b5f35b3fbc50..43e6cfb5cbb3ddfa6fc5f13a4b47564f0f566e37 100644 (file)
@@ -1824,9 +1824,8 @@ struct super_block *sget(struct file_system_type *type,
                        int (*test)(struct super_block *,void *),
                        int (*set)(struct super_block *,void *),
                        void *data);
-extern int get_sb_pseudo(struct file_system_type *, char *,
-       const struct super_operations *ops, unsigned long,
-       struct vfsmount *mnt);
+extern struct dentry *mount_pseudo(struct file_system_type *, char *,
+       const struct super_operations *ops, unsigned long);
 extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
 
 static inline void sb_mark_dirty(struct super_block *sb)
index ee3cd280c76e9cfb58024fa22f3017352f0467bc..5247ae10f374e9a9fe2331d8e1ad0c83f0da6f32 100644 (file)
@@ -305,19 +305,17 @@ static const struct super_operations sockfs_ops = {
        .statfs         = simple_statfs,
 };
 
-static int sockfs_get_sb(struct file_system_type *fs_type,
-                        int flags, const char *dev_name, void *data,
-                        struct vfsmount *mnt)
+static struct dentry *sockfs_mount(struct file_system_type *fs_type,
+                        int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "socket:", &sockfs_ops, SOCKFS_MAGIC,
-                            mnt);
+       return mount_pseudo(fs_type, "socket:", &sockfs_ops, SOCKFS_MAGIC);
 }
 
 static struct vfsmount *sock_mnt __read_mostly;
 
 static struct file_system_type sock_fs_type = {
        .name =         "sockfs",
-       .get_sb =       sockfs_get_sb,
+       .mount =        sockfs_mount,
        .kill_sb =      kill_anon_super,
 };