diff options
-rw-r--r-- | fs/f2fs/dir.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index ca7948a2770d..208a804180d6 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c | |||
@@ -281,13 +281,12 @@ void init_dent_inode(const struct qstr *name, struct page *ipage) | |||
281 | set_page_dirty(ipage); | 281 | set_page_dirty(ipage); |
282 | } | 282 | } |
283 | 283 | ||
284 | static int init_inode_metadata(struct inode *inode, struct dentry *dentry) | 284 | static int init_inode_metadata(struct inode *inode, |
285 | struct inode *dir, const struct qstr *name) | ||
285 | { | 286 | { |
286 | struct inode *dir = dentry->d_parent->d_inode; | ||
287 | |||
288 | if (is_inode_flag_set(F2FS_I(inode), FI_NEW_INODE)) { | 287 | if (is_inode_flag_set(F2FS_I(inode), FI_NEW_INODE)) { |
289 | int err; | 288 | int err; |
290 | err = new_inode_page(inode, &dentry->d_name); | 289 | err = new_inode_page(inode, name); |
291 | if (err) | 290 | if (err) |
292 | return err; | 291 | return err; |
293 | 292 | ||
@@ -310,7 +309,7 @@ static int init_inode_metadata(struct inode *inode, struct dentry *dentry) | |||
310 | if (IS_ERR(ipage)) | 309 | if (IS_ERR(ipage)) |
311 | return PTR_ERR(ipage); | 310 | return PTR_ERR(ipage); |
312 | set_cold_node(inode, ipage); | 311 | set_cold_node(inode, ipage); |
313 | init_dent_inode(&dentry->d_name, ipage); | 312 | init_dent_inode(name, ipage); |
314 | f2fs_put_page(ipage, 1); | 313 | f2fs_put_page(ipage, 1); |
315 | } | 314 | } |
316 | if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) { | 315 | if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) { |
@@ -433,7 +432,7 @@ start: | |||
433 | ++level; | 432 | ++level; |
434 | goto start; | 433 | goto start; |
435 | add_dentry: | 434 | add_dentry: |
436 | err = init_inode_metadata(inode, dentry); | 435 | err = init_inode_metadata(inode, dir, &dentry->d_name); |
437 | if (err) | 436 | if (err) |
438 | goto fail; | 437 | goto fail; |
439 | 438 | ||