hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/gfs2/main.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
34 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4
- *
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.
85 */
96
107 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -39,9 +36,12 @@
3936 struct gfs2_inode *ip = foo;
4037
4138 inode_init_once(&ip->i_inode);
39
+ atomic_set(&ip->i_sizehint, 0);
4240 init_rwsem(&ip->i_rw_mutex);
4341 INIT_LIST_HEAD(&ip->i_trunc_list);
42
+ INIT_LIST_HEAD(&ip->i_ordered);
4443 ip->i_qadata = NULL;
44
+ gfs2_holder_mark_uninitialized(&ip->i_rgd_gh);
4545 memset(&ip->i_res, 0, sizeof(ip->i_res));
4646 RB_CLEAR_NODE(&ip->i_res.rs_node);
4747 ip->i_hash_cache = NULL;
....@@ -144,6 +144,12 @@
144144 if (!gfs2_qadata_cachep)
145145 goto fail_cachep7;
146146
147
+ gfs2_trans_cachep = kmem_cache_create("gfs2_trans",
148
+ sizeof(struct gfs2_trans),
149
+ 0, 0, NULL);
150
+ if (!gfs2_trans_cachep)
151
+ goto fail_cachep8;
152
+
147153 error = register_shrinker(&gfs2_qd_shrinker);
148154 if (error)
149155 goto fail_shrinker;
....@@ -176,16 +182,12 @@
176182 if (!gfs2_page_pool)
177183 goto fail_mempool;
178184
179
- error = gfs2_register_debugfs();
180
- if (error)
181
- goto fail_debugfs;
185
+ gfs2_register_debugfs();
182186
183187 pr_info("GFS2 installed\n");
184188
185189 return 0;
186190
187
-fail_debugfs:
188
- mempool_destroy(gfs2_page_pool);
189191 fail_mempool:
190192 destroy_workqueue(gfs2_freeze_wq);
191193 fail_wq3:
....@@ -199,6 +201,8 @@
199201 fail_fs1:
200202 unregister_shrinker(&gfs2_qd_shrinker);
201203 fail_shrinker:
204
+ kmem_cache_destroy(gfs2_trans_cachep);
205
+fail_cachep8:
202206 kmem_cache_destroy(gfs2_qadata_cachep);
203207 fail_cachep7:
204208 kmem_cache_destroy(gfs2_quotad_cachep);
....@@ -241,6 +245,7 @@
241245 rcu_barrier();
242246
243247 mempool_destroy(gfs2_page_pool);
248
+ kmem_cache_destroy(gfs2_trans_cachep);
244249 kmem_cache_destroy(gfs2_qadata_cachep);
245250 kmem_cache_destroy(gfs2_quotad_cachep);
246251 kmem_cache_destroy(gfs2_rgrpd_cachep);
....@@ -255,6 +260,7 @@
255260 MODULE_DESCRIPTION("Global File System");
256261 MODULE_AUTHOR("Red Hat, Inc.");
257262 MODULE_LICENSE("GPL");
263
+MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY);
258264
259265 module_init(init_gfs2_fs);
260266 module_exit(exit_gfs2_fs);