diff options
| -rw-r--r-- | fs/nilfs2/btnode.c | 5 | ||||
| -rw-r--r-- | fs/nilfs2/btnode.h | 2 | ||||
| -rw-r--r-- | fs/nilfs2/mdt.c | 2 | ||||
| -rw-r--r-- | fs/nilfs2/nilfs.h | 1 | ||||
| -rw-r--r-- | fs/nilfs2/super.c | 9 |
5 files changed, 13 insertions, 6 deletions
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index 4cc07b2c30e0..0e01957ce566 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c | |||
| @@ -48,13 +48,14 @@ void nilfs_btnode_cache_init_once(struct address_space *btnc) | |||
| 48 | 48 | ||
| 49 | static struct address_space_operations def_btnode_aops; | 49 | static struct address_space_operations def_btnode_aops; |
| 50 | 50 | ||
| 51 | void nilfs_btnode_cache_init(struct address_space *btnc) | 51 | void nilfs_btnode_cache_init(struct address_space *btnc, |
| 52 | struct backing_dev_info *bdi) | ||
| 52 | { | 53 | { |
| 53 | btnc->host = NULL; /* can safely set to host inode ? */ | 54 | btnc->host = NULL; /* can safely set to host inode ? */ |
| 54 | btnc->flags = 0; | 55 | btnc->flags = 0; |
| 55 | mapping_set_gfp_mask(btnc, GFP_NOFS); | 56 | mapping_set_gfp_mask(btnc, GFP_NOFS); |
| 56 | btnc->assoc_mapping = NULL; | 57 | btnc->assoc_mapping = NULL; |
| 57 | btnc->backing_dev_info = &default_backing_dev_info; | 58 | btnc->backing_dev_info = bdi; |
| 58 | btnc->a_ops = &def_btnode_aops; | 59 | btnc->a_ops = &def_btnode_aops; |
| 59 | } | 60 | } |
| 60 | 61 | ||
diff --git a/fs/nilfs2/btnode.h b/fs/nilfs2/btnode.h index 35faa86444a7..3e2275172ed6 100644 --- a/fs/nilfs2/btnode.h +++ b/fs/nilfs2/btnode.h | |||
| @@ -38,7 +38,7 @@ struct nilfs_btnode_chkey_ctxt { | |||
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | void nilfs_btnode_cache_init_once(struct address_space *); | 40 | void nilfs_btnode_cache_init_once(struct address_space *); |
| 41 | void nilfs_btnode_cache_init(struct address_space *); | 41 | void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); |
| 42 | void nilfs_btnode_cache_clear(struct address_space *); | 42 | void nilfs_btnode_cache_clear(struct address_space *); |
| 43 | int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, | 43 | int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, |
| 44 | struct buffer_head **, int); | 44 | struct buffer_head **, int); |
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index bb78745a0e30..7b7032ea60d3 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
| @@ -449,7 +449,7 @@ struct inode * | |||
| 449 | nilfs_mdt_new_common(struct the_nilfs *nilfs, struct super_block *sb, | 449 | nilfs_mdt_new_common(struct the_nilfs *nilfs, struct super_block *sb, |
| 450 | ino_t ino, gfp_t gfp_mask) | 450 | ino_t ino, gfp_t gfp_mask) |
| 451 | { | 451 | { |
| 452 | struct inode *inode = nilfs_alloc_inode(sb); | 452 | struct inode *inode = nilfs_alloc_inode_common(nilfs); |
| 453 | 453 | ||
| 454 | if (!inode) | 454 | if (!inode) |
| 455 | return NULL; | 455 | return NULL; |
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index da6fc0bba2e5..edf6a59d9f2a 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
| @@ -263,6 +263,7 @@ extern void nilfs_dirty_inode(struct inode *); | |||
| 263 | extern struct dentry *nilfs_get_parent(struct dentry *); | 263 | extern struct dentry *nilfs_get_parent(struct dentry *); |
| 264 | 264 | ||
| 265 | /* super.c */ | 265 | /* super.c */ |
| 266 | extern struct inode *nilfs_alloc_inode_common(struct the_nilfs *); | ||
| 266 | extern struct inode *nilfs_alloc_inode(struct super_block *); | 267 | extern struct inode *nilfs_alloc_inode(struct super_block *); |
| 267 | extern void nilfs_destroy_inode(struct inode *); | 268 | extern void nilfs_destroy_inode(struct inode *); |
| 268 | extern void nilfs_error(struct super_block *, const char *, const char *, ...) | 269 | extern void nilfs_error(struct super_block *, const char *, const char *, ...) |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 6989b03e97ab..9acf30b60600 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
| @@ -134,7 +134,7 @@ void nilfs_warning(struct super_block *sb, const char *function, | |||
| 134 | 134 | ||
| 135 | static struct kmem_cache *nilfs_inode_cachep; | 135 | static struct kmem_cache *nilfs_inode_cachep; |
| 136 | 136 | ||
| 137 | struct inode *nilfs_alloc_inode(struct super_block *sb) | 137 | struct inode *nilfs_alloc_inode_common(struct the_nilfs *nilfs) |
| 138 | { | 138 | { |
| 139 | struct nilfs_inode_info *ii; | 139 | struct nilfs_inode_info *ii; |
| 140 | 140 | ||
| @@ -144,10 +144,15 @@ struct inode *nilfs_alloc_inode(struct super_block *sb) | |||
| 144 | ii->i_bh = NULL; | 144 | ii->i_bh = NULL; |
| 145 | ii->i_state = 0; | 145 | ii->i_state = 0; |
| 146 | ii->vfs_inode.i_version = 1; | 146 | ii->vfs_inode.i_version = 1; |
| 147 | nilfs_btnode_cache_init(&ii->i_btnode_cache); | 147 | nilfs_btnode_cache_init(&ii->i_btnode_cache, nilfs->ns_bdi); |
| 148 | return &ii->vfs_inode; | 148 | return &ii->vfs_inode; |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | struct inode *nilfs_alloc_inode(struct super_block *sb) | ||
| 152 | { | ||
| 153 | return nilfs_alloc_inode_common(NILFS_SB(sb)->s_nilfs); | ||
| 154 | } | ||
| 155 | |||
| 151 | void nilfs_destroy_inode(struct inode *inode) | 156 | void nilfs_destroy_inode(struct inode *inode) |
| 152 | { | 157 | { |
| 153 | kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode)); | 158 | kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode)); |
