|
Lines 256-261
void destroy_inode(struct inode *inode)
Link Here
|
| 256 |
kmem_cache_free(inode_cachep, (inode)); |
256 |
kmem_cache_free(inode_cachep, (inode)); |
| 257 |
} |
257 |
} |
| 258 |
|
258 |
|
|
|
259 |
void address_space_init_once(struct address_space *mapping) |
| 260 |
{ |
| 261 |
memset(mapping, 0, sizeof(*mapping)); |
| 262 |
INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); |
| 263 |
spin_lock_init(&mapping->tree_lock); |
| 264 |
spin_lock_init(&mapping->i_mmap_lock); |
| 265 |
INIT_LIST_HEAD(&mapping->private_list); |
| 266 |
spin_lock_init(&mapping->private_lock); |
| 267 |
INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); |
| 268 |
INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); |
| 269 |
mutex_init(&mapping->unmap_mutex); |
| 270 |
} |
| 271 |
|
| 259 |
/* |
272 |
/* |
| 260 |
* These are initializations that only need to be done |
273 |
* These are initializations that only need to be done |
| 261 |
* once, because the fields are idempotent across use |
274 |
* once, because the fields are idempotent across use |
|
Lines 267-279
void inode_init_once(struct inode *inode
Link Here
|
| 267 |
INIT_HLIST_NODE(&inode->i_hash); |
280 |
INIT_HLIST_NODE(&inode->i_hash); |
| 268 |
INIT_LIST_HEAD(&inode->i_dentry); |
281 |
INIT_LIST_HEAD(&inode->i_dentry); |
| 269 |
INIT_LIST_HEAD(&inode->i_devices); |
282 |
INIT_LIST_HEAD(&inode->i_devices); |
| 270 |
INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC); |
283 |
address_space_init_once(&inode->i_data); |
| 271 |
spin_lock_init(&inode->i_data.tree_lock); |
|
|
| 272 |
spin_lock_init(&inode->i_data.i_mmap_lock); |
| 273 |
INIT_LIST_HEAD(&inode->i_data.private_list); |
| 274 |
spin_lock_init(&inode->i_data.private_lock); |
| 275 |
INIT_RAW_PRIO_TREE_ROOT(&inode->i_data.i_mmap); |
| 276 |
INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear); |
| 277 |
i_size_ordered_init(inode); |
284 |
i_size_ordered_init(inode); |
| 278 |
#ifdef CONFIG_INOTIFY |
285 |
#ifdef CONFIG_INOTIFY |
| 279 |
INIT_LIST_HEAD(&inode->inotify_watches); |
286 |
INIT_LIST_HEAD(&inode->inotify_watches); |