2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
10 #include <linux/sched.h>
11 #include <linux/slab.h>
12 #include <linux/spinlock.h>
13 #include <linux/completion.h>
14 #include <linux/buffer_head.h>
15 #include <linux/vmalloc.h>
16 #include <linux/blkdev.h>
17 #include <linux/kthread.h>
18 #include <linux/namei.h>
19 #include <linux/mount.h>
20 #include <linux/gfs2_ondisk.h>
23 #include "lm_interface.h"
31 #include "ops_export.h"
32 #include "ops_fstype.h"
33 #include "ops_super.h"
43 extern struct dentry_operations gfs2_dops;
45 static struct gfs2_sbd *init_sbd(struct super_block *sb)
49 sdp = kzalloc(sizeof(struct gfs2_sbd), GFP_KERNEL);
56 gfs2_tune_init(&sdp->sd_tune);
58 INIT_LIST_HEAD(&sdp->sd_reclaim_list);
59 spin_lock_init(&sdp->sd_reclaim_lock);
60 init_waitqueue_head(&sdp->sd_reclaim_wq);
62 mutex_init(&sdp->sd_inum_mutex);
63 spin_lock_init(&sdp->sd_statfs_spin);
64 mutex_init(&sdp->sd_statfs_mutex);
66 spin_lock_init(&sdp->sd_rindex_spin);
67 mutex_init(&sdp->sd_rindex_mutex);
68 INIT_LIST_HEAD(&sdp->sd_rindex_list);
69 INIT_LIST_HEAD(&sdp->sd_rindex_mru_list);
70 INIT_LIST_HEAD(&sdp->sd_rindex_recent_list);
72 INIT_LIST_HEAD(&sdp->sd_jindex_list);
73 spin_lock_init(&sdp->sd_jindex_spin);
74 mutex_init(&sdp->sd_jindex_mutex);
76 INIT_LIST_HEAD(&sdp->sd_quota_list);
77 spin_lock_init(&sdp->sd_quota_spin);
78 mutex_init(&sdp->sd_quota_mutex);
80 spin_lock_init(&sdp->sd_log_lock);
82 INIT_LIST_HEAD(&sdp->sd_log_le_gl);
83 INIT_LIST_HEAD(&sdp->sd_log_le_buf);
84 INIT_LIST_HEAD(&sdp->sd_log_le_revoke);
85 INIT_LIST_HEAD(&sdp->sd_log_le_rg);
86 INIT_LIST_HEAD(&sdp->sd_log_le_databuf);
88 mutex_init(&sdp->sd_log_reserve_mutex);
89 INIT_LIST_HEAD(&sdp->sd_ail1_list);
90 INIT_LIST_HEAD(&sdp->sd_ail2_list);
92 init_rwsem(&sdp->sd_log_flush_lock);
93 INIT_LIST_HEAD(&sdp->sd_log_flush_list);
95 INIT_LIST_HEAD(&sdp->sd_revoke_list);
97 mutex_init(&sdp->sd_freeze_lock);
102 static void init_vfs(struct super_block *sb, unsigned noatime)
104 struct gfs2_sbd *sdp = sb->s_fs_info;
106 sb->s_magic = GFS2_MAGIC;
107 sb->s_op = &gfs2_super_ops;
108 sb->s_export_op = &gfs2_export_ops;
109 sb->s_maxbytes = MAX_LFS_FILESIZE;
111 if (sb->s_flags & (MS_NOATIME | MS_NODIRATIME))
112 set_bit(noatime, &sdp->sd_flags);
114 /* Don't let the VFS update atimes. GFS2 handles this itself. */
115 sb->s_flags |= MS_NOATIME | MS_NODIRATIME;
118 static int init_names(struct gfs2_sbd *sdp, int silent)
120 struct gfs2_sb *sb = NULL;
124 proto = sdp->sd_args.ar_lockproto;
125 table = sdp->sd_args.ar_locktable;
127 /* Try to autodetect */
129 if (!proto[0] || !table[0]) {
130 struct buffer_head *bh;
131 bh = sb_getblk(sdp->sd_vfs,
132 GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift);
134 clear_buffer_uptodate(bh);
135 clear_buffer_dirty(bh);
137 ll_rw_block(READ, 1, &bh);
140 if (!buffer_uptodate(bh)) {
145 sb = kmalloc(sizeof(struct gfs2_sb), GFP_KERNEL);
150 gfs2_sb_in(sb, bh->b_data);
153 error = gfs2_check_sb(sdp, sb, silent);
158 proto = sb->sb_lockproto;
160 table = sb->sb_locktable;
164 table = sdp->sd_vfs->s_id;
166 snprintf(sdp->sd_proto_name, GFS2_FSNAME_LEN, "%s", proto);
167 snprintf(sdp->sd_table_name, GFS2_FSNAME_LEN, "%s", table);
174 static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
177 struct task_struct *p;
183 p = kthread_run(gfs2_scand, sdp, "gfs2_scand");
186 fs_err(sdp, "can't start scand thread: %d\n", error);
189 sdp->sd_scand_process = p;
191 for (sdp->sd_glockd_num = 0;
192 sdp->sd_glockd_num < sdp->sd_args.ar_num_glockd;
193 sdp->sd_glockd_num++) {
194 p = kthread_run(gfs2_glockd, sdp, "gfs2_glockd");
197 fs_err(sdp, "can't start glockd thread: %d\n", error);
200 sdp->sd_glockd_process[sdp->sd_glockd_num] = p;
203 error = gfs2_glock_nq_num(sdp,
204 GFS2_MOUNT_LOCK, &gfs2_nondisk_glops,
205 LM_ST_EXCLUSIVE, LM_FLAG_NOEXP | GL_NOCACHE,
208 fs_err(sdp, "can't acquire mount glock: %d\n", error);
212 error = gfs2_glock_nq_num(sdp,
213 GFS2_LIVE_LOCK, &gfs2_nondisk_glops,
215 LM_FLAG_NOEXP | GL_EXACT,
218 fs_err(sdp, "can't acquire live glock: %d\n", error);
222 error = gfs2_glock_get(sdp, GFS2_RENAME_LOCK, &gfs2_nondisk_glops,
223 CREATE, &sdp->sd_rename_gl);
225 fs_err(sdp, "can't create rename glock: %d\n", error);
229 error = gfs2_glock_get(sdp, GFS2_TRANS_LOCK, &gfs2_trans_glops,
230 CREATE, &sdp->sd_trans_gl);
232 fs_err(sdp, "can't create transaction glock: %d\n", error);
235 set_bit(GLF_STICKY, &sdp->sd_trans_gl->gl_flags);
240 gfs2_glock_put(sdp->sd_trans_gl);
242 gfs2_glock_put(sdp->sd_rename_gl);
244 gfs2_glock_dq_uninit(&sdp->sd_live_gh);
246 gfs2_glock_dq_uninit(mount_gh);
248 while (sdp->sd_glockd_num--)
249 kthread_stop(sdp->sd_glockd_process[sdp->sd_glockd_num]);
251 kthread_stop(sdp->sd_scand_process);
255 static struct inode *gfs2_lookup_root(struct super_block *sb,
256 struct gfs2_inum *inum)
258 return gfs2_inode_lookup(sb, inum, DT_DIR);
261 static int init_sb(struct gfs2_sbd *sdp, int silent, int undo)
263 struct super_block *sb = sdp->sd_vfs;
264 struct gfs2_holder sb_gh;
265 struct gfs2_inum *inum;
277 error = gfs2_glock_nq_num(sdp, GFS2_SB_LOCK, &gfs2_meta_glops,
278 LM_ST_SHARED, 0, &sb_gh);
280 fs_err(sdp, "can't acquire superblock glock: %d\n", error);
284 error = gfs2_read_sb(sdp, sb_gh.gh_gl, silent);
286 fs_err(sdp, "can't read superblock: %d\n", error);
290 /* Set up the buffer cache and SB for real */
291 if (sdp->sd_sb.sb_bsize < bdev_hardsect_size(sb->s_bdev)) {
293 fs_err(sdp, "FS block size (%u) is too small for device "
295 sdp->sd_sb.sb_bsize, bdev_hardsect_size(sb->s_bdev));
298 if (sdp->sd_sb.sb_bsize > PAGE_SIZE) {
300 fs_err(sdp, "FS block size (%u) is too big for machine "
302 sdp->sd_sb.sb_bsize, (unsigned int)PAGE_SIZE);
305 sb_set_blocksize(sb, sdp->sd_sb.sb_bsize);
307 /* Get the root inode */
308 inum = &sdp->sd_sb.sb_root_dir;
309 if (sb->s_type == &gfs2meta_fs_type)
310 inum = &sdp->sd_sb.sb_master_dir;
311 inode = gfs2_lookup_root(sb, inum);
313 error = PTR_ERR(inode);
314 fs_err(sdp, "can't read in root inode: %d\n", error);
318 sb->s_root = d_alloc_root(inode);
320 fs_err(sdp, "can't get root dentry\n");
324 sb->s_root->d_op = &gfs2_dops;
326 gfs2_glock_dq_uninit(&sb_gh);
330 static int init_journal(struct gfs2_sbd *sdp, int undo)
332 struct gfs2_holder ji_gh;
333 struct task_struct *p;
334 struct gfs2_inode *ip;
343 sdp->sd_jindex = gfs2_lookup_simple(sdp->sd_master_dir, "jindex");
344 if (IS_ERR(sdp->sd_jindex)) {
345 fs_err(sdp, "can't lookup journal index: %d\n", error);
346 return PTR_ERR(sdp->sd_jindex);
348 ip = GFS2_I(sdp->sd_jindex);
349 set_bit(GLF_STICKY, &ip->i_gl->gl_flags);
351 /* Load in the journal index special file */
353 error = gfs2_jindex_hold(sdp, &ji_gh);
355 fs_err(sdp, "can't read journal index: %d\n", error);
360 if (!gfs2_jindex_size(sdp)) {
361 fs_err(sdp, "no journals!\n");
365 if (sdp->sd_args.ar_spectator) {
366 sdp->sd_jdesc = gfs2_jdesc_find(sdp, 0);
367 sdp->sd_log_blks_free = sdp->sd_jdesc->jd_blocks;
369 if (sdp->sd_lockstruct.ls_jid >= gfs2_jindex_size(sdp)) {
370 fs_err(sdp, "can't mount journal #%u\n",
371 sdp->sd_lockstruct.ls_jid);
372 fs_err(sdp, "there are only %u journals (0 - %u)\n",
373 gfs2_jindex_size(sdp),
374 gfs2_jindex_size(sdp) - 1);
377 sdp->sd_jdesc = gfs2_jdesc_find(sdp, sdp->sd_lockstruct.ls_jid);
379 error = gfs2_glock_nq_num(sdp, sdp->sd_lockstruct.ls_jid,
381 LM_ST_EXCLUSIVE, LM_FLAG_NOEXP,
382 &sdp->sd_journal_gh);
384 fs_err(sdp, "can't acquire journal glock: %d\n", error);
388 ip = GFS2_I(sdp->sd_jdesc->jd_inode);
389 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
390 LM_FLAG_NOEXP | GL_EXACT,
393 fs_err(sdp, "can't acquire journal inode glock: %d\n",
395 goto fail_journal_gh;
398 error = gfs2_jdesc_check(sdp->sd_jdesc);
400 fs_err(sdp, "my journal (%u) is bad: %d\n",
401 sdp->sd_jdesc->jd_jid, error);
404 sdp->sd_log_blks_free = sdp->sd_jdesc->jd_blocks;
407 if (sdp->sd_lockstruct.ls_first) {
409 for (x = 0; x < sdp->sd_journals; x++) {
410 error = gfs2_recover_journal(gfs2_jdesc_find(sdp, x));
412 fs_err(sdp, "error recovering journal %u: %d\n",
418 gfs2_lm_others_may_mount(sdp);
419 } else if (!sdp->sd_args.ar_spectator) {
420 error = gfs2_recover_journal(sdp->sd_jdesc);
422 fs_err(sdp, "error recovering my journal: %d\n", error);
427 set_bit(SDF_JOURNAL_CHECKED, &sdp->sd_flags);
428 gfs2_glock_dq_uninit(&ji_gh);
431 p = kthread_run(gfs2_recoverd, sdp, "gfs2_recoverd");
434 fs_err(sdp, "can't start recoverd thread: %d\n", error);
437 sdp->sd_recoverd_process = p;
442 kthread_stop(sdp->sd_recoverd_process);
444 if (!sdp->sd_args.ar_spectator)
445 gfs2_glock_dq_uninit(&sdp->sd_jinode_gh);
447 if (!sdp->sd_args.ar_spectator)
448 gfs2_glock_dq_uninit(&sdp->sd_journal_gh);
450 gfs2_jindex_free(sdp);
452 gfs2_glock_dq_uninit(&ji_gh);
454 iput(sdp->sd_jindex);
459 static int init_inodes(struct gfs2_sbd *sdp, int undo)
462 struct gfs2_inode *ip;
468 inode = gfs2_lookup_root(sdp->sd_vfs, &sdp->sd_sb.sb_master_dir);
470 error = PTR_ERR(inode);
471 fs_err(sdp, "can't read in master directory: %d\n", error);
474 sdp->sd_master_dir = inode;
476 error = init_journal(sdp, undo);
480 /* Read in the master inode number inode */
481 sdp->sd_inum_inode = gfs2_lookup_simple(sdp->sd_master_dir, "inum");
482 if (IS_ERR(sdp->sd_inum_inode)) {
483 error = PTR_ERR(sdp->sd_inum_inode);
484 fs_err(sdp, "can't read in inum inode: %d\n", error);
489 /* Read in the master statfs inode */
490 sdp->sd_statfs_inode = gfs2_lookup_simple(sdp->sd_master_dir, "statfs");
491 if (IS_ERR(sdp->sd_statfs_inode)) {
492 error = PTR_ERR(sdp->sd_statfs_inode);
493 fs_err(sdp, "can't read in statfs inode: %d\n", error);
497 /* Read in the resource index inode */
498 sdp->sd_rindex = gfs2_lookup_simple(sdp->sd_master_dir, "rindex");
499 if (IS_ERR(sdp->sd_rindex)) {
500 error = PTR_ERR(sdp->sd_rindex);
501 fs_err(sdp, "can't get resource index inode: %d\n", error);
504 ip = GFS2_I(sdp->sd_rindex);
505 set_bit(GLF_STICKY, &ip->i_gl->gl_flags);
506 sdp->sd_rindex_vn = ip->i_gl->gl_vn - 1;
508 /* Read in the quota inode */
509 sdp->sd_quota_inode = gfs2_lookup_simple(sdp->sd_master_dir, "quota");
510 if (IS_ERR(sdp->sd_quota_inode)) {
511 error = PTR_ERR(sdp->sd_quota_inode);
512 fs_err(sdp, "can't get quota file inode: %d\n", error);
518 iput(sdp->sd_quota_inode);
520 gfs2_clear_rgrpd(sdp);
521 iput(sdp->sd_rindex);
523 iput(sdp->sd_statfs_inode);
525 iput(sdp->sd_inum_inode);
527 init_journal(sdp, UNDO);
529 iput(sdp->sd_master_dir);
534 static int init_per_node(struct gfs2_sbd *sdp, int undo)
536 struct inode *pn = NULL;
539 struct gfs2_inode *ip;
541 if (sdp->sd_args.ar_spectator)
547 pn = gfs2_lookup_simple(sdp->sd_master_dir, "per_node");
550 fs_err(sdp, "can't find per_node directory: %d\n", error);
554 sprintf(buf, "inum_range%u", sdp->sd_jdesc->jd_jid);
555 sdp->sd_ir_inode = gfs2_lookup_simple(pn, buf);
556 if (IS_ERR(sdp->sd_ir_inode)) {
557 error = PTR_ERR(sdp->sd_ir_inode);
558 fs_err(sdp, "can't find local \"ir\" file: %d\n", error);
562 sprintf(buf, "statfs_change%u", sdp->sd_jdesc->jd_jid);
563 sdp->sd_sc_inode = gfs2_lookup_simple(pn, buf);
564 if (IS_ERR(sdp->sd_sc_inode)) {
565 error = PTR_ERR(sdp->sd_sc_inode);
566 fs_err(sdp, "can't find local \"sc\" file: %d\n", error);
570 sprintf(buf, "quota_change%u", sdp->sd_jdesc->jd_jid);
571 sdp->sd_qc_inode = gfs2_lookup_simple(pn, buf);
572 if (IS_ERR(sdp->sd_qc_inode)) {
573 error = PTR_ERR(sdp->sd_qc_inode);
574 fs_err(sdp, "can't find local \"qc\" file: %d\n", error);
581 ip = GFS2_I(sdp->sd_ir_inode);
582 error = gfs2_glock_nq_init(ip->i_gl,
586 fs_err(sdp, "can't lock local \"ir\" file: %d\n", error);
590 ip = GFS2_I(sdp->sd_sc_inode);
591 error = gfs2_glock_nq_init(ip->i_gl,
595 fs_err(sdp, "can't lock local \"sc\" file: %d\n", error);
599 ip = GFS2_I(sdp->sd_qc_inode);
600 error = gfs2_glock_nq_init(ip->i_gl,
604 fs_err(sdp, "can't lock local \"qc\" file: %d\n", error);
611 gfs2_glock_dq_uninit(&sdp->sd_qc_gh);
613 gfs2_glock_dq_uninit(&sdp->sd_sc_gh);
615 gfs2_glock_dq_uninit(&sdp->sd_ir_gh);
617 iput(sdp->sd_qc_inode);
619 iput(sdp->sd_sc_inode);
621 iput(sdp->sd_ir_inode);
628 static int init_threads(struct gfs2_sbd *sdp, int undo)
630 struct task_struct *p;
636 sdp->sd_log_flush_time = jiffies;
637 sdp->sd_jindex_refresh_time = jiffies;
639 p = kthread_run(gfs2_logd, sdp, "gfs2_logd");
642 fs_err(sdp, "can't start logd thread: %d\n", error);
645 sdp->sd_logd_process = p;
647 sdp->sd_statfs_sync_time = jiffies;
648 sdp->sd_quota_sync_time = jiffies;
650 p = kthread_run(gfs2_quotad, sdp, "gfs2_quotad");
653 fs_err(sdp, "can't start quotad thread: %d\n", error);
656 sdp->sd_quotad_process = p;
662 kthread_stop(sdp->sd_quotad_process);
664 kthread_stop(sdp->sd_logd_process);
669 * fill_super - Read in superblock
670 * @sb: The VFS superblock
671 * @data: Mount options
672 * @silent: Don't complain if it's not a GFS2 filesystem
677 static int fill_super(struct super_block *sb, void *data, int silent)
679 struct gfs2_sbd *sdp;
680 struct gfs2_holder mount_gh;
685 printk(KERN_WARNING "GFS2: can't alloc struct gfs2_sbd\n");
689 error = gfs2_mount_args(sdp, (char *)data, 0);
691 printk(KERN_WARNING "GFS2: can't parse mount arguments\n");
695 init_vfs(sb, SDF_NOATIME);
697 /* Set up the buffer cache and fill in some fake block size values
698 to allow us to read-in the on-disk superblock. */
699 sdp->sd_sb.sb_bsize = sb_min_blocksize(sb, GFS2_BASIC_BLOCK);
700 sdp->sd_sb.sb_bsize_shift = sb->s_blocksize_bits;
701 sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift -
702 GFS2_BASIC_BLOCK_SHIFT;
703 sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
705 error = init_names(sdp, silent);
709 error = gfs2_sys_fs_add(sdp);
713 error = gfs2_lm_mount(sdp, silent);
717 error = init_locking(sdp, &mount_gh, DO);
721 error = init_sb(sdp, silent, DO);
725 error = init_inodes(sdp, DO);
729 error = init_per_node(sdp, DO);
733 error = gfs2_statfs_init(sdp);
735 fs_err(sdp, "can't initialize statfs subsystem: %d\n", error);
739 error = init_threads(sdp, DO);
743 if (!(sb->s_flags & MS_RDONLY)) {
744 error = gfs2_make_fs_rw(sdp);
746 fs_err(sdp, "can't make FS RW: %d\n", error);
751 gfs2_glock_dq_uninit(&mount_gh);
756 init_threads(sdp, UNDO);
758 init_per_node(sdp, UNDO);
760 init_inodes(sdp, UNDO);
762 init_sb(sdp, 0, UNDO);
764 init_locking(sdp, &mount_gh, UNDO);
766 gfs2_gl_hash_clear(sdp, WAIT);
767 gfs2_lm_unmount(sdp);
768 while (invalidate_inodes(sb))
771 gfs2_sys_fs_del(sdp);
774 sb->s_fs_info = NULL;
778 static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
779 const char *dev_name, void *data, struct vfsmount *mnt)
781 struct super_block *sb;
782 struct gfs2_sbd *sdp;
783 int error = get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt);
788 sdp->sd_gfs2mnt = mnt;
793 static int fill_super_meta(struct super_block *sb, struct super_block *new,
794 void *data, int silent)
796 struct gfs2_sbd *sdp = sb->s_fs_info;
800 new->s_fs_info = sdp;
801 sdp->sd_vfs_meta = sb;
803 init_vfs(new, SDF_NOATIME);
805 /* Get the master inode */
806 inode = igrab(sdp->sd_master_dir);
808 new->s_root = d_alloc_root(inode);
810 fs_err(sdp, "can't get root dentry\n");
814 new->s_root->d_op = &gfs2_dops;
819 static int set_bdev_super(struct super_block *s, void *data)
822 s->s_dev = s->s_bdev->bd_dev;
826 static int test_bdev_super(struct super_block *s, void *data)
828 return s->s_bdev == data;
831 static struct super_block* get_gfs2_sb(const char *dev_name)
835 struct file_system_type *fstype;
836 struct super_block *sb = NULL, *s;
840 error = path_lookup(dev_name, LOOKUP_FOLLOW, &nd);
842 printk(KERN_WARNING "GFS2: path_lookup on %s returned error\n",
846 error = vfs_getattr(nd.mnt, nd.dentry, &stat);
848 fstype = get_fs_type("gfs2");
849 list_for_each(l, &fstype->fs_supers) {
850 s = list_entry(l, struct super_block, s_instances);
851 if ((S_ISBLK(stat.mode) && s->s_dev == stat.rdev) ||
852 (S_ISDIR(stat.mode) && s == nd.dentry->d_inode->i_sb)) {
858 printk(KERN_WARNING "GFS2: Unrecognized block device or "
859 "mount point %s", dev_name);
867 static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
868 const char *dev_name, void *data, struct vfsmount *mnt)
871 struct super_block *sb = NULL, *new;
872 struct gfs2_sbd *sdp;
873 char *gfs2mnt = NULL;
875 sb = get_gfs2_sb(dev_name);
877 printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n");
881 sdp = (struct gfs2_sbd*) sb->s_fs_info;
882 if (sdp->sd_vfs_meta) {
883 printk(KERN_WARNING "GFS2: gfs2meta mount already exists\n");
887 mutex_lock(&sb->s_bdev->bd_mount_mutex);
888 new = sget(fs_type, test_bdev_super, set_bdev_super, sb->s_bdev);
889 mutex_unlock(&sb->s_bdev->bd_mount_mutex);
891 error = PTR_ERR(new);
894 module_put(fs_type->owner);
895 new->s_flags = flags;
896 strlcpy(new->s_id, sb->s_id, sizeof(new->s_id));
897 sb_set_blocksize(new, sb->s_blocksize);
898 error = fill_super_meta(sb, new, data, flags & MS_SILENT ? 1 : 0);
900 up_write(&new->s_umount);
901 deactivate_super(new);
905 new->s_flags |= MS_ACTIVE;
907 /* Grab a reference to the gfs2 mount point */
908 atomic_inc(&sdp->sd_gfs2mnt->mnt_count);
909 return simple_set_mnt(mnt, new);
916 static void gfs2_kill_sb(struct super_block *sb)
918 kill_block_super(sb);
921 static void gfs2_kill_sb_meta(struct super_block *sb)
923 struct gfs2_sbd *sdp = sb->s_fs_info;
924 generic_shutdown_super(sb);
925 sdp->sd_vfs_meta = NULL;
926 atomic_dec(&sdp->sd_gfs2mnt->mnt_count);
929 struct file_system_type gfs2_fs_type = {
931 .fs_flags = FS_REQUIRES_DEV,
932 .get_sb = gfs2_get_sb,
933 .kill_sb = gfs2_kill_sb,
934 .owner = THIS_MODULE,
937 struct file_system_type gfs2meta_fs_type = {
939 .fs_flags = FS_REQUIRES_DEV,
940 .get_sb = gfs2_get_sb_meta,
941 .kill_sb = gfs2_kill_sb_meta,
942 .owner = THIS_MODULE,