diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-25 16:01:21 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-08 02:55:03 -0500 |
commit | 53dc9a67769d0a9733adb5156adfc07edcbc1ea3 (patch) | |
tree | 2ef179022f98e0818492b85c339978c51319d951 /fs/f2fs | |
parent | 3a142ed962958d3063f648738a3384ab90017100 (diff) |
f2fs: init_dent_inode() should take qstr
for one thing, it doesn't (and shouldn't) use anything else from dentry;
for another, on some call chains the dentry is fake and should
be eliminated completely.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/dir.c | 10 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 2 | ||||
-rw-r--r-- | fs/f2fs/node.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 951ed52748f6..51332291b4bd 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c | |||
@@ -265,7 +265,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de, | |||
265 | mutex_unlock_op(sbi, DENTRY_OPS); | 265 | mutex_unlock_op(sbi, DENTRY_OPS); |
266 | } | 266 | } |
267 | 267 | ||
268 | void init_dent_inode(struct dentry *dentry, struct page *ipage) | 268 | void init_dent_inode(const struct qstr *name, struct page *ipage) |
269 | { | 269 | { |
270 | struct f2fs_node *rn; | 270 | struct f2fs_node *rn; |
271 | 271 | ||
@@ -274,10 +274,10 @@ void init_dent_inode(struct dentry *dentry, struct page *ipage) | |||
274 | 274 | ||
275 | wait_on_page_writeback(ipage); | 275 | wait_on_page_writeback(ipage); |
276 | 276 | ||
277 | /* copy dentry info. to this inode page */ | 277 | /* copy name info. to this inode page */ |
278 | rn = (struct f2fs_node *)page_address(ipage); | 278 | rn = (struct f2fs_node *)page_address(ipage); |
279 | rn->i.i_namelen = cpu_to_le32(dentry->d_name.len); | 279 | rn->i.i_namelen = cpu_to_le32(name->len); |
280 | memcpy(rn->i.i_name, dentry->d_name.name, dentry->d_name.len); | 280 | memcpy(rn->i.i_name, name->name, name->len); |
281 | set_page_dirty(ipage); | 281 | set_page_dirty(ipage); |
282 | } | 282 | } |
283 | 283 | ||
@@ -310,7 +310,7 @@ static int init_inode_metadata(struct inode *inode, struct dentry *dentry) | |||
310 | if (IS_ERR(ipage)) | 310 | if (IS_ERR(ipage)) |
311 | return PTR_ERR(ipage); | 311 | return PTR_ERR(ipage); |
312 | set_cold_node(inode, ipage); | 312 | set_cold_node(inode, ipage); |
313 | init_dent_inode(dentry, ipage); | 313 | init_dent_inode(&dentry->d_name, ipage); |
314 | f2fs_put_page(ipage, 1); | 314 | f2fs_put_page(ipage, 1); |
315 | } | 315 | } |
316 | if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) { | 316 | if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) { |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 13c6dfbb7183..732862596311 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -867,7 +867,7 @@ struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **); | |||
867 | ino_t f2fs_inode_by_name(struct inode *, struct qstr *); | 867 | ino_t f2fs_inode_by_name(struct inode *, struct qstr *); |
868 | void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, | 868 | void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, |
869 | struct page *, struct inode *); | 869 | struct page *, struct inode *); |
870 | void init_dent_inode(struct dentry *, struct page *); | 870 | void init_dent_inode(const struct qstr *, struct page *); |
871 | int f2fs_add_link(struct dentry *, struct inode *); | 871 | int f2fs_add_link(struct dentry *, struct inode *); |
872 | void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *); | 872 | void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *); |
873 | int f2fs_make_empty(struct inode *, struct inode *); | 873 | int f2fs_make_empty(struct inode *, struct inode *); |
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 5066bfd256c9..5caa94676f60 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c | |||
@@ -790,7 +790,7 @@ int new_inode_page(struct inode *inode, struct dentry *dentry) | |||
790 | set_new_dnode(&dn, inode, NULL, NULL, inode->i_ino); | 790 | set_new_dnode(&dn, inode, NULL, NULL, inode->i_ino); |
791 | mutex_lock_op(sbi, NODE_NEW); | 791 | mutex_lock_op(sbi, NODE_NEW); |
792 | page = new_node_page(&dn, 0); | 792 | page = new_node_page(&dn, 0); |
793 | init_dent_inode(dentry, page); | 793 | init_dent_inode(&dentry->d_name, page); |
794 | mutex_unlock_op(sbi, NODE_NEW); | 794 | mutex_unlock_op(sbi, NODE_NEW); |
795 | if (IS_ERR(page)) | 795 | if (IS_ERR(page)) |
796 | return PTR_ERR(page); | 796 | return PTR_ERR(page); |