| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
|---|
| 3 | 4 | * 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. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 39 | 36 | struct gfs2_inode *ip = foo; |
|---|
| 40 | 37 | |
|---|
| 41 | 38 | inode_init_once(&ip->i_inode); |
|---|
| 39 | + atomic_set(&ip->i_sizehint, 0); |
|---|
| 42 | 40 | init_rwsem(&ip->i_rw_mutex); |
|---|
| 43 | 41 | INIT_LIST_HEAD(&ip->i_trunc_list); |
|---|
| 42 | + INIT_LIST_HEAD(&ip->i_ordered); |
|---|
| 44 | 43 | ip->i_qadata = NULL; |
|---|
| 44 | + gfs2_holder_mark_uninitialized(&ip->i_rgd_gh); |
|---|
| 45 | 45 | memset(&ip->i_res, 0, sizeof(ip->i_res)); |
|---|
| 46 | 46 | RB_CLEAR_NODE(&ip->i_res.rs_node); |
|---|
| 47 | 47 | ip->i_hash_cache = NULL; |
|---|
| .. | .. |
|---|
| 144 | 144 | if (!gfs2_qadata_cachep) |
|---|
| 145 | 145 | goto fail_cachep7; |
|---|
| 146 | 146 | |
|---|
| 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 | + |
|---|
| 147 | 153 | error = register_shrinker(&gfs2_qd_shrinker); |
|---|
| 148 | 154 | if (error) |
|---|
| 149 | 155 | goto fail_shrinker; |
|---|
| .. | .. |
|---|
| 176 | 182 | if (!gfs2_page_pool) |
|---|
| 177 | 183 | goto fail_mempool; |
|---|
| 178 | 184 | |
|---|
| 179 | | - error = gfs2_register_debugfs(); |
|---|
| 180 | | - if (error) |
|---|
| 181 | | - goto fail_debugfs; |
|---|
| 185 | + gfs2_register_debugfs(); |
|---|
| 182 | 186 | |
|---|
| 183 | 187 | pr_info("GFS2 installed\n"); |
|---|
| 184 | 188 | |
|---|
| 185 | 189 | return 0; |
|---|
| 186 | 190 | |
|---|
| 187 | | -fail_debugfs: |
|---|
| 188 | | - mempool_destroy(gfs2_page_pool); |
|---|
| 189 | 191 | fail_mempool: |
|---|
| 190 | 192 | destroy_workqueue(gfs2_freeze_wq); |
|---|
| 191 | 193 | fail_wq3: |
|---|
| .. | .. |
|---|
| 199 | 201 | fail_fs1: |
|---|
| 200 | 202 | unregister_shrinker(&gfs2_qd_shrinker); |
|---|
| 201 | 203 | fail_shrinker: |
|---|
| 204 | + kmem_cache_destroy(gfs2_trans_cachep); |
|---|
| 205 | +fail_cachep8: |
|---|
| 202 | 206 | kmem_cache_destroy(gfs2_qadata_cachep); |
|---|
| 203 | 207 | fail_cachep7: |
|---|
| 204 | 208 | kmem_cache_destroy(gfs2_quotad_cachep); |
|---|
| .. | .. |
|---|
| 241 | 245 | rcu_barrier(); |
|---|
| 242 | 246 | |
|---|
| 243 | 247 | mempool_destroy(gfs2_page_pool); |
|---|
| 248 | + kmem_cache_destroy(gfs2_trans_cachep); |
|---|
| 244 | 249 | kmem_cache_destroy(gfs2_qadata_cachep); |
|---|
| 245 | 250 | kmem_cache_destroy(gfs2_quotad_cachep); |
|---|
| 246 | 251 | kmem_cache_destroy(gfs2_rgrpd_cachep); |
|---|
| .. | .. |
|---|
| 255 | 260 | MODULE_DESCRIPTION("Global File System"); |
|---|
| 256 | 261 | MODULE_AUTHOR("Red Hat, Inc."); |
|---|
| 257 | 262 | MODULE_LICENSE("GPL"); |
|---|
| 263 | +MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY); |
|---|
| 258 | 264 | |
|---|
| 259 | 265 | module_init(init_gfs2_fs); |
|---|
| 260 | 266 | module_exit(exit_gfs2_fs); |
|---|