summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/namei.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-08-25 17:45:44 +0900
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-23 09:24:34 +0900
commit4d8d9293dce503eb0e083e17a02a328d397e7f00 (patch)
treeffa2dce7f100b1346131adc01cf93e280b225509 /fs/nilfs2/namei.c
parentba65ae4729bf81c58d9fc847f67d57eec525b042 (diff)
downloadlinux-4d8d9293dce503eb0e083e17a02a328d397e7f00.tar.gz
linux-4d8d9293dce503eb0e083e17a02a328d397e7f00.tar.bz2
linux-4d8d9293dce503eb0e083e17a02a328d397e7f00.zip
nilfs2: set pointer to root object in inodes
This puts a pointer to nilfs_root object in the private part of on-memory inode, and makes nilfs_iget function pick up the inode with the same root object. Non-root inodes inherit its nilfs_root object from parent inode. That of the root inode is allocated through nilfs_attach_checkpoint() function. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/namei.c')
-rw-r--r--fs/nilfs2/namei.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index ad6ed2cf19b4..1110d56a23f5 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -70,7 +70,7 @@ nilfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
ino = nilfs_inode_by_name(dir, &dentry->d_name);
inode = NULL;
if (ino) {
- inode = nilfs_iget(dir->i_sb, ino);
+ inode = nilfs_iget(dir->i_sb, NILFS_I(dir)->i_root, ino);
if (IS_ERR(inode))
return ERR_CAST(inode);
}
@@ -87,7 +87,8 @@ struct dentry *nilfs_get_parent(struct dentry *child)
if (!ino)
return ERR_PTR(-ENOENT);
- inode = nilfs_iget(child->d_inode->i_sb, ino);
+ inode = nilfs_iget(child->d_inode->i_sb,
+ NILFS_I(child->d_inode)->i_root, ino);
if (IS_ERR(inode))
return ERR_CAST(inode);
return d_obtain_alias(inode);