diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-09-04 23:20:59 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-10-22 20:24:38 -0400 |
commit | f1e89c86fdd0f5e59f6768146c86437934202033 (patch) | |
tree | c5ba8766a3a029f0c10d6d0d09a57a7e28b7a51b /fs/nilfs2/inode.c | |
parent | c1c1d7092072093ad960db2f6c08f06705c57fa4 (diff) |
nilfs2: use iget for all metadata files
This makes use of iget5_locked to allocate or get inode for metadata
files to stop using own inode allocator.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r-- | fs/nilfs2/inode.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 5485dd12da64..5b3d43fb4e12 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -506,16 +506,23 @@ static int nilfs_iget_set(struct inode *inode, void *opaque) | |||
506 | return 0; | 506 | return 0; |
507 | } | 507 | } |
508 | 508 | ||
509 | struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root, | 509 | struct inode *nilfs_iget_locked(struct super_block *sb, struct nilfs_root *root, |
510 | unsigned long ino) | 510 | unsigned long ino) |
511 | { | 511 | { |
512 | struct nilfs_iget_args args = { | 512 | struct nilfs_iget_args args = { |
513 | .ino = ino, .root = root, .cno = 0, .for_gc = 0 | 513 | .ino = ino, .root = root, .cno = 0, .for_gc = 0 |
514 | }; | 514 | }; |
515 | |||
516 | return iget5_locked(sb, ino, nilfs_iget_test, nilfs_iget_set, &args); | ||
517 | } | ||
518 | |||
519 | struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root, | ||
520 | unsigned long ino) | ||
521 | { | ||
515 | struct inode *inode; | 522 | struct inode *inode; |
516 | int err; | 523 | int err; |
517 | 524 | ||
518 | inode = iget5_locked(sb, ino, nilfs_iget_test, nilfs_iget_set, &args); | 525 | inode = nilfs_iget_locked(sb, root, ino); |
519 | if (unlikely(!inode)) | 526 | if (unlikely(!inode)) |
520 | return ERR_PTR(-ENOMEM); | 527 | return ERR_PTR(-ENOMEM); |
521 | if (!(inode->i_state & I_NEW)) | 528 | if (!(inode->i_state & I_NEW)) |