Skip to content

Commit 1f5ce9e

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
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>
1 parent bb4a58b commit 1f5ce9e

14 files changed

Lines changed: 17 additions & 16 deletions

File tree

‎Documentation/filesystems/automount-support.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ following procedure:
1919

2020
(2) Have the follow_link() op do the following steps:
2121

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
2323
superblock and gain a vfsmount structure representing it.
2424

2525
(b) Copy the nameidata provided as an argument and substitute the dentry

‎drivers/usb/core/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static int create_special_files (void)
569569
ignore_mount = 1;
570570

571571
/* 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);
573573
if (retval) {
574574
err ("Unable to get usbfs mount");
575575
goto exit;

‎fs/afs/mntpt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
210210

211211
/* try and do the mount */
212212
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);
214214
kdebug("--- mount result %p ---", mnt);
215215

216216
free_page((unsigned long) devname);

‎fs/afs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void afs_put_super(struct super_block *sb);
4848

4949
static void afs_destroy_inode(struct inode *inode);
5050

51-
static struct file_system_type afs_fs_type = {
51+
struct file_system_type afs_fs_type = {
5252
.owner = THIS_MODULE,
5353
.name = "afs",
5454
.get_sb = afs_get_sb,

‎fs/afs/super.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ static inline struct afs_super_info *AFS_FS_S(struct super_block *sb)
3838
return sb->s_fs_info;
3939
}
4040

41+
extern struct file_system_type afs_fs_type;
42+
4143
#endif /* __KERNEL__ */
4244

4345
#endif /* _LINUX_AFS_SUPER_H */

‎fs/binfmt_misc.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ typedef struct {
5555
} Node;
5656

5757
static DEFINE_RWLOCK(entries_lock);
58+
static struct file_system_type bm_fs_type;
5859
static struct vfsmount *bm_mnt;
5960
static int entry_count;
6061

@@ -638,7 +639,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
638639
if (!inode)
639640
goto out2;
640641

641-
err = simple_pin_fs("binfmt_misc", &bm_mnt, &entry_count);
642+
err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count);
642643
if (err) {
643644
iput(inode);
644645
inode = NULL;

‎fs/configfs/mount.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static struct file_system_type configfs_fs_type = {
118118

119119
int configfs_pin_fs(void)
120120
{
121-
return simple_pin_fs("configfs", &configfs_mount,
121+
return simple_pin_fs(&configfs_fs_type, &configfs_mount,
122122
&configfs_mnt_count);
123123
}
124124

‎fs/debugfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode,
199199

200200
pr_debug("debugfs: creating file '%s'\n",name);
201201

202-
error = simple_pin_fs("debugfs", &debugfs_mount, &debugfs_mount_count);
202+
error = simple_pin_fs(&debug_fs_type, &debugfs_mount, &debugfs_mount_count);
203203
if (error)
204204
goto exit;
205205

‎fs/libfs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,13 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
424424

425425
static DEFINE_SPINLOCK(pin_fs_lock);
426426

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)
428428
{
429429
struct vfsmount *mnt = NULL;
430430
spin_lock(&pin_fs_lock);
431431
if (unlikely(!*mount)) {
432432
spin_unlock(&pin_fs_lock);
433-
mnt = do_kern_mount(name, 0, name, NULL);
433+
mnt = vfs_kern_mount(type, 0, type->name, NULL);
434434
if (IS_ERR(mnt))
435435
return PTR_ERR(mnt);
436436
spin_lock(&pin_fs_lock);

‎fs/super.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,9 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
864864
return mnt;
865865
}
866866

867-
EXPORT_SYMBOL_GPL(do_kern_mount);
868-
869867
struct vfsmount *kern_mount(struct file_system_type *type)
870868
{
871-
return do_kern_mount(type->name, 0, type->name, NULL);
869+
return vfs_kern_mount(type, 0, type->name, NULL);
872870
}
873871

874872
EXPORT_SYMBOL(kern_mount);

0 commit comments

Comments
 (0)