aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-30 10:13:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:36 -0500
commit740da42efa24ac00dfb40d2f02d9d7f7a485049b (patch)
treeae71dfa023025a8247c4615439383fbbdbf4720c /fs/dcache.c
parent54c807e71d5ac59dee56c685f2b66e27cd54c475 (diff)
__d_materialise_unique() is too generic
Its first argument is always non-root, while the second one is always root. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 0e4b5fa6c9f9..ada6123414ae 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2394,7 +2394,7 @@ out_err:
2394 */ 2394 */
2395static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) 2395static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
2396{ 2396{
2397 struct dentry *dparent, *aparent; 2397 struct dentry *dparent;
2398 2398
2399 dentry_lock_for_move(anon, dentry); 2399 dentry_lock_for_move(anon, dentry);
2400 2400
@@ -2402,24 +2402,15 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
2402 write_seqcount_begin(&anon->d_seq); 2402 write_seqcount_begin(&anon->d_seq);
2403 2403
2404 dparent = dentry->d_parent; 2404 dparent = dentry->d_parent;
2405 aparent = anon->d_parent;
2406 2405
2407 switch_names(dentry, anon); 2406 switch_names(dentry, anon);
2408 swap(dentry->d_name.hash, anon->d_name.hash); 2407 swap(dentry->d_name.hash, anon->d_name.hash);
2409 2408
2410 dentry->d_parent = (aparent == anon) ? dentry : aparent; 2409 dentry->d_parent = dentry;
2411 list_del(&dentry->d_u.d_child); 2410 list_del_init(&dentry->d_u.d_child);
2412 if (!IS_ROOT(dentry)) 2411 anon->d_parent = dparent;
2413 list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
2414 else
2415 INIT_LIST_HEAD(&dentry->d_u.d_child);
2416
2417 anon->d_parent = (dparent == dentry) ? anon : dparent;
2418 list_del(&anon->d_u.d_child); 2412 list_del(&anon->d_u.d_child);
2419 if (!IS_ROOT(anon)) 2413 list_add(&anon->d_u.d_child, &dparent->d_subdirs);
2420 list_add(&anon->d_u.d_child, &anon->d_parent->d_subdirs);
2421 else
2422 INIT_LIST_HEAD(&anon->d_u.d_child);
2423 2414
2424 write_seqcount_end(&dentry->d_seq); 2415 write_seqcount_end(&dentry->d_seq);
2425 write_seqcount_end(&anon->d_seq); 2416 write_seqcount_end(&anon->d_seq);