diff mbox

[v2,2/2] cleanup of d_unhashed usage.

Message ID 147801245780.67124.6180063438785237544.stgit@alexeys-macbook-pro.local (mailing list archive)
State New, archived
Headers show

Commit Message

Alexey Lyashkov Nov. 1, 2016, 3:01 p.m. UTC
We don't need to hold a d_lock / d_seq locks while d_unhashed checking.
Lets do these locks less hot.

Signed-off-by: Alexey Lyashkov <alexey.lyashkov@gmail.com>
---
 fs/dcache.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/dcache.c b/fs/dcache.c
index 0863841..c23effb 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1327,12 +1327,8 @@  int d_set_mounted(struct dentry *dentry)
 	write_seqlock(&rename_lock);
 	for (p = dentry->d_parent; !IS_ROOT(p); p = p->d_parent) {
 		/* Need exclusion wrt. d_invalidate() */
-		spin_lock(&p->d_lock);
-		if (unlikely(d_unhashed(p))) {
-			spin_unlock(&p->d_lock);
+		if (unlikely(d_unhashed(p)))
 			goto out;
-		}
-		spin_unlock(&p->d_lock);
 	}
 	spin_lock(&dentry->d_lock);
 	if (!d_unlinked(dentry)) {
@@ -1510,12 +1506,8 @@  void d_invalidate(struct dentry *dentry)
 	/*
 	 * If it's already been dropped, return OK.
 	 */
-	spin_lock(&dentry->d_lock);
-	if (d_unhashed(dentry)) {
-		spin_unlock(&dentry->d_lock);
+	if (d_unhashed(dentry))
 		return;
-	}
-	spin_unlock(&dentry->d_lock);
 
 	/* Negative dentries can be dropped without further checks */
 	if (!dentry->d_inode) {