1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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>
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>
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>
42#include "internal.h"
43
44
45LIST_HEAD(super_blocks);
46DEFINE_SPINLOCK(sb_lock);
47
48
49
50
51
52
53
54
55static struct super_block *alloc_super(struct file_system_type *type)
56{
57 struct super_block *s = kzalloc(sizeof(struct super_block), GFP_USER);
58 static struct super_operations default_op;
59
60 if (s) {
61 if (security_sb_alloc(s)) {
62 kfree(s);
63 s = NULL;
64 goto out;
65 }
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);
77
78
79
80
81
82 lockdep_set_class(&s->s_lock, &type->s_lock_key);
83 down_write(&s->s_umount);
84 s->s_count = S_BIAS;
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;
96 }
97out:
98 return s;
99}
100
101
102
103
104
105
106
107static inline void destroy_super(struct super_block *s)
108{
109 security_sb_free(s);
110 kfree(s->s_subtype);
111 kfree(s->s_options);
112 kfree(s);
113}
114
115
116
117
118
119
120
121static int __put_super(struct super_block *sb)
122{
123 int ret = 0;
124
125 if (!--sb->s_count) {
126 destroy_super(sb);
127 ret = 1;
128 }
129 return ret;
130}
131
132
133
134
135
136
137
138
139int __put_super_and_need_restart(struct super_block *sb)
140{
141
142 if (list_empty(&sb->s_list)) {
143
144 __put_super(sb);
145 return 1;
146 }
147
148 sb->s_count--;
149 BUG_ON(sb->s_count == 0);
150 return 0;
151}
152
153
154
155
156
157
158
159
160static void put_super(struct super_block *sb)
161{
162 spin_lock(&sb_lock);
163 __put_super(sb);
164 spin_unlock(&sb_lock);
165}
166
167
168
169
170
171
172
173
174
175
176
177void deactivate_super(struct super_block *s)
178{
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);
183 DQUOT_OFF(s, 0);
184 down_write(&s->s_umount);
185 fs->kill_sb(s);
186 put_filesystem(fs);
187 put_super(s);
188 }
189}
190
191EXPORT_SYMBOL(deactivate_super);
192
193
194
195
196
197
198
199
200
201
202
203
204static int grab_super(struct super_block *s) __releases(sb_lock)
205{
206 s->s_count++;
207 spin_unlock(&sb_lock);
208 down_write(&s->s_umount);
209 if (s->s_root) {
210 spin_lock(&sb_lock);
211 if (s->s_count > S_BIAS) {
212 atomic_inc(&s->s_active);
213 s->s_count--;
214 spin_unlock(&sb_lock);
215 return 1;
216 }
217 spin_unlock(&sb_lock);
218 }
219 up_write(&s->s_umount);
220 put_super(s);
221 yield();
222 return 0;
223}
224
225
226
227
228void lock_super(struct super_block * sb)
229{
230 get_fs_excl();
231 mutex_lock(&sb->s_lock);
232}
233
234void unlock_super(struct super_block * sb)
235{
236 put_fs_excl();
237 mutex_unlock(&sb->s_lock);
238}
239
240EXPORT_SYMBOL(lock_super);
241EXPORT_SYMBOL(unlock_super);
242
243
244
245
246
247
248
249void __fsync_super(struct super_block *sb)
250{
251 sync_inodes_sb(sb, 0);
252 DQUOT_SYNC(sb);
253 lock_super(sb);
254 if (sb->s_dirt && sb->s_op->write_super)
255 sb->s_op->write_super(sb);
256 unlock_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);
261}
262
263
264
265
266
267
268int fsync_super(struct super_block *sb)
269{
270 __fsync_super(sb);
271 return sync_blockdev(sb->s_bdev);
272}
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288void generic_shutdown_super(struct super_block *sb)
289{
290 const struct super_operations *sop = sb->s_op;
291
292 if (sb->s_root) {
293 shrink_dcache_for_umount(sb);
294 fsync_super(sb);
295 lock_super(sb);
296 sb->s_flags &= ~MS_ACTIVE;
297
298 invalidate_inodes(sb);
299 lock_kernel();
300
301 if (sop->write_super && sb->s_dirt)
302 sop->write_super(sb);
303 if (sop->put_super)
304 sop->put_super(sb);
305
306
307 if (invalidate_inodes(sb)) {
308 printk("VFS: Busy inodes after unmount of %s. "
309 "Self-destruct in 5 seconds. Have a nice day...\n",
310 sb->s_id);
311 }
312
313 unlock_kernel();
314 unlock_super(sb);
315 }
316 spin_lock(&sb_lock);
317
318 list_del_init(&sb->s_list);
319 list_del(&sb->s_instances);
320 spin_unlock(&sb_lock);
321 up_write(&sb->s_umount);
322}
323
324EXPORT_SYMBOL(generic_shutdown_super);
325
326
327
328
329
330
331
332
333struct super_block *sget(struct file_system_type *type,
334 int (*test)(struct super_block *,void *),
335 int (*set)(struct super_block *,void *),
336 void *data)
337{
338 struct super_block *s = NULL;
339 struct super_block *old;
340 int err;
341
342retry:
343 spin_lock(&sb_lock);
344 if (test) {
345 list_for_each_entry(old, &type->fs_supers, s_instances) {
346 if (!test(old, data))
347 continue;
348 if (!grab_super(old))
349 goto retry;
350 if (s)
351 destroy_super(s);
352 return old;
353 }
354 }
355 if (!s) {
356 spin_unlock(&sb_lock);
357 s = alloc_super(type);
358 if (!s)
359 return ERR_PTR(-ENOMEM);
360 goto retry;
361 }
362
363 err = set(s, data);
364 if (err) {
365 spin_unlock(&sb_lock);
366 destroy_super(s);
367 return ERR_PTR(err);
368 }
369 s->s_type = type;
370 strlcpy(s->s_id, type->name, sizeof(s->s_id));
371 list_add_tail(&s->s_list, &super_blocks);
372 list_add(&s->s_instances, &type->fs_supers);
373 spin_unlock(&sb_lock);
374 get_filesystem(type);
375 return s;
376}
377
378EXPORT_SYMBOL(sget);
379
380void drop_super(struct super_block *sb)
381{
382 up_read(&sb->s_umount);
383 put_super(sb);
384}
385
386EXPORT_SYMBOL(drop_super);
387
388static inline void write_super(struct super_block *sb)
389{
390 lock_super(sb);
391 if (sb->s_root && sb->s_dirt)
392 if (sb->s_op->write_super)
393 sb->s_op->write_super(sb);
394 unlock_super(sb);
395}
396
397
398
399
400
401
402void sync_supers(void)
403{
404 struct super_block *sb;
405
406 spin_lock(&sb_lock);
407restart:
408 list_for_each_entry(sb, &super_blocks, s_list) {
409 if (sb->s_dirt) {
410 sb->s_count++;
411 spin_unlock(&sb_lock);
412 down_read(&sb->s_umount);
413 write_super(sb);
414 up_read(&sb->s_umount);
415 spin_lock(&sb_lock);
416 if (__put_super_and_need_restart(sb))
417 goto restart;
418 }
419 }
420 spin_unlock(&sb_lock);
421}
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439void sync_filesystems(int wait)
440{
441 struct super_block *sb;
442 static DEFINE_MUTEX(mutex);
443
444 mutex_lock(&mutex);
445 spin_lock(&sb_lock);
446 list_for_each_entry(sb, &super_blocks, s_list) {
447 if (!sb->s_op->sync_fs)
448 continue;
449 if (sb->s_flags & MS_RDONLY)
450 continue;
451 sb->s_need_sync_fs = 1;
452 }
453
454restart:
455 list_for_each_entry(sb, &super_blocks, s_list) {
456 if (!sb->s_need_sync_fs)
457 continue;
458 sb->s_need_sync_fs = 0;
459 if (sb->s_flags & MS_RDONLY)
460 continue;
461 sb->s_count++;
462 spin_unlock(&sb_lock);
463 down_read(&sb->s_umount);
464 if (sb->s_root && (wait || sb->s_dirt))
465 sb->s_op->sync_fs(sb, wait);
466 up_read(&sb->s_umount);
467
468 spin_lock(&sb_lock);
469 if (__put_super_and_need_restart(sb))
470 goto restart;
471 }
472 spin_unlock(&sb_lock);
473 mutex_unlock(&mutex);
474}
475
476
477
478
479
480
481
482
483
484struct super_block * get_super(struct block_device *bdev)
485{
486 struct super_block *sb;
487
488 if (!bdev)
489 return NULL;
490
491 spin_lock(&sb_lock);
492rescan:
493 list_for_each_entry(sb, &super_blocks, s_list) {
494 if (sb->s_bdev == bdev) {
495 sb->s_count++;
496 spin_unlock(&sb_lock);
497 down_read(&sb->s_umount);
498 if (sb->s_root)
499 return sb;
500 up_read(&sb->s_umount);
501
502 spin_lock(&sb_lock);
503 if (__put_super_and_need_restart(sb))
504 goto rescan;
505 }
506 }
507 spin_unlock(&sb_lock);
508 return NULL;
509}
510
511EXPORT_SYMBOL(get_super);
512
513struct super_block * user_get_super(dev_t dev)
514{
515 struct super_block *sb;
516
517 spin_lock(&sb_lock);
518rescan:
519 list_for_each_entry(sb, &super_blocks, s_list) {
520 if (sb->s_dev == dev) {
521 sb->s_count++;
522 spin_unlock(&sb_lock);
523 down_read(&sb->s_umount);
524 if (sb->s_root)
525 return sb;
526 up_read(&sb->s_umount);
527
528 spin_lock(&sb_lock);
529 if (__put_super_and_need_restart(sb))
530 goto rescan;
531 }
532 }
533 spin_unlock(&sb_lock);
534 return NULL;
535}
536
537asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf)
538{
539 struct super_block *s;
540 struct ustat tmp;
541 struct kstatfs sbuf;
542 int err = -EINVAL;
543
544 s = user_get_super(new_decode_dev(dev));
545 if (s == NULL)
546 goto out;
547 err = vfs_statfs(s->s_root, &sbuf);
548 drop_super(s);
549 if (err)
550 goto out;
551
552 memset(&tmp,0,sizeof(struct ustat));
553 tmp.f_tfree = sbuf.f_bfree;
554 tmp.f_tinode = sbuf.f_ffree;
555
556 err = copy_to_user(ubuf,&tmp,sizeof(struct ustat)) ? -EFAULT : 0;
557out:
558 return err;
559}
560
561
562
563
564
565
566
567
568
569static void mark_files_ro(struct super_block *sb)
570{
571 struct file *f;
572
573retry:
574 file_list_lock();
575 list_for_each_entry(f, &sb->s_files, f_u.fu_list) {
576 struct vfsmount *mnt;
577 if (!S_ISREG(f->f_path.dentry->d_inode->i_mode))
578 continue;
579 if (!file_count(f))
580 continue;
581 if (!(f->f_mode & FMODE_WRITE))
582 continue;
583 f->f_mode &= ~FMODE_WRITE;
584 if (file_check_writeable(f) != 0)
585 continue;
586 file_release_write(f);
587 mnt = mntget(f->f_path.mnt);
588 file_list_unlock();
589
590
591
592
593 mnt_drop_write(mnt);
594 mntput(mnt);
595 goto retry;
596 }
597 file_list_unlock();
598}
599
600
601
602
603
604
605
606
607
608
609int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
610{
611 int retval;
612 int remount_rw;
613
614#ifdef CONFIG_BLOCK
615 if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev))
616 return -EACCES;
617#endif
618 if (flags & MS_RDONLY)
619 acct_auto_close(sb);
620 shrink_dcache_sb(sb);
621 fsync_super(sb);
622
623
624
625 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) {
626 if (force)
627 mark_files_ro(sb);
628 else if (!fs_may_remount_ro(sb))
629 return -EBUSY;
630 retval = DQUOT_OFF(sb, 1);
631 if (retval < 0 && retval != -ENOSYS)
632 return -EBUSY;
633 }
634 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY);
635
636 if (sb->s_op->remount_fs) {
637 lock_super(sb);
638 retval = sb->s_op->remount_fs(sb, &flags, data);
639 unlock_super(sb);
640 if (retval)
641 return retval;
642 }
643 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
644 if (remount_rw)
645 DQUOT_ON_REMOUNT(sb);
646 return 0;
647}
648
649static void do_emergency_remount(unsigned long foo)
650{
651 struct super_block *sb;
652
653 spin_lock(&sb_lock);
654 list_for_each_entry(sb, &super_blocks, s_list) {
655 sb->s_count++;
656 spin_unlock(&sb_lock);
657 down_read(&sb->s_umount);
658 if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
659
660
661
662
663
664 lock_kernel();
665 do_remount_sb(sb, MS_RDONLY, NULL, 1);
666 unlock_kernel();
667 }
668 drop_super(sb);
669 spin_lock(&sb_lock);
670 }
671 spin_unlock(&sb_lock);
672 printk("Emergency Remount complete\n");
673}
674
675void emergency_remount(void)
676{
677 pdflush_operation(do_emergency_remount, 0);
678}
679
680
681
682
683
684
685static struct idr unnamed_dev_idr;
686static DEFINE_SPINLOCK(unnamed_dev_lock);
687
688int set_anon_super(struct super_block *s, void *data)
689{
690 int dev;
691 int error;
692
693 retry:
694 if (idr_pre_get(&unnamed_dev_idr, GFP_ATOMIC) == 0)
695 return -ENOMEM;
696 spin_lock(&unnamed_dev_lock);
697 error = idr_get_new(&unnamed_dev_idr, NULL, &dev);
698 spin_unlock(&unnamed_dev_lock);
699 if (error == -EAGAIN)
700
701 goto retry;
702 else if (error)
703 return -EAGAIN;
704
705 if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) {
706 spin_lock(&unnamed_dev_lock);
707 idr_remove(&unnamed_dev_idr, dev);
708 spin_unlock(&unnamed_dev_lock);
709 return -EMFILE;
710 }
711 s->s_dev = MKDEV(0, dev & MINORMASK);
712 return 0;
713}
714
715EXPORT_SYMBOL(set_anon_super);
716
717void kill_anon_super(struct super_block *sb)
718{
719 int slot = MINOR(sb->s_dev);
720
721 generic_shutdown_super(sb);
722 spin_lock(&unnamed_dev_lock);
723 idr_remove(&unnamed_dev_idr, slot);
724 spin_unlock(&unnamed_dev_lock);
725}
726
727EXPORT_SYMBOL(kill_anon_super);
728
729void __init unnamed_dev_init(void)
730{
731 idr_init(&unnamed_dev_idr);
732}
733
734void kill_litter_super(struct super_block *sb)
735{
736 if (sb->s_root)
737 d_genocide(sb->s_root);
738 kill_anon_super(sb);
739}
740
741EXPORT_SYMBOL(kill_litter_super);
742
743#ifdef CONFIG_BLOCK
744static int set_bdev_super(struct super_block *s, void *data)
745{
746 s->s_bdev = data;
747 s->s_dev = s->s_bdev->bd_dev;
748 return 0;
749}
750
751static int test_bdev_super(struct super_block *s, void *data)
752{
753 return (void *)s->s_bdev == data;
754}
755
756int get_sb_bdev(struct file_system_type *fs_type,
757 int flags, const char *dev_name, void *data,
758 int (*fill_super)(struct super_block *, void *, int),
759 struct vfsmount *mnt)
760{
761 struct block_device *bdev;
762 struct super_block *s;
763 int error = 0;
764
765 bdev = open_bdev_excl(dev_name, flags, fs_type);
766 if (IS_ERR(bdev))
767 return PTR_ERR(bdev);
768
769
770
771
772
773
774 down(&bdev->bd_mount_sem);
775 s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
776 up(&bdev->bd_mount_sem);
777 if (IS_ERR(s))
778 goto error_s;
779
780 if (s->s_root) {
781 if ((flags ^ s->s_flags) & MS_RDONLY) {
782 up_write(&s->s_umount);
783 deactivate_super(s);
784 error = -EBUSY;
785 goto error_bdev;
786 }
787
788 close_bdev_excl(bdev);
789 } else {
790 char b[BDEVNAME_SIZE];
791
792 s->s_flags = flags;
793 strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
794 sb_set_blocksize(s, block_size(bdev));
795 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
796 if (error) {
797 up_write(&s->s_umount);
798 deactivate_super(s);
799 goto error;
800 }
801
802 s->s_flags |= MS_ACTIVE;
803 }
804
805 return simple_set_mnt(mnt, s);
806
807error_s:
808 error = PTR_ERR(s);
809error_bdev:
810 close_bdev_excl(bdev);
811error:
812 return error;
813}
814
815EXPORT_SYMBOL(get_sb_bdev);
816
817void kill_block_super(struct super_block *sb)
818{
819 struct block_device *bdev = sb->s_bdev;
820
821 generic_shutdown_super(sb);
822 sync_blockdev(bdev);
823 close_bdev_excl(bdev);
824}
825
826EXPORT_SYMBOL(kill_block_super);
827#endif
828
829int get_sb_nodev(struct file_system_type *fs_type,
830 int flags, void *data,
831 int (*fill_super)(struct super_block *, void *, int),
832 struct vfsmount *mnt)
833{
834 int error;
835 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
836
837 if (IS_ERR(s))
838 return PTR_ERR(s);
839
840 s->s_flags = flags;
841
842 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
843 if (error) {
844 up_write(&s->s_umount);
845 deactivate_super(s);
846 return error;
847 }
848 s->s_flags |= MS_ACTIVE;
849 return simple_set_mnt(mnt, s);
850}
851
852EXPORT_SYMBOL(get_sb_nodev);
853
854static int compare_single(struct super_block *s, void *p)
855{
856 return 1;
857}
858
859int get_sb_single(struct file_system_type *fs_type,
860 int flags, void *data,
861 int (*fill_super)(struct super_block *, void *, int),
862 struct vfsmount *mnt)
863{
864 struct super_block *s;
865 int error;
866
867 s = sget(fs_type, compare_single, set_anon_super, NULL);
868 if (IS_ERR(s))
869 return PTR_ERR(s);
870 if (!s->s_root) {
871 s->s_flags = flags;
872 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
873 if (error) {
874 up_write(&s->s_umount);
875 deactivate_super(s);
876 return error;
877 }
878 s->s_flags |= MS_ACTIVE;
879 }
880 do_remount_sb(s, flags, data, 0);
881 return simple_set_mnt(mnt, s);
882}
883
884EXPORT_SYMBOL(get_sb_single);
885
886struct vfsmount *
887vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
888{
889 struct vfsmount *mnt;
890 char *secdata = NULL;
891 int error;
892
893 if (!type)
894 return ERR_PTR(-ENODEV);
895
896 error = -ENOMEM;
897 mnt = alloc_vfsmnt(name);
898 if (!mnt)
899 goto out;
900
901 if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) {
902 secdata = alloc_secdata();
903 if (!secdata)
904 goto out_mnt;
905
906 error = security_sb_copy_data(data, secdata);
907 if (error)
908 goto out_free_secdata;
909 }
910
911 error = type->get_sb(type, flags, name, data, mnt);
912 if (error < 0)
913 goto out_free_secdata;
914 BUG_ON(!mnt->mnt_sb);
915
916 error = security_sb_kern_mount(mnt->mnt_sb, secdata);
917 if (error)
918 goto out_sb;
919
920 mnt->mnt_mountpoint = mnt->mnt_root;
921 mnt->mnt_parent = mnt;
922 up_write(&mnt->mnt_sb->s_umount);
923 free_secdata(secdata);
924 return mnt;
925out_sb:
926 dput(mnt->mnt_root);
927 up_write(&mnt->mnt_sb->s_umount);
928 deactivate_super(mnt->mnt_sb);
929out_free_secdata:
930 free_secdata(secdata);
931out_mnt:
932 free_vfsmnt(mnt);
933out:
934 return ERR_PTR(error);
935}
936
937EXPORT_SYMBOL_GPL(vfs_kern_mount);
938
939static struct vfsmount *fs_set_subtype(struct vfsmount *mnt, const char *fstype)
940{
941 int err;
942 const char *subtype = strchr(fstype, '.');
943 if (subtype) {
944 subtype++;
945 err = -EINVAL;
946 if (!subtype[0])
947 goto err;
948 } else
949 subtype = "";
950
951 mnt->mnt_sb->s_subtype = kstrdup(subtype, GFP_KERNEL);
952 err = -ENOMEM;
953 if (!mnt->mnt_sb->s_subtype)
954 goto err;
955 return mnt;
956
957 err:
958 mntput(mnt);
959 return ERR_PTR(err);
960}
961
962struct vfsmount *
963do_kern_mount(const char *fstype, int flags, const char *name, void *data)
964{
965 struct file_system_type *type = get_fs_type(fstype);
966 struct vfsmount *mnt;
967 if (!type)
968 return ERR_PTR(-ENODEV);
969 mnt = vfs_kern_mount(type, flags, name, data);
970 if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
971 !mnt->mnt_sb->s_subtype)
972 mnt = fs_set_subtype(mnt, fstype);
973 put_filesystem(type);
974 return mnt;
975}
976EXPORT_SYMBOL_GPL(do_kern_mount);
977
978struct vfsmount *kern_mount_data(struct file_system_type *type, void *data)
979{
980 return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data);
981}
982
983EXPORT_SYMBOL_GPL(kern_mount_data);
984