]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
VFS: Unexport do_kern_mount() and clean up simple_pin_fs()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 9 Jun 2006 13:34:16 +0000 (09:34 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 9 Jun 2006 13:34:16 +0000 (09:34 -0400)
Replace all module uses with the new vfs_kern_mount() interface, and fix up
simple_pin_fs().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 files changed:
Documentation/filesystems/automount-support.txt
drivers/usb/core/inode.c
fs/afs/mntpt.c
fs/afs/super.c
fs/afs/super.h
fs/binfmt_misc.c
fs/configfs/mount.c
fs/debugfs/inode.c
fs/libfs.c
fs/super.c
include/linux/fs.h
mm/shmem.c
net/sunrpc/rpc_pipe.c
security/inode.c

index 58c65a1713e52944664956dff7d0a5e617dfc194..7cac200e2a85dd1efebc9f05e84cb8a2b9532b37 100644 (file)
@@ -19,7 +19,7 @@ following procedure:
 
  (2) Have the follow_link() op do the following steps:
 
-     (a) Call do_kern_mount() to call the appropriate filesystem to set up a
+     (a) Call vfs_kern_mount() to call the appropriate filesystem to set up a
          superblock and gain a vfsmount structure representing it.
 
      (b) Copy the nameidata provided as an argument and substitute the dentry
index 3cf945cc5b9ae1298fcc5fb7ad472a452f758c5f..695b90a17a68c072b05986a668a5eadfb24d741c 100644 (file)
@@ -569,7 +569,7 @@ static int create_special_files (void)
        ignore_mount = 1;
 
        /* create the devices special file */
-       retval = simple_pin_fs("usbfs", &usbfs_mount, &usbfs_mount_count);
+       retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count);
        if (retval) {
                err ("Unable to get usbfs mount");
                goto exit;
index 4e6eeb59b83cc02a2ccb1b24ad3ba515770f8d57..7b6dc03caf44877962a71032bdada1b664f46086 100644 (file)
@@ -210,7 +210,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
 
        /* try and do the mount */
        kdebug("--- attempting mount %s -o %s ---", devname, options);
-       mnt = do_kern_mount("afs", 0, devname, options);
+       mnt = vfs_kern_mount(&afs_fs_type, 0, devname, options);
        kdebug("--- mount result %p ---", mnt);
 
        free_page((unsigned long) devname);
index 53c56e7231abf4e1bf8e88b0884dcd303f333b8a..93a7821db0d77aafd7b31135aecaf49128f68178 100644 (file)
@@ -48,7 +48,7 @@ static void afs_put_super(struct super_block *sb);
 
 static void afs_destroy_inode(struct inode *inode);
 
-static struct file_system_type afs_fs_type = {
+struct file_system_type afs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "afs",
        .get_sb         = afs_get_sb,
index ac11362f4e95665113c42d21ee4283d1fe723e20..32de8cc6fae86d05b0f628fd1e55fbef5ff7dcd9 100644 (file)
@@ -38,6 +38,8 @@ static inline struct afs_super_info *AFS_FS_S(struct super_block *sb)
        return sb->s_fs_info;
 }
 
+extern struct file_system_type afs_fs_type;
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_AFS_SUPER_H */
index d73d75591a3966125003fdc8e6edebca1d7cc5e3..c0a909e1d290d4300ee96121c25f89cc9e12a981 100644 (file)
@@ -55,6 +55,7 @@ typedef struct {
 } Node;
 
 static DEFINE_RWLOCK(entries_lock);
+static struct file_system_type bm_fs_type;
 static struct vfsmount *bm_mnt;
 static int entry_count;
 
@@ -638,7 +639,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
        if (!inode)
                goto out2;
 
-       err = simple_pin_fs("binfmt_misc", &bm_mnt, &entry_count);
+       err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count);
        if (err) {
                iput(inode);
                inode = NULL;
index f920d30478e531a7a656548d9d9c7169a0cc99bf..be5d86ae56f00d5238300d1e5e942ff5247ff96e 100644 (file)
@@ -118,7 +118,7 @@ static struct file_system_type configfs_fs_type = {
 
 int configfs_pin_fs(void)
 {
-       return simple_pin_fs("configfs", &configfs_mount,
+       return simple_pin_fs(&configfs_fs_type, &configfs_mount,
                             &configfs_mnt_count);
 }
 
index b55b4ea9a67675a92377ffeb4a12ab9542ed8ca6..90f9417181fde2bdac1e6bfa815b096b0bef72ad 100644 (file)
@@ -199,7 +199,7 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode,
 
        pr_debug("debugfs: creating file '%s'\n",name);
 
-       error = simple_pin_fs("debugfs", &debugfs_mount, &debugfs_mount_count);
+       error = simple_pin_fs(&debug_fs_type, &debugfs_mount, &debugfs_mount_count);
        if (error)
                goto exit;
 
index 7145ba7a48d06329de45384b3d3bda2c607cc1a1..4a3ec9ad8bed354b2d4db49bb4adf9ba454dc466 100644 (file)
@@ -424,13 +424,13 @@ out:
 
 static DEFINE_SPINLOCK(pin_fs_lock);
 
-int simple_pin_fs(char *name, struct vfsmount **mount, int *count)
+int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *count)
 {
        struct vfsmount *mnt = NULL;
        spin_lock(&pin_fs_lock);
        if (unlikely(!*mount)) {
                spin_unlock(&pin_fs_lock);
-               mnt = do_kern_mount(name, 0, name, NULL);
+               mnt = vfs_kern_mount(type, 0, type->name, NULL);
                if (IS_ERR(mnt))
                        return PTR_ERR(mnt);
                spin_lock(&pin_fs_lock);
index 848be4fc67a2a608613ff90e0f76dfee7078731b..15f2afdbf82e8648da10e238de66435a8ee34da3 100644 (file)
@@ -864,11 +864,9 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
        return mnt;
 }
 
-EXPORT_SYMBOL_GPL(do_kern_mount);
-
 struct vfsmount *kern_mount(struct file_system_type *type)
 {
-       return do_kern_mount(type->name, 0, type->name, NULL);
+       return vfs_kern_mount(type, 0, type->name, NULL);
 }
 
 EXPORT_SYMBOL(kern_mount);
index f813bc8266aa592455caba8d264b90419544c5cc..eca70cfe5b8562640663bed95fc2a1a7040038fa 100644 (file)
@@ -1763,7 +1763,7 @@ extern struct inode_operations simple_dir_inode_operations;
 struct tree_descr { char *name; const struct file_operations *ops; int mode; };
 struct dentry *d_alloc_name(struct dentry *, const char *);
 extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
-extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);
+extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
 extern void simple_release_fs(struct vfsmount **mount, int *count);
 
 extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
index 4c5e68e4e9aed7fcf6b31a88d240046ffeb0f899..8184342440f02326eab41f2d63968b1aca07c0ef 100644 (file)
@@ -2261,7 +2261,7 @@ static int __init init_tmpfs(void)
 #ifdef CONFIG_TMPFS
        devfs_mk_dir("shm");
 #endif
-       shm_mnt = do_kern_mount(tmpfs_fs_type.name, MS_NOUSER,
+       shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER,
                                tmpfs_fs_type.name, NULL);
        if (IS_ERR(shm_mnt)) {
                error = PTR_ERR(shm_mnt);
index cc673dd8433fd3653d66100e460acf7cdfac60ac..a5226df8ac03543755769956256f21c4eb94ead9 100644 (file)
@@ -439,7 +439,7 @@ struct vfsmount *rpc_get_mount(void)
 {
        int err;
 
-       err = simple_pin_fs("rpc_pipefs", &rpc_mount, &rpc_mount_count);
+       err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mount, &rpc_mount_count);
        if (err != 0)
                return ERR_PTR(err);
        return rpc_mount;
index 0f77b0223662882ab548b8a27dfe16c2a4b94c08..8bf40625c6701a5086b051c6f56a728d3c55a7f0 100644 (file)
@@ -224,7 +224,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
 
        pr_debug("securityfs: creating file '%s'\n",name);
 
-       error = simple_pin_fs("securityfs", &mount, &mount_count);
+       error = simple_pin_fs(&fs_type, &mount, &mount_count);
        if (error) {
                dentry = ERR_PTR(error);
                goto exit;