aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index cda50fe9250a..22bfe8273c68 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2721,6 +2721,25 @@ EXPORT_SYMBOL(put_mnt_ns);
2721 2721
2722struct vfsmount *kern_mount_data(struct file_system_type *type, void *data) 2722struct vfsmount *kern_mount_data(struct file_system_type *type, void *data)
2723{ 2723{
2724 return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data); 2724 struct vfsmount *mnt;
2725 mnt = vfs_kern_mount(type, MS_KERNMOUNT, type->name, data);
2726 if (!IS_ERR(mnt)) {
2727 /*
2728 * it is a longterm mount, don't release mnt until
2729 * we unmount before file sys is unregistered
2730 */
2731 mnt_make_longterm(mnt);
2732 }
2733 return mnt;
2725} 2734}
2726EXPORT_SYMBOL_GPL(kern_mount_data); 2735EXPORT_SYMBOL_GPL(kern_mount_data);
2736
2737void kern_unmount(struct vfsmount *mnt)
2738{
2739 /* release long term mount so mount point can be released */
2740 if (!IS_ERR_OR_NULL(mnt)) {
2741 mnt_make_shortterm(mnt);
2742 mntput(mnt);
2743 }
2744}
2745EXPORT_SYMBOL(kern_unmount);