Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

VFS: Unexport do_kern_mount() and clean up simple_pin_fs()

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>

+17 -16
+1 -1
Documentation/filesystems/automount-support.txt
··· 19 19 20 20 (2) Have the follow_link() op do the following steps: 21 21 22 - (a) Call do_kern_mount() to call the appropriate filesystem to set up a 22 + (a) Call vfs_kern_mount() to call the appropriate filesystem to set up a 23 23 superblock and gain a vfsmount structure representing it. 24 24 25 25 (b) Copy the nameidata provided as an argument and substitute the dentry
+1 -1
drivers/usb/core/inode.c
··· 569 569 ignore_mount = 1; 570 570 571 571 /* create the devices special file */ 572 - retval = simple_pin_fs("usbfs", &usbfs_mount, &usbfs_mount_count); 572 + retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); 573 573 if (retval) { 574 574 err ("Unable to get usbfs mount"); 575 575 goto exit;
+1 -1
fs/afs/mntpt.c
··· 210 210 211 211 /* try and do the mount */ 212 212 kdebug("--- attempting mount %s -o %s ---", devname, options); 213 - mnt = do_kern_mount("afs", 0, devname, options); 213 + mnt = vfs_kern_mount(&afs_fs_type, 0, devname, options); 214 214 kdebug("--- mount result %p ---", mnt); 215 215 216 216 free_page((unsigned long) devname);
+1 -1
fs/afs/super.c
··· 48 48 49 49 static void afs_destroy_inode(struct inode *inode); 50 50 51 - static struct file_system_type afs_fs_type = { 51 + struct file_system_type afs_fs_type = { 52 52 .owner = THIS_MODULE, 53 53 .name = "afs", 54 54 .get_sb = afs_get_sb,
+2
fs/afs/super.h
··· 38 38 return sb->s_fs_info; 39 39 } 40 40 41 + extern struct file_system_type afs_fs_type; 42 + 41 43 #endif /* __KERNEL__ */ 42 44 43 45 #endif /* _LINUX_AFS_SUPER_H */
+2 -1
fs/binfmt_misc.c
··· 55 55 } Node; 56 56 57 57 static DEFINE_RWLOCK(entries_lock); 58 + static struct file_system_type bm_fs_type; 58 59 static struct vfsmount *bm_mnt; 59 60 static int entry_count; 60 61 ··· 639 638 if (!inode) 640 639 goto out2; 641 640 642 - err = simple_pin_fs("binfmt_misc", &bm_mnt, &entry_count); 641 + err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count); 643 642 if (err) { 644 643 iput(inode); 645 644 inode = NULL;
+1 -1
fs/configfs/mount.c
··· 118 118 119 119 int configfs_pin_fs(void) 120 120 { 121 - return simple_pin_fs("configfs", &configfs_mount, 121 + return simple_pin_fs(&configfs_fs_type, &configfs_mount, 122 122 &configfs_mnt_count); 123 123 } 124 124
+1 -1
fs/debugfs/inode.c
··· 199 199 200 200 pr_debug("debugfs: creating file '%s'\n",name); 201 201 202 - error = simple_pin_fs("debugfs", &debugfs_mount, &debugfs_mount_count); 202 + error = simple_pin_fs(&debug_fs_type, &debugfs_mount, &debugfs_mount_count); 203 203 if (error) 204 204 goto exit; 205 205
+2 -2
fs/libfs.c
··· 424 424 425 425 static DEFINE_SPINLOCK(pin_fs_lock); 426 426 427 - int simple_pin_fs(char *name, struct vfsmount **mount, int *count) 427 + int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *count) 428 428 { 429 429 struct vfsmount *mnt = NULL; 430 430 spin_lock(&pin_fs_lock); 431 431 if (unlikely(!*mount)) { 432 432 spin_unlock(&pin_fs_lock); 433 - mnt = do_kern_mount(name, 0, name, NULL); 433 + mnt = vfs_kern_mount(type, 0, type->name, NULL); 434 434 if (IS_ERR(mnt)) 435 435 return PTR_ERR(mnt); 436 436 spin_lock(&pin_fs_lock);
+1 -3
fs/super.c
··· 864 864 return mnt; 865 865 } 866 866 867 - EXPORT_SYMBOL_GPL(do_kern_mount); 868 - 869 867 struct vfsmount *kern_mount(struct file_system_type *type) 870 868 { 871 - return do_kern_mount(type->name, 0, type->name, NULL); 869 + return vfs_kern_mount(type, 0, type->name, NULL); 872 870 } 873 871 874 872 EXPORT_SYMBOL(kern_mount);
+1 -1
include/linux/fs.h
··· 1763 1763 struct tree_descr { char *name; const struct file_operations *ops; int mode; }; 1764 1764 struct dentry *d_alloc_name(struct dentry *, const char *); 1765 1765 extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1766 - extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); 1766 + extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); 1767 1767 extern void simple_release_fs(struct vfsmount **mount, int *count); 1768 1768 1769 1769 extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
+1 -1
mm/shmem.c
··· 2261 2261 #ifdef CONFIG_TMPFS 2262 2262 devfs_mk_dir("shm"); 2263 2263 #endif 2264 - shm_mnt = do_kern_mount(tmpfs_fs_type.name, MS_NOUSER, 2264 + shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER, 2265 2265 tmpfs_fs_type.name, NULL); 2266 2266 if (IS_ERR(shm_mnt)) { 2267 2267 error = PTR_ERR(shm_mnt);
+1 -1
net/sunrpc/rpc_pipe.c
··· 439 439 { 440 440 int err; 441 441 442 - err = simple_pin_fs("rpc_pipefs", &rpc_mount, &rpc_mount_count); 442 + err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mount, &rpc_mount_count); 443 443 if (err != 0) 444 444 return ERR_PTR(err); 445 445 return rpc_mount;
+1 -1
security/inode.c
··· 224 224 225 225 pr_debug("securityfs: creating file '%s'\n",name); 226 226 227 - error = simple_pin_fs("securityfs", &mount, &mount_count); 227 + error = simple_pin_fs(&fs_type, &mount, &mount_count); 228 228 if (error) { 229 229 dentry = ERR_PTR(error); 230 230 goto exit;