aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/btnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/btnode.c')
-rw-r--r--fs/nilfs2/btnode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c
index 7e0b61be212e..5941958f1e47 100644
--- a/fs/nilfs2/btnode.c
+++ b/fs/nilfs2/btnode.c
@@ -36,6 +36,7 @@
36 36
37void nilfs_btnode_cache_init_once(struct address_space *btnc) 37void nilfs_btnode_cache_init_once(struct address_space *btnc)
38{ 38{
39 memset(btnc, 0, sizeof(*btnc));
39 INIT_RADIX_TREE(&btnc->page_tree, GFP_ATOMIC); 40 INIT_RADIX_TREE(&btnc->page_tree, GFP_ATOMIC);
40 spin_lock_init(&btnc->tree_lock); 41 spin_lock_init(&btnc->tree_lock);
41 INIT_LIST_HEAD(&btnc->private_list); 42 INIT_LIST_HEAD(&btnc->private_list);
@@ -46,7 +47,7 @@ void nilfs_btnode_cache_init_once(struct address_space *btnc)
46 INIT_LIST_HEAD(&btnc->i_mmap_nonlinear); 47 INIT_LIST_HEAD(&btnc->i_mmap_nonlinear);
47} 48}
48 49
49static struct address_space_operations def_btnode_aops = { 50static const struct address_space_operations def_btnode_aops = {
50 .sync_page = block_sync_page, 51 .sync_page = block_sync_page,
51}; 52};
52 53
@@ -209,6 +210,7 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
209 * We cannot call radix_tree_preload for the kernels older 210 * We cannot call radix_tree_preload for the kernels older
210 * than 2.6.23, because it is not exported for modules. 211 * than 2.6.23, because it is not exported for modules.
211 */ 212 */
213retry:
212 err = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM); 214 err = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM);
213 if (err) 215 if (err)
214 goto failed_unlock; 216 goto failed_unlock;
@@ -219,7 +221,6 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
219 (unsigned long long)oldkey, 221 (unsigned long long)oldkey,
220 (unsigned long long)newkey); 222 (unsigned long long)newkey);
221 223
222retry:
223 spin_lock_irq(&btnc->tree_lock); 224 spin_lock_irq(&btnc->tree_lock);
224 err = radix_tree_insert(&btnc->page_tree, newkey, obh->b_page); 225 err = radix_tree_insert(&btnc->page_tree, newkey, obh->b_page);
225 spin_unlock_irq(&btnc->tree_lock); 226 spin_unlock_irq(&btnc->tree_lock);