Skip to content

Commit

Permalink
f2fs: switch init_inode_metadata() to passing parent and name separately
Browse files Browse the repository at this point in the history
... sure, it's tempting to just pass dentry.  Except that we don't
_have_ anything resembling a real dentry on one of the paths to it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Feb 8, 2013
1 parent c004363 commit 69f24ea
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/f2fs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,12 @@ void init_dent_inode(const struct qstr *name, struct page *ipage)
set_page_dirty(ipage);
}

static int init_inode_metadata(struct inode *inode, struct dentry *dentry)
static int init_inode_metadata(struct inode *inode,
struct inode *dir, const struct qstr *name)
{
struct inode *dir = dentry->d_parent->d_inode;

if (is_inode_flag_set(F2FS_I(inode), FI_NEW_INODE)) {
int err;
err = new_inode_page(inode, &dentry->d_name);
err = new_inode_page(inode, name);
if (err)
return err;

Expand All @@ -310,7 +309,7 @@ static int init_inode_metadata(struct inode *inode, struct dentry *dentry)
if (IS_ERR(ipage))
return PTR_ERR(ipage);
set_cold_node(inode, ipage);
init_dent_inode(&dentry->d_name, ipage);
init_dent_inode(name, ipage);
f2fs_put_page(ipage, 1);
}
if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) {
Expand Down Expand Up @@ -433,7 +432,7 @@ int f2fs_add_link(struct dentry *dentry, struct inode *inode)
++level;
goto start;
add_dentry:
err = init_inode_metadata(inode, dentry);
err = init_inode_metadata(inode, dir, &dentry->d_name);
if (err)
goto fail;

Expand Down

0 comments on commit 69f24ea

Please sign in to comment.