aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dcache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 22107630fc03..86afdf1376ac 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2506,8 +2506,6 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
2506 d_hash(dentry->d_parent, dentry->d_name.hash)); 2506 d_hash(dentry->d_parent, dentry->d_name.hash));
2507 } 2507 }
2508 2508
2509 list_del(&dentry->d_u.d_child);
2510 list_del(&target->d_u.d_child);
2511 2509
2512 /* Switch the names.. */ 2510 /* Switch the names.. */
2513 switch_names(dentry, target); 2511 switch_names(dentry, target);
@@ -2517,15 +2515,15 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
2517 if (IS_ROOT(dentry)) { 2515 if (IS_ROOT(dentry)) {
2518 dentry->d_parent = target->d_parent; 2516 dentry->d_parent = target->d_parent;
2519 target->d_parent = target; 2517 target->d_parent = target;
2520 INIT_LIST_HEAD(&target->d_u.d_child); 2518 list_del_init(&target->d_u.d_child);
2521 } else { 2519 } else {
2522 swap(dentry->d_parent, target->d_parent); 2520 swap(dentry->d_parent, target->d_parent);
2523 2521
2524 /* And add them back to the (new) parent lists */ 2522 /* And add them back to the (new) parent lists */
2525 list_add(&target->d_u.d_child, &target->d_parent->d_subdirs); 2523 list_move(&target->d_u.d_child, &target->d_parent->d_subdirs);
2526 } 2524 }
2527 2525
2528 list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); 2526 list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
2529 2527
2530 write_seqcount_end(&target->d_seq); 2528 write_seqcount_end(&target->d_seq);
2531 write_seqcount_end(&dentry->d_seq); 2529 write_seqcount_end(&dentry->d_seq);