Skip to content

Commit adbb39b

Browse files
committed
nilfs2: do not allocate nilfs_mdt_info structure to gc-inodes
GC-inode now doesn't need the nilfs_mdt_info structure and there is no reason that it is a sort of metadata files. This stops the allocation and makes them not dependent on metadata file routines. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1 parent 518d1a6 commit adbb39b

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

‎fs/nilfs2/gcinode.c‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh)
168168
}
169169
nilfs_btnode_mark_dirty(bh);
170170
} else {
171-
nilfs_mdt_mark_buffer_dirty(bh);
171+
nilfs_mark_buffer_dirty(bh);
172172
}
173173
return 0;
174174
}
@@ -177,24 +177,24 @@ int nilfs_init_gcinode(struct inode *inode)
177177
{
178178
struct nilfs_inode_info *ii = NILFS_I(inode);
179179
struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
180-
int ret;
181180

182-
ret = nilfs_mdt_init(inode, nilfs, GFP_NOFS, 0);
183-
if (!ret) {
184-
inode->i_mapping->a_ops = &def_gcinode_aops;
181+
inode->i_mode = S_IFREG;
182+
mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
183+
inode->i_mapping->a_ops = &def_gcinode_aops;
184+
inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
185185

186-
ii->i_flags = 0;
187-
nilfs_bmap_init_gc(ii->i_bmap);
186+
ii->i_flags = 0;
187+
nilfs_bmap_init_gc(ii->i_bmap);
188188

189-
/*
190-
* Add the inode to GC inode list. Garbage Collection
191-
* is serialized and no two processes manipulate the
192-
* list simultaneously.
193-
*/
194-
igrab(inode);
195-
list_add(&NILFS_I(inode)->i_dirty, &nilfs->ns_gc_inodes);
196-
}
197-
return ret;
189+
/*
190+
* Add the inode to GC inode list. Garbage Collection
191+
* is serialized and no two processes manipulate the
192+
* list simultaneously.
193+
*/
194+
igrab(inode);
195+
list_add(&NILFS_I(inode)->i_dirty, &nilfs->ns_gc_inodes);
196+
197+
return 0;
198198
}
199199

200200
/**

0 commit comments

Comments
 (0)