aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/inode.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-08-20 06:06:11 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-22 20:24:34 -0400
commit263d90cefc7d82a01c296c59532ff59d67c63509 (patch)
treedf289cc3bbb8681b3a42e3c0a25202b085fc9362 /fs/nilfs2/inode.c
parent5e19a995f4ad8a8f20749a396bb01ebb6d4df96c (diff)
nilfs2: remove own inode hash used for GC
This uses inode hash function that vfs provides instead of the own hash table for caching gc inodes. This finally removes the own inode hash from nilfs. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r--fs/nilfs2/inode.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 6e9df85b5824..82cfdbc43e1c 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -527,6 +527,28 @@ struct inode *nilfs_iget(struct super_block *sb, unsigned long ino)
527 return inode; 527 return inode;
528} 528}
529 529
530struct inode *nilfs_iget_for_gc(struct super_block *sb, unsigned long ino,
531 __u64 cno)
532{
533 struct nilfs_iget_args args = { .ino = ino, .cno = cno, .for_gc = 1 };
534 struct inode *inode;
535 int err;
536
537 inode = iget5_locked(sb, ino, nilfs_iget_test, nilfs_iget_set, &args);
538 if (unlikely(!inode))
539 return ERR_PTR(-ENOMEM);
540 if (!(inode->i_state & I_NEW))
541 return inode;
542
543 err = nilfs_init_gcinode(inode);
544 if (unlikely(err)) {
545 iget_failed(inode);
546 return ERR_PTR(err);
547 }
548 unlock_new_inode(inode);
549 return inode;
550}
551
530void nilfs_write_inode_common(struct inode *inode, 552void nilfs_write_inode_common(struct inode *inode,
531 struct nilfs_inode *raw_inode, int has_bmap) 553 struct nilfs_inode *raw_inode, int has_bmap)
532{ 554{