aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 01:49:41 -0500
committerNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:24 -0500
commit89ad485f01fd83c47f17a128db3bd7b89c0f244f (patch)
tree1f9772e3f0dc8ac9392341e677217caf2d9ba36c /fs/dcache.c
parent61f3dee4af09528997a970280da240577bf60721 (diff)
fs: dcache reduce locking in d_alloc
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 98a05696593e..ccdc5c2512df 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1253,11 +1253,13 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
1253 1253
1254 if (parent) { 1254 if (parent) {
1255 spin_lock(&parent->d_lock); 1255 spin_lock(&parent->d_lock);
1256 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 1256 /*
1257 * don't need child lock because it is not subject
1258 * to concurrency here
1259 */
1257 dentry->d_parent = dget_dlock(parent); 1260 dentry->d_parent = dget_dlock(parent);
1258 dentry->d_sb = parent->d_sb; 1261 dentry->d_sb = parent->d_sb;
1259 list_add(&dentry->d_u.d_child, &parent->d_subdirs); 1262 list_add(&dentry->d_u.d_child, &parent->d_subdirs);
1260 spin_unlock(&dentry->d_lock);
1261 spin_unlock(&parent->d_lock); 1263 spin_unlock(&parent->d_lock);
1262 } 1264 }
1263 1265