main.c (b7e56edba4b02f2079042c326a8cd72a44635817) | main.c (009d851837ab26cab18adda6169a813f70b0b21b) |
---|---|
1/* 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 3 * 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 */ --- 38 unchanged lines hidden (view full) --- 47 INIT_HLIST_NODE(&gl->gl_list); 48 spin_lock_init(&gl->gl_spin); 49 INIT_LIST_HEAD(&gl->gl_holders); 50 INIT_LIST_HEAD(&gl->gl_lru); 51 INIT_LIST_HEAD(&gl->gl_ail_list); 52 atomic_set(&gl->gl_ail_count, 0); 53} 54 | 1/* 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 3 * 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 */ --- 38 unchanged lines hidden (view full) --- 47 INIT_HLIST_NODE(&gl->gl_list); 48 spin_lock_init(&gl->gl_spin); 49 INIT_LIST_HEAD(&gl->gl_holders); 50 INIT_LIST_HEAD(&gl->gl_lru); 51 INIT_LIST_HEAD(&gl->gl_ail_list); 52 atomic_set(&gl->gl_ail_count, 0); 53} 54 |
55static void gfs2_init_gl_aspace_once(void *foo) 56{ 57 struct gfs2_glock *gl = foo; 58 struct address_space *mapping = (struct address_space *)(gl + 1); 59 60 gfs2_init_glock_once(gl); 61 memset(mapping, 0, sizeof(*mapping)); 62 INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); 63 spin_lock_init(&mapping->tree_lock); 64 spin_lock_init(&mapping->i_mmap_lock); 65 INIT_LIST_HEAD(&mapping->private_list); 66 spin_lock_init(&mapping->private_lock); 67 INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); 68 INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); 69} 70 |
|
55/** 56 * init_gfs2_fs - Register GFS2 as a filesystem 57 * 58 * Returns: 0 on success, error code on failure 59 */ 60 61static int __init init_gfs2_fs(void) 62{ --- 10 unchanged lines hidden (view full) --- 73 error = -ENOMEM; 74 gfs2_glock_cachep = kmem_cache_create("gfs2_glock", 75 sizeof(struct gfs2_glock), 76 0, 0, 77 gfs2_init_glock_once); 78 if (!gfs2_glock_cachep) 79 goto fail; 80 | 71/** 72 * init_gfs2_fs - Register GFS2 as a filesystem 73 * 74 * Returns: 0 on success, error code on failure 75 */ 76 77static int __init init_gfs2_fs(void) 78{ --- 10 unchanged lines hidden (view full) --- 89 error = -ENOMEM; 90 gfs2_glock_cachep = kmem_cache_create("gfs2_glock", 91 sizeof(struct gfs2_glock), 92 0, 0, 93 gfs2_init_glock_once); 94 if (!gfs2_glock_cachep) 95 goto fail; 96 |
97 gfs2_glock_aspace_cachep = kmem_cache_create("gfs2_glock (aspace)", 98 sizeof(struct gfs2_glock) + 99 sizeof(struct address_space), 100 0, 0, gfs2_init_gl_aspace_once); 101 102 if (!gfs2_glock_aspace_cachep) 103 goto fail; 104 |
|
81 gfs2_inode_cachep = kmem_cache_create("gfs2_inode", 82 sizeof(struct gfs2_inode), 83 0, SLAB_RECLAIM_ACCOUNT| 84 SLAB_MEM_SPREAD, 85 gfs2_init_inode_once); 86 if (!gfs2_inode_cachep) 87 goto fail; 88 --- 50 unchanged lines hidden (view full) --- 139 kmem_cache_destroy(gfs2_rgrpd_cachep); 140 141 if (gfs2_bufdata_cachep) 142 kmem_cache_destroy(gfs2_bufdata_cachep); 143 144 if (gfs2_inode_cachep) 145 kmem_cache_destroy(gfs2_inode_cachep); 146 | 105 gfs2_inode_cachep = kmem_cache_create("gfs2_inode", 106 sizeof(struct gfs2_inode), 107 0, SLAB_RECLAIM_ACCOUNT| 108 SLAB_MEM_SPREAD, 109 gfs2_init_inode_once); 110 if (!gfs2_inode_cachep) 111 goto fail; 112 --- 50 unchanged lines hidden (view full) --- 163 kmem_cache_destroy(gfs2_rgrpd_cachep); 164 165 if (gfs2_bufdata_cachep) 166 kmem_cache_destroy(gfs2_bufdata_cachep); 167 168 if (gfs2_inode_cachep) 169 kmem_cache_destroy(gfs2_inode_cachep); 170 |
171 if (gfs2_glock_aspace_cachep) 172 kmem_cache_destroy(gfs2_glock_aspace_cachep); 173 |
|
147 if (gfs2_glock_cachep) 148 kmem_cache_destroy(gfs2_glock_cachep); 149 150 gfs2_sys_uninit(); 151 return error; 152} 153 154/** --- 9 unchanged lines hidden (view full) --- 164 unregister_filesystem(&gfs2_fs_type); 165 unregister_filesystem(&gfs2meta_fs_type); 166 slow_work_unregister_user(THIS_MODULE); 167 168 kmem_cache_destroy(gfs2_quotad_cachep); 169 kmem_cache_destroy(gfs2_rgrpd_cachep); 170 kmem_cache_destroy(gfs2_bufdata_cachep); 171 kmem_cache_destroy(gfs2_inode_cachep); | 174 if (gfs2_glock_cachep) 175 kmem_cache_destroy(gfs2_glock_cachep); 176 177 gfs2_sys_uninit(); 178 return error; 179} 180 181/** --- 9 unchanged lines hidden (view full) --- 191 unregister_filesystem(&gfs2_fs_type); 192 unregister_filesystem(&gfs2meta_fs_type); 193 slow_work_unregister_user(THIS_MODULE); 194 195 kmem_cache_destroy(gfs2_quotad_cachep); 196 kmem_cache_destroy(gfs2_rgrpd_cachep); 197 kmem_cache_destroy(gfs2_bufdata_cachep); 198 kmem_cache_destroy(gfs2_inode_cachep); |
199 kmem_cache_destroy(gfs2_glock_aspace_cachep); |
|
172 kmem_cache_destroy(gfs2_glock_cachep); 173 174 gfs2_sys_uninit(); 175} 176 177MODULE_DESCRIPTION("Global File System"); 178MODULE_AUTHOR("Red Hat, Inc."); 179MODULE_LICENSE("GPL"); 180 181module_init(init_gfs2_fs); 182module_exit(exit_gfs2_fs); 183 | 200 kmem_cache_destroy(gfs2_glock_cachep); 201 202 gfs2_sys_uninit(); 203} 204 205MODULE_DESCRIPTION("Global File System"); 206MODULE_AUTHOR("Red Hat, Inc."); 207MODULE_LICENSE("GPL"); 208 209module_init(init_gfs2_fs); 210module_exit(exit_gfs2_fs); 211 |