Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347550
b: refs/heads/master
c: 6666e6a
h: refs/heads/master
v: v3
  • Loading branch information
Jaegeuk Kim committed Dec 11, 2012
1 parent f479f87 commit 3abd9f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cd8a23948b29301f8f67b8d70c5c18fabbc05e1
refs/heads/master: 6666e6aa9f36b2bfd6b30072c07b34f2a24becf1
10 changes: 8 additions & 2 deletions trunk/fs/f2fs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,16 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
set_page_dirty(page);
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
mark_inode_dirty(dir);

/* update parent inode number before releasing dentry page */
F2FS_I(inode)->i_pino = dir->i_ino;

f2fs_put_page(page, 1);
mutex_unlock_op(sbi, DENTRY_OPS);
}

void init_dent_inode(struct dentry *dentry, struct page *ipage)
{
struct inode *dir = dentry->d_parent->d_inode;
struct f2fs_node *rn;

if (IS_ERR(ipage))
Expand All @@ -272,7 +275,6 @@ void init_dent_inode(struct dentry *dentry, struct page *ipage)

/* copy dentry info. to this inode page */
rn = (struct f2fs_node *)page_address(ipage);
rn->i.i_pino = cpu_to_le32(dir->i_ino);
rn->i.i_namelen = cpu_to_le32(dentry->d_name.len);
memcpy(rn->i.i_name, dentry->d_name.name, dentry->d_name.len);
set_page_dirty(ipage);
Expand Down Expand Up @@ -444,7 +446,11 @@ int f2fs_add_link(struct dentry *dentry, struct inode *inode)
for (i = 0; i < slots; i++)
test_and_set_bit_le(bit_pos + i, &dentry_blk->dentry_bitmap);
set_page_dirty(dentry_page);

update_parent_metadata(dir, inode, current_depth);

/* update parent inode number before releasing dentry page */
F2FS_I(inode)->i_pino = dir->i_ino;
fail:
kunmap(dentry_page);
f2fs_put_page(dentry_page, 1);
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ struct f2fs_inode_info {
unsigned long i_flags; /* keep an inode flags for ioctl */
unsigned char i_advise; /* use to give file attribute hints */
unsigned int i_current_depth; /* use only in directory structure */
unsigned int i_pino; /* parent inode number */
umode_t i_acl_mode; /* keep file acl mode temporarily */

/* Use below internally in f2fs*/
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/f2fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static int do_read_inode(struct inode *inode)
fi->flags = 0;
fi->data_version = le64_to_cpu(F2FS_CKPT(sbi)->checkpoint_ver) - 1;
fi->i_advise = ri->i_advise;
fi->i_pino = le32_to_cpu(ri->i_pino);
get_extent_info(&fi->ext, ri->i_ext);
f2fs_put_page(node_page, 1);
return 0;
Expand Down Expand Up @@ -200,6 +201,7 @@ void update_inode(struct inode *inode, struct page *node_page)
ri->i_current_depth = cpu_to_le32(F2FS_I(inode)->i_current_depth);
ri->i_xattr_nid = cpu_to_le32(F2FS_I(inode)->i_xattr_nid);
ri->i_flags = cpu_to_le32(F2FS_I(inode)->i_flags);
ri->i_pino = cpu_to_le32(F2FS_I(inode)->i_pino);
ri->i_generation = cpu_to_le32(inode->i_generation);
set_page_dirty(node_page);
}
Expand Down

0 comments on commit 3abd9f0

Please sign in to comment.