summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-09-26 23:11:15 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-09-26 23:11:15 -0400
commit986c01942afb8eb6cc1708e721292db23b715d4e (patch)
tree56aa01e04d3545d8a10f39865ee484cb8c7e4bd3
parent63cf427a570dd8eb66d8cfc4c2ed9367811d6d3e (diff)
downloadop-kernel-dev-986c01942afb8eb6cc1708e721292db23b715d4e.zip
op-kernel-dev-986c01942afb8eb6cc1708e721292db23b715d4e.tar.gz
fold unlocking the children into dentry_unlock_parents_for_move()
... renaming it into dentry_unlock_for_move() and making it more symmetric with dentry_lock_for_move(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/dcache.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 6e54317..92f7d76 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2442,13 +2442,14 @@ static void dentry_lock_for_move(struct dentry *dentry, struct dentry *target)
}
}
-static void dentry_unlock_parents_for_move(struct dentry *dentry,
- struct dentry *target)
+static void dentry_unlock_for_move(struct dentry *dentry, struct dentry *target)
{
if (target->d_parent != dentry->d_parent)
spin_unlock(&dentry->d_parent->d_lock);
if (target->d_parent != target)
spin_unlock(&target->d_parent->d_lock);
+ spin_unlock(&target->d_lock);
+ spin_unlock(&dentry->d_lock);
}
/*
@@ -2531,9 +2532,7 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
write_seqcount_end(&target->d_seq);
write_seqcount_end(&dentry->d_seq);
- dentry_unlock_parents_for_move(dentry, target);
- spin_unlock(&target->d_lock);
- spin_unlock(&dentry->d_lock);
+ dentry_unlock_for_move(dentry, target);
}
/*
OpenPOWER on IntegriCloud