Merge branches '3m', 'egalax', 'logitech', 'magicmouse', 'ntrig' and 'roccat' into...
[pandora-kernel.git] / fs / nilfs2 / btnode.c
index f78ab10..5115814 100644 (file)
 
 void nilfs_btnode_cache_init_once(struct address_space *btnc)
 {
-       memset(btnc, 0, sizeof(*btnc));
-       INIT_RADIX_TREE(&btnc->page_tree, GFP_ATOMIC);
-       spin_lock_init(&btnc->tree_lock);
-       INIT_LIST_HEAD(&btnc->private_list);
-       spin_lock_init(&btnc->private_lock);
-
-       spin_lock_init(&btnc->i_mmap_lock);
-       INIT_RAW_PRIO_TREE_ROOT(&btnc->i_mmap);
-       INIT_LIST_HEAD(&btnc->i_mmap_nonlinear);
+       nilfs_mapping_init_once(btnc);
 }
 
 static const struct address_space_operations def_btnode_aops = {
@@ -55,12 +47,7 @@ static const struct address_space_operations def_btnode_aops = {
 void nilfs_btnode_cache_init(struct address_space *btnc,
                             struct backing_dev_info *bdi)
 {
-       btnc->host = NULL;  /* can safely set to host inode ? */
-       btnc->flags = 0;
-       mapping_set_gfp_mask(btnc, GFP_NOFS);
-       btnc->assoc_mapping = NULL;
-       btnc->backing_dev_info = bdi;
-       btnc->a_ops = &def_btnode_aops;
+       nilfs_mapping_init(btnc, bdi, &def_btnode_aops);
 }
 
 void nilfs_btnode_cache_clear(struct address_space *btnc)