4 * Copyright (C) 1991, 1992 Linus Torvalds
6 * super.c contains code to handle: - mount structures
8 * - filesystem drivers list
10 * - umount system call
13 * GK 2/5/95 - Changed to support mounting the root fs via NFS
15 * Added kerneld support: Jacques Gelinas and Bjorn Ekwall
16 * Added change_root: Werner Almesberger & Hans Lermen, Feb '96
17 * Added options to /proc/mounts:
18 * Torbjörn Lindh (torbjorn.lindh@gopta.se), April 14, 1996.
19 * Added devfs support: Richard Gooch <rgooch@atnf.csiro.au>, 13-JAN-1998
20 * Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000
23 #include <linux/module.h>
24 #include <linux/slab.h>
25 #include <linux/init.h>
26 #include <linux/smp_lock.h>
27 #include <linux/acct.h>
28 #include <linux/blkdev.h>
29 #include <linux/quotaops.h>
30 #include <linux/namei.h>
31 #include <linux/buffer_head.h> /* for fsync_super() */
32 #include <linux/mount.h>
33 #include <linux/security.h>
34 #include <linux/syscalls.h>
35 #include <linux/vfs.h>
36 #include <linux/writeback.h> /* for the emergency remount stuff */
37 #include <linux/idr.h>
38 #include <linux/kobject.h>
39 #include <linux/mutex.h>
40 #include <linux/file.h>
41 #include <asm/uaccess.h>
45 LIST_HEAD(super_blocks
);
46 DEFINE_SPINLOCK(sb_lock
);
49 * alloc_super - create new superblock
50 * @type: filesystem type superblock should belong to
52 * Allocates and initializes a new &struct super_block. alloc_super()
53 * returns a pointer new superblock or %NULL if allocation had failed.
55 static struct super_block
*alloc_super(struct file_system_type
*type
)
57 struct super_block
*s
= kzalloc(sizeof(struct super_block
), GFP_USER
);
58 static struct super_operations default_op
;
61 if (security_sb_alloc(s
)) {
66 INIT_LIST_HEAD(&s
->s_dirty
);
67 INIT_LIST_HEAD(&s
->s_io
);
68 INIT_LIST_HEAD(&s
->s_more_io
);
69 INIT_LIST_HEAD(&s
->s_files
);
70 INIT_LIST_HEAD(&s
->s_instances
);
71 INIT_HLIST_HEAD(&s
->s_anon
);
72 INIT_LIST_HEAD(&s
->s_inodes
);
73 INIT_LIST_HEAD(&s
->s_dentry_lru
);
74 init_rwsem(&s
->s_umount
);
75 mutex_init(&s
->s_lock
);
76 lockdep_set_class(&s
->s_umount
, &type
->s_umount_key
);
78 * The locking rules for s_lock are up to the
79 * filesystem. For example ext3fs has different
80 * lock ordering than usbfs:
82 lockdep_set_class(&s
->s_lock
, &type
->s_lock_key
);
83 down_write(&s
->s_umount
);
85 atomic_set(&s
->s_active
, 1);
86 mutex_init(&s
->s_vfs_rename_mutex
);
87 mutex_init(&s
->s_dquot
.dqio_mutex
);
88 mutex_init(&s
->s_dquot
.dqonoff_mutex
);
89 init_rwsem(&s
->s_dquot
.dqptr_sem
);
90 init_waitqueue_head(&s
->s_wait_unfrozen
);
91 s
->s_maxbytes
= MAX_NON_LFS
;
92 s
->dq_op
= sb_dquot_ops
;
93 s
->s_qcop
= sb_quotactl_ops
;
94 s
->s_op
= &default_op
;
95 s
->s_time_gran
= 1000000000;
102 * destroy_super - frees a superblock
103 * @s: superblock to free
105 * Frees a superblock.
107 static inline void destroy_super(struct super_block
*s
)
115 /* Superblock refcounting */
118 * Drop a superblock's refcount. Returns non-zero if the superblock was
119 * destroyed. The caller must hold sb_lock.
121 static int __put_super(struct super_block
*sb
)
125 if (!--sb
->s_count
) {
133 * Drop a superblock's refcount.
134 * Returns non-zero if the superblock is about to be destroyed and
135 * at least is already removed from super_blocks list, so if we are
136 * making a loop through super blocks then we need to restart.
137 * The caller must hold sb_lock.
139 int __put_super_and_need_restart(struct super_block
*sb
)
141 /* check for race with generic_shutdown_super() */
142 if (list_empty(&sb
->s_list
)) {
143 /* super block is removed, need to restart... */
147 /* can't be the last, since s_list is still in use */
149 BUG_ON(sb
->s_count
== 0);
154 * put_super - drop a temporary reference to superblock
155 * @sb: superblock in question
157 * Drops a temporary reference, frees superblock if there's no
160 static void put_super(struct super_block
*sb
)
164 spin_unlock(&sb_lock
);
169 * deactivate_super - drop an active reference to superblock
170 * @s: superblock to deactivate
172 * Drops an active reference to superblock, acquiring a temprory one if
173 * there is no active references left. In that case we lock superblock,
174 * tell fs driver to shut it down and drop the temporary reference we
177 void deactivate_super(struct super_block
*s
)
179 struct file_system_type
*fs
= s
->s_type
;
180 if (atomic_dec_and_lock(&s
->s_active
, &sb_lock
)) {
181 s
->s_count
-= S_BIAS
-1;
182 spin_unlock(&sb_lock
);
184 down_write(&s
->s_umount
);
191 EXPORT_SYMBOL(deactivate_super
);
194 * grab_super - acquire an active reference
195 * @s: reference we are trying to make active
197 * Tries to acquire an active reference. grab_super() is used when we
198 * had just found a superblock in super_blocks or fs_type->fs_supers
199 * and want to turn it into a full-blown active reference. grab_super()
200 * is called with sb_lock held and drops it. Returns 1 in case of
201 * success, 0 if we had failed (superblock contents was already dead or
202 * dying when grab_super() had been called).
204 static int grab_super(struct super_block
*s
) __releases(sb_lock
)
207 spin_unlock(&sb_lock
);
208 down_write(&s
->s_umount
);
211 if (s
->s_count
> S_BIAS
) {
212 atomic_inc(&s
->s_active
);
214 spin_unlock(&sb_lock
);
217 spin_unlock(&sb_lock
);
219 up_write(&s
->s_umount
);
226 * Superblock locking. We really ought to get rid of these two.
228 void lock_super(struct super_block
* sb
)
231 mutex_lock(&sb
->s_lock
);
234 void unlock_super(struct super_block
* sb
)
237 mutex_unlock(&sb
->s_lock
);
240 EXPORT_SYMBOL(lock_super
);
241 EXPORT_SYMBOL(unlock_super
);
244 * Write out and wait upon all dirty data associated with this
245 * superblock. Filesystem data as well as the underlying block
246 * device. Takes the superblock lock. Requires a second blkdev
247 * flush by the caller to complete the operation.
249 void __fsync_super(struct super_block
*sb
)
251 sync_inodes_sb(sb
, 0);
254 if (sb
->s_dirt
&& sb
->s_op
->write_super
)
255 sb
->s_op
->write_super(sb
);
257 if (sb
->s_op
->sync_fs
)
258 sb
->s_op
->sync_fs(sb
, 1);
259 sync_blockdev(sb
->s_bdev
);
260 sync_inodes_sb(sb
, 1);
264 * Write out and wait upon all dirty data associated with this
265 * superblock. Filesystem data as well as the underlying block
266 * device. Takes the superblock lock.
268 int fsync_super(struct super_block
*sb
)
271 return sync_blockdev(sb
->s_bdev
);
273 EXPORT_SYMBOL(fsync_super
);
276 * generic_shutdown_super - common helper for ->kill_sb()
277 * @sb: superblock to kill
279 * generic_shutdown_super() does all fs-independent work on superblock
280 * shutdown. Typical ->kill_sb() should pick all fs-specific objects
281 * that need destruction out of superblock, call generic_shutdown_super()
282 * and release aforementioned objects. Note: dentries and inodes _are_
283 * taken care of and do not need specific handling.
285 * Upon calling this function, the filesystem may no longer alter or
286 * rearrange the set of dentries belonging to this super_block, nor may it
287 * change the attachments of dentries to inodes.
289 void generic_shutdown_super(struct super_block
*sb
)
291 const struct super_operations
*sop
= sb
->s_op
;
294 shrink_dcache_for_umount(sb
);
297 sb
->s_flags
&= ~MS_ACTIVE
;
298 /* bad name - it should be evict_inodes() */
299 invalidate_inodes(sb
);
302 if (sop
->write_super
&& sb
->s_dirt
)
303 sop
->write_super(sb
);
307 /* Forget any remaining inodes */
308 if (invalidate_inodes(sb
)) {
309 printk("VFS: Busy inodes after unmount of %s. "
310 "Self-destruct in 5 seconds. Have a nice day...\n",
318 /* should be initialized for __put_super_and_need_restart() */
319 list_del_init(&sb
->s_list
);
320 list_del(&sb
->s_instances
);
321 spin_unlock(&sb_lock
);
322 up_write(&sb
->s_umount
);
325 EXPORT_SYMBOL(generic_shutdown_super
);
328 * sget - find or create a superblock
329 * @type: filesystem type superblock should belong to
330 * @test: comparison callback
331 * @set: setup callback
332 * @data: argument to each of them
334 struct super_block
*sget(struct file_system_type
*type
,
335 int (*test
)(struct super_block
*,void *),
336 int (*set
)(struct super_block
*,void *),
339 struct super_block
*s
= NULL
;
340 struct super_block
*old
;
346 list_for_each_entry(old
, &type
->fs_supers
, s_instances
) {
347 if (!test(old
, data
))
349 if (!grab_super(old
))
357 spin_unlock(&sb_lock
);
358 s
= alloc_super(type
);
360 return ERR_PTR(-ENOMEM
);
366 spin_unlock(&sb_lock
);
371 strlcpy(s
->s_id
, type
->name
, sizeof(s
->s_id
));
372 list_add_tail(&s
->s_list
, &super_blocks
);
373 list_add(&s
->s_instances
, &type
->fs_supers
);
374 spin_unlock(&sb_lock
);
375 get_filesystem(type
);
381 void drop_super(struct super_block
*sb
)
383 up_read(&sb
->s_umount
);
387 EXPORT_SYMBOL(drop_super
);
389 static inline void write_super(struct super_block
*sb
)
392 if (sb
->s_root
&& sb
->s_dirt
)
393 if (sb
->s_op
->write_super
)
394 sb
->s_op
->write_super(sb
);
399 * Note: check the dirty flag before waiting, so we don't
400 * hold up the sync while mounting a device. (The newly
401 * mounted device won't need syncing.)
403 void sync_supers(void)
405 struct super_block
*sb
;
409 list_for_each_entry(sb
, &super_blocks
, s_list
) {
412 spin_unlock(&sb_lock
);
413 down_read(&sb
->s_umount
);
415 up_read(&sb
->s_umount
);
417 if (__put_super_and_need_restart(sb
))
421 spin_unlock(&sb_lock
);
425 * Call the ->sync_fs super_op against all filesystems which are r/w and
426 * which implement it.
428 * This operation is careful to avoid the livelock which could easily happen
429 * if two or more filesystems are being continuously dirtied. s_need_sync_fs
430 * is used only here. We set it against all filesystems and then clear it as
431 * we sync them. So redirtied filesystems are skipped.
433 * But if process A is currently running sync_filesystems and then process B
434 * calls sync_filesystems as well, process B will set all the s_need_sync_fs
435 * flags again, which will cause process A to resync everything. Fix that with
438 * (Fabian) Avoid sync_fs with clean fs & wait mode 0
440 void sync_filesystems(int wait
)
442 struct super_block
*sb
;
443 static DEFINE_MUTEX(mutex
);
445 mutex_lock(&mutex
); /* Could be down_interruptible */
447 list_for_each_entry(sb
, &super_blocks
, s_list
) {
448 if (!sb
->s_op
->sync_fs
)
450 if (sb
->s_flags
& MS_RDONLY
)
452 sb
->s_need_sync_fs
= 1;
456 list_for_each_entry(sb
, &super_blocks
, s_list
) {
457 if (!sb
->s_need_sync_fs
)
459 sb
->s_need_sync_fs
= 0;
460 if (sb
->s_flags
& MS_RDONLY
)
461 continue; /* hm. Was remounted r/o meanwhile */
463 spin_unlock(&sb_lock
);
464 down_read(&sb
->s_umount
);
465 if (sb
->s_root
&& (wait
|| sb
->s_dirt
))
466 sb
->s_op
->sync_fs(sb
, wait
);
467 up_read(&sb
->s_umount
);
468 /* restart only when sb is no longer on the list */
470 if (__put_super_and_need_restart(sb
))
473 spin_unlock(&sb_lock
);
474 mutex_unlock(&mutex
);
478 * get_super - get the superblock of a device
479 * @bdev: device to get the superblock for
481 * Scans the superblock list and finds the superblock of the file system
482 * mounted on the device given. %NULL is returned if no match is found.
485 struct super_block
* get_super(struct block_device
*bdev
)
487 struct super_block
*sb
;
494 list_for_each_entry(sb
, &super_blocks
, s_list
) {
495 if (sb
->s_bdev
== bdev
) {
497 spin_unlock(&sb_lock
);
498 down_read(&sb
->s_umount
);
501 up_read(&sb
->s_umount
);
502 /* restart only when sb is no longer on the list */
504 if (__put_super_and_need_restart(sb
))
508 spin_unlock(&sb_lock
);
512 EXPORT_SYMBOL(get_super
);
514 struct super_block
* user_get_super(dev_t dev
)
516 struct super_block
*sb
;
520 list_for_each_entry(sb
, &super_blocks
, s_list
) {
521 if (sb
->s_dev
== dev
) {
523 spin_unlock(&sb_lock
);
524 down_read(&sb
->s_umount
);
527 up_read(&sb
->s_umount
);
528 /* restart only when sb is no longer on the list */
530 if (__put_super_and_need_restart(sb
))
534 spin_unlock(&sb_lock
);
538 asmlinkage
long sys_ustat(unsigned dev
, struct ustat __user
* ubuf
)
540 struct super_block
*s
;
545 s
= user_get_super(new_decode_dev(dev
));
548 err
= vfs_statfs(s
->s_root
, &sbuf
);
553 memset(&tmp
,0,sizeof(struct ustat
));
554 tmp
.f_tfree
= sbuf
.f_bfree
;
555 tmp
.f_tinode
= sbuf
.f_ffree
;
557 err
= copy_to_user(ubuf
,&tmp
,sizeof(struct ustat
)) ? -EFAULT
: 0;
563 * mark_files_ro - mark all files read-only
564 * @sb: superblock in question
566 * All files are marked read-only. We don't care about pending
567 * delete files so this should be used in 'force' mode only.
570 static void mark_files_ro(struct super_block
*sb
)
576 list_for_each_entry(f
, &sb
->s_files
, f_u
.fu_list
) {
577 struct vfsmount
*mnt
;
578 if (!S_ISREG(f
->f_path
.dentry
->d_inode
->i_mode
))
582 if (!(f
->f_mode
& FMODE_WRITE
))
584 f
->f_mode
&= ~FMODE_WRITE
;
585 if (file_check_writeable(f
) != 0)
587 file_release_write(f
);
588 mnt
= mntget(f
->f_path
.mnt
);
591 * This can sleep, so we can't hold
592 * the file_list_lock() spinlock.
602 * do_remount_sb - asks filesystem to change mount options.
603 * @sb: superblock in question
604 * @flags: numeric part of options
605 * @data: the rest of options
606 * @force: whether or not to force the change
608 * Alters the mount options of a mounted file system.
610 int do_remount_sb(struct super_block
*sb
, int flags
, void *data
, int force
)
616 if (!(flags
& MS_RDONLY
) && bdev_read_only(sb
->s_bdev
))
619 if (flags
& MS_RDONLY
)
621 shrink_dcache_sb(sb
);
624 /* If we are remounting RDONLY and current sb is read/write,
625 make sure there are no rw files opened */
626 if ((flags
& MS_RDONLY
) && !(sb
->s_flags
& MS_RDONLY
)) {
629 else if (!fs_may_remount_ro(sb
))
631 retval
= DQUOT_OFF(sb
, 1);
632 if (retval
< 0 && retval
!= -ENOSYS
)
635 remount_rw
= !(flags
& MS_RDONLY
) && (sb
->s_flags
& MS_RDONLY
);
637 if (sb
->s_op
->remount_fs
) {
639 retval
= sb
->s_op
->remount_fs(sb
, &flags
, data
);
644 sb
->s_flags
= (sb
->s_flags
& ~MS_RMT_MASK
) | (flags
& MS_RMT_MASK
);
646 DQUOT_ON_REMOUNT(sb
);
650 static void do_emergency_remount(unsigned long foo
)
652 struct super_block
*sb
;
655 list_for_each_entry(sb
, &super_blocks
, s_list
) {
657 spin_unlock(&sb_lock
);
658 down_read(&sb
->s_umount
);
659 if (sb
->s_root
&& sb
->s_bdev
&& !(sb
->s_flags
& MS_RDONLY
)) {
661 * ->remount_fs needs lock_kernel().
663 * What lock protects sb->s_flags??
666 do_remount_sb(sb
, MS_RDONLY
, NULL
, 1);
672 spin_unlock(&sb_lock
);
673 printk("Emergency Remount complete\n");
676 void emergency_remount(void)
678 pdflush_operation(do_emergency_remount
, 0);
682 * Unnamed block devices are dummy devices used by virtual
683 * filesystems which don't use real block-devices. -- jrs
686 static DEFINE_IDA(unnamed_dev_ida
);
687 static DEFINE_SPINLOCK(unnamed_dev_lock
);/* protects the above */
689 int set_anon_super(struct super_block
*s
, void *data
)
695 if (ida_pre_get(&unnamed_dev_ida
, GFP_ATOMIC
) == 0)
697 spin_lock(&unnamed_dev_lock
);
698 error
= ida_get_new(&unnamed_dev_ida
, &dev
);
699 spin_unlock(&unnamed_dev_lock
);
700 if (error
== -EAGAIN
)
701 /* We raced and lost with another CPU. */
706 if ((dev
& MAX_ID_MASK
) == (1 << MINORBITS
)) {
707 spin_lock(&unnamed_dev_lock
);
708 ida_remove(&unnamed_dev_ida
, dev
);
709 spin_unlock(&unnamed_dev_lock
);
712 s
->s_dev
= MKDEV(0, dev
& MINORMASK
);
716 EXPORT_SYMBOL(set_anon_super
);
718 void kill_anon_super(struct super_block
*sb
)
720 int slot
= MINOR(sb
->s_dev
);
722 generic_shutdown_super(sb
);
723 spin_lock(&unnamed_dev_lock
);
724 ida_remove(&unnamed_dev_ida
, slot
);
725 spin_unlock(&unnamed_dev_lock
);
728 EXPORT_SYMBOL(kill_anon_super
);
730 void kill_litter_super(struct super_block
*sb
)
733 d_genocide(sb
->s_root
);
737 EXPORT_SYMBOL(kill_litter_super
);
740 static int set_bdev_super(struct super_block
*s
, void *data
)
743 s
->s_dev
= s
->s_bdev
->bd_dev
;
747 static int test_bdev_super(struct super_block
*s
, void *data
)
749 return (void *)s
->s_bdev
== data
;
752 int get_sb_bdev(struct file_system_type
*fs_type
,
753 int flags
, const char *dev_name
, void *data
,
754 int (*fill_super
)(struct super_block
*, void *, int),
755 struct vfsmount
*mnt
)
757 struct block_device
*bdev
;
758 struct super_block
*s
;
759 fmode_t mode
= FMODE_READ
;
762 if (!(flags
& MS_RDONLY
))
765 bdev
= open_bdev_exclusive(dev_name
, mode
, fs_type
);
767 return PTR_ERR(bdev
);
770 * once the super is inserted into the list by sget, s_umount
771 * will protect the lockfs code from trying to start a snapshot
772 * while we are mounting
774 down(&bdev
->bd_mount_sem
);
775 s
= sget(fs_type
, test_bdev_super
, set_bdev_super
, bdev
);
776 up(&bdev
->bd_mount_sem
);
781 if ((flags
^ s
->s_flags
) & MS_RDONLY
) {
782 up_write(&s
->s_umount
);
788 close_bdev_exclusive(bdev
, mode
);
790 char b
[BDEVNAME_SIZE
];
794 strlcpy(s
->s_id
, bdevname(bdev
, b
), sizeof(s
->s_id
));
795 sb_set_blocksize(s
, block_size(bdev
));
796 error
= fill_super(s
, data
, flags
& MS_SILENT
? 1 : 0);
798 up_write(&s
->s_umount
);
803 s
->s_flags
|= MS_ACTIVE
;
806 return simple_set_mnt(mnt
, s
);
811 close_bdev_exclusive(bdev
, mode
);
816 EXPORT_SYMBOL(get_sb_bdev
);
818 void kill_block_super(struct super_block
*sb
)
820 struct block_device
*bdev
= sb
->s_bdev
;
821 fmode_t mode
= sb
->s_mode
;
823 generic_shutdown_super(sb
);
825 close_bdev_exclusive(bdev
, mode
);
828 EXPORT_SYMBOL(kill_block_super
);
831 int get_sb_nodev(struct file_system_type
*fs_type
,
832 int flags
, void *data
,
833 int (*fill_super
)(struct super_block
*, void *, int),
834 struct vfsmount
*mnt
)
837 struct super_block
*s
= sget(fs_type
, NULL
, set_anon_super
, NULL
);
844 error
= fill_super(s
, data
, flags
& MS_SILENT
? 1 : 0);
846 up_write(&s
->s_umount
);
850 s
->s_flags
|= MS_ACTIVE
;
851 return simple_set_mnt(mnt
, s
);
854 EXPORT_SYMBOL(get_sb_nodev
);
856 static int compare_single(struct super_block
*s
, void *p
)
861 int get_sb_single(struct file_system_type
*fs_type
,
862 int flags
, void *data
,
863 int (*fill_super
)(struct super_block
*, void *, int),
864 struct vfsmount
*mnt
)
866 struct super_block
*s
;
869 s
= sget(fs_type
, compare_single
, set_anon_super
, NULL
);
874 error
= fill_super(s
, data
, flags
& MS_SILENT
? 1 : 0);
876 up_write(&s
->s_umount
);
880 s
->s_flags
|= MS_ACTIVE
;
882 do_remount_sb(s
, flags
, data
, 0);
883 return simple_set_mnt(mnt
, s
);
886 EXPORT_SYMBOL(get_sb_single
);
889 vfs_kern_mount(struct file_system_type
*type
, int flags
, const char *name
, void *data
)
891 struct vfsmount
*mnt
;
892 char *secdata
= NULL
;
896 return ERR_PTR(-ENODEV
);
899 mnt
= alloc_vfsmnt(name
);
903 if (data
&& !(type
->fs_flags
& FS_BINARY_MOUNTDATA
)) {
904 secdata
= alloc_secdata();
908 error
= security_sb_copy_data(data
, secdata
);
910 goto out_free_secdata
;
913 error
= type
->get_sb(type
, flags
, name
, data
, mnt
);
915 goto out_free_secdata
;
916 BUG_ON(!mnt
->mnt_sb
);
918 error
= security_sb_kern_mount(mnt
->mnt_sb
, secdata
);
922 mnt
->mnt_mountpoint
= mnt
->mnt_root
;
923 mnt
->mnt_parent
= mnt
;
924 up_write(&mnt
->mnt_sb
->s_umount
);
925 free_secdata(secdata
);
929 up_write(&mnt
->mnt_sb
->s_umount
);
930 deactivate_super(mnt
->mnt_sb
);
932 free_secdata(secdata
);
936 return ERR_PTR(error
);
939 EXPORT_SYMBOL_GPL(vfs_kern_mount
);
941 static struct vfsmount
*fs_set_subtype(struct vfsmount
*mnt
, const char *fstype
)
944 const char *subtype
= strchr(fstype
, '.');
953 mnt
->mnt_sb
->s_subtype
= kstrdup(subtype
, GFP_KERNEL
);
955 if (!mnt
->mnt_sb
->s_subtype
)
965 do_kern_mount(const char *fstype
, int flags
, const char *name
, void *data
)
967 struct file_system_type
*type
= get_fs_type(fstype
);
968 struct vfsmount
*mnt
;
970 return ERR_PTR(-ENODEV
);
971 mnt
= vfs_kern_mount(type
, flags
, name
, data
);
972 if (!IS_ERR(mnt
) && (type
->fs_flags
& FS_HAS_SUBTYPE
) &&
973 !mnt
->mnt_sb
->s_subtype
)
974 mnt
= fs_set_subtype(mnt
, fstype
);
975 put_filesystem(type
);
978 EXPORT_SYMBOL_GPL(do_kern_mount
);
980 struct vfsmount
*kern_mount_data(struct file_system_type
*type
, void *data
)
982 return vfs_kern_mount(type
, MS_KERNMOUNT
, type
->name
, data
);
985 EXPORT_SYMBOL_GPL(kern_mount_data
);