lkml.org 
[lkml]   [2014]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 6/6] autofs4: don't take spinlock when not needed in autofs4_lookup_expiring
If the expiring_list is empty, we can avoid a costly spinlock
in the rcu-walk path through authfs4_d_manage.

Signed-off-by: NeilBrown <neilb@suse.de>
---
fs/autofs4/root.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 1ad119407e2f..774c2dab331b 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -219,6 +219,8 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry,
const unsigned char *str = name->name;
struct list_head *p, *head;

+ if (list_empty(&sbi->expiring_list))
+ return NULL;
spin_lock(&sbi->lookup_lock);
head = &sbi->expiring_list;
list_for_each(p, head) {



\
 
 \ /
  Last update: 2014-07-10 02:21    [W:0.237 / U:1.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site