diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-14 02:44:22 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-19 20:05:50 -0500 |
commit | 49fa7a590208b439cc74f2cafdb15568abb3f8d1 (patch) | |
tree | 2e6b235dff922a0a7529c601887ff3d47e826496 | |
parent | c3ea56c80081b826df4a0ac797432179cf5b7cd2 (diff) |
nilfs2: add palloc cache to ifile
This adds the palloc cache to ifile. The palloc cache is allocated on
the extended region of nilfs_mdt_info struct. The struct
nilfs_ifile_info defines the extended on memory structure of ifile.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-rw-r--r-- | fs/nilfs2/ifile.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/nilfs2/ifile.c b/fs/nilfs2/ifile.c index c1c1fd30c315..922d9dd42c8f 100644 --- a/fs/nilfs2/ifile.c +++ b/fs/nilfs2/ifile.c | |||
@@ -29,6 +29,17 @@ | |||
29 | #include "alloc.h" | 29 | #include "alloc.h" |
30 | #include "ifile.h" | 30 | #include "ifile.h" |
31 | 31 | ||
32 | |||
33 | struct nilfs_ifile_info { | ||
34 | struct nilfs_mdt_info mi; | ||
35 | struct nilfs_palloc_cache palloc_cache; | ||
36 | }; | ||
37 | |||
38 | static inline struct nilfs_ifile_info *NILFS_IFILE_I(struct inode *ifile) | ||
39 | { | ||
40 | return (struct nilfs_ifile_info *)NILFS_MDT(ifile); | ||
41 | } | ||
42 | |||
32 | /** | 43 | /** |
33 | * nilfs_ifile_create_inode - create a new disk inode | 44 | * nilfs_ifile_create_inode - create a new disk inode |
34 | * @ifile: ifile inode | 45 | * @ifile: ifile inode |
@@ -159,13 +170,16 @@ struct inode *nilfs_ifile_new(struct nilfs_sb_info *sbi, size_t inode_size) | |||
159 | struct inode *ifile; | 170 | struct inode *ifile; |
160 | int err; | 171 | int err; |
161 | 172 | ||
162 | ifile = nilfs_mdt_new(sbi->s_nilfs, sbi->s_super, NILFS_IFILE_INO, 0); | 173 | ifile = nilfs_mdt_new(sbi->s_nilfs, sbi->s_super, NILFS_IFILE_INO, |
174 | sizeof(struct nilfs_ifile_info)); | ||
163 | if (ifile) { | 175 | if (ifile) { |
164 | err = nilfs_palloc_init_blockgroup(ifile, inode_size); | 176 | err = nilfs_palloc_init_blockgroup(ifile, inode_size); |
165 | if (unlikely(err)) { | 177 | if (unlikely(err)) { |
166 | nilfs_mdt_destroy(ifile); | 178 | nilfs_mdt_destroy(ifile); |
167 | return NULL; | 179 | return NULL; |
168 | } | 180 | } |
181 | nilfs_palloc_setup_cache(ifile, | ||
182 | &NILFS_IFILE_I(ifile)->palloc_cache); | ||
169 | } | 183 | } |
170 | return ifile; | 184 | return ifile; |
171 | } | 185 | } |