^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/completion.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/buffer_head.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/gfs2_ondisk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/rcupdate.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/rculist_bl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/mempool.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include "gfs2.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include "incore.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include "super.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include "sys.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include "util.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include "glock.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include "quota.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include "recovery.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include "dir.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include "glops.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct workqueue_struct *gfs2_control_wq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) static void gfs2_init_inode_once(void *foo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct gfs2_inode *ip = foo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) inode_init_once(&ip->i_inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) atomic_set(&ip->i_sizehint, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) init_rwsem(&ip->i_rw_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) INIT_LIST_HEAD(&ip->i_trunc_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) INIT_LIST_HEAD(&ip->i_ordered);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ip->i_qadata = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) gfs2_holder_mark_uninitialized(&ip->i_rgd_gh);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) memset(&ip->i_res, 0, sizeof(ip->i_res));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) RB_CLEAR_NODE(&ip->i_res.rs_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ip->i_hash_cache = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) gfs2_holder_mark_uninitialized(&ip->i_iopen_gh);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) static void gfs2_init_glock_once(void *foo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct gfs2_glock *gl = foo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) spin_lock_init(&gl->gl_lockref.lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) INIT_LIST_HEAD(&gl->gl_holders);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) INIT_LIST_HEAD(&gl->gl_lru);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) INIT_LIST_HEAD(&gl->gl_ail_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) atomic_set(&gl->gl_ail_count, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) atomic_set(&gl->gl_revokes, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) static void gfs2_init_gl_aspace_once(void *foo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) struct gfs2_glock *gl = foo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct address_space *mapping = (struct address_space *)(gl + 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) gfs2_init_glock_once(gl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) address_space_init_once(mapping);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) * init_gfs2_fs - Register GFS2 as a filesystem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * Returns: 0 on success, error code on failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) static int __init init_gfs2_fs(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) int error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) gfs2_str2qstr(&gfs2_qdot, ".");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) gfs2_str2qstr(&gfs2_qdotdot, "..");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) gfs2_quota_hash_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) error = gfs2_sys_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) error = list_lru_init(&gfs2_qd_lru);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) goto fail_lru;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) error = gfs2_glock_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) goto fail_glock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) error = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) gfs2_glock_cachep = kmem_cache_create("gfs2_glock",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) sizeof(struct gfs2_glock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 0, 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) gfs2_init_glock_once);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) if (!gfs2_glock_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) goto fail_cachep1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) gfs2_glock_aspace_cachep = kmem_cache_create("gfs2_glock(aspace)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) sizeof(struct gfs2_glock) +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) sizeof(struct address_space),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 0, 0, gfs2_init_gl_aspace_once);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) if (!gfs2_glock_aspace_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) goto fail_cachep2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) gfs2_inode_cachep = kmem_cache_create("gfs2_inode",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) sizeof(struct gfs2_inode),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 0, SLAB_RECLAIM_ACCOUNT|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) SLAB_MEM_SPREAD|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) SLAB_ACCOUNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) gfs2_init_inode_once);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) if (!gfs2_inode_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) goto fail_cachep3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) gfs2_bufdata_cachep = kmem_cache_create("gfs2_bufdata",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) sizeof(struct gfs2_bufdata),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 0, 0, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) if (!gfs2_bufdata_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) goto fail_cachep4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) gfs2_rgrpd_cachep = kmem_cache_create("gfs2_rgrpd",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) sizeof(struct gfs2_rgrpd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 0, 0, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) if (!gfs2_rgrpd_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) goto fail_cachep5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) gfs2_quotad_cachep = kmem_cache_create("gfs2_quotad",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) sizeof(struct gfs2_quota_data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 0, 0, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) if (!gfs2_quotad_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) goto fail_cachep6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) gfs2_qadata_cachep = kmem_cache_create("gfs2_qadata",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) sizeof(struct gfs2_qadata),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 0, 0, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) if (!gfs2_qadata_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) goto fail_cachep7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) gfs2_trans_cachep = kmem_cache_create("gfs2_trans",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) sizeof(struct gfs2_trans),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 0, 0, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) if (!gfs2_trans_cachep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) goto fail_cachep8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) error = register_shrinker(&gfs2_qd_shrinker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) goto fail_shrinker;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) error = register_filesystem(&gfs2_fs_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) goto fail_fs1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) error = register_filesystem(&gfs2meta_fs_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) goto fail_fs2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) error = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) gfs_recovery_wq = alloc_workqueue("gfs_recovery",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) WQ_MEM_RECLAIM | WQ_FREEZABLE, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) if (!gfs_recovery_wq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) goto fail_wq1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) gfs2_control_wq = alloc_workqueue("gfs2_control",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) WQ_UNBOUND | WQ_FREEZABLE, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) if (!gfs2_control_wq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) goto fail_wq2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) gfs2_freeze_wq = alloc_workqueue("freeze_workqueue", 0, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) if (!gfs2_freeze_wq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) goto fail_wq3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) gfs2_page_pool = mempool_create_page_pool(64, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) if (!gfs2_page_pool)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) goto fail_mempool;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) gfs2_register_debugfs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) pr_info("GFS2 installed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) fail_mempool:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) destroy_workqueue(gfs2_freeze_wq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) fail_wq3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) destroy_workqueue(gfs2_control_wq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) fail_wq2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) destroy_workqueue(gfs_recovery_wq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) fail_wq1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) unregister_filesystem(&gfs2meta_fs_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) fail_fs2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) unregister_filesystem(&gfs2_fs_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) fail_fs1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) unregister_shrinker(&gfs2_qd_shrinker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) fail_shrinker:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) kmem_cache_destroy(gfs2_trans_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) fail_cachep8:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) kmem_cache_destroy(gfs2_qadata_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) fail_cachep7:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) kmem_cache_destroy(gfs2_quotad_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) fail_cachep6:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) kmem_cache_destroy(gfs2_rgrpd_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) fail_cachep5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) kmem_cache_destroy(gfs2_bufdata_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) fail_cachep4:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) kmem_cache_destroy(gfs2_inode_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) fail_cachep3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) kmem_cache_destroy(gfs2_glock_aspace_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) fail_cachep2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) kmem_cache_destroy(gfs2_glock_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) fail_cachep1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) gfs2_glock_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) fail_glock:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) list_lru_destroy(&gfs2_qd_lru);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) fail_lru:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) gfs2_sys_uninit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) * exit_gfs2_fs - Unregister the file system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) static void __exit exit_gfs2_fs(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) unregister_shrinker(&gfs2_qd_shrinker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) gfs2_glock_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) gfs2_unregister_debugfs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) unregister_filesystem(&gfs2_fs_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) unregister_filesystem(&gfs2meta_fs_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) destroy_workqueue(gfs_recovery_wq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) destroy_workqueue(gfs2_control_wq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) destroy_workqueue(gfs2_freeze_wq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) list_lru_destroy(&gfs2_qd_lru);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) rcu_barrier();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) mempool_destroy(gfs2_page_pool);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) kmem_cache_destroy(gfs2_trans_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) kmem_cache_destroy(gfs2_qadata_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) kmem_cache_destroy(gfs2_quotad_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) kmem_cache_destroy(gfs2_rgrpd_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) kmem_cache_destroy(gfs2_bufdata_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) kmem_cache_destroy(gfs2_inode_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) kmem_cache_destroy(gfs2_glock_aspace_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) kmem_cache_destroy(gfs2_glock_cachep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) gfs2_sys_uninit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) MODULE_DESCRIPTION("Global File System");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) MODULE_AUTHOR("Red Hat, Inc.");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) module_init(init_gfs2_fs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) module_exit(exit_gfs2_fs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)