[PATCH v2 03/18] coda: don't take rcu_read_lock() in coda_flag_children()

NeilBrown <[email protected]>
Newsgroups org.kernel.vger.ceph-devel,org.kernel.vger.autofs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs
Message-ID <[email protected]>
From: NeilBrown <[email protected]>

As described in Documentation/RCU/whatisRCU.rst sections on
rcu_read_lock() and rcu_read_unlock(), spinlocks prevent the RCU grace
period from ending so there is no need to call rcu_read_lock/unlock
inside a spinlock protected section of code.

Signed-off-by: NeilBrown <[email protected]>
---
 fs/coda/cache.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/coda/cache.c b/fs/coda/cache.c
index 245131296300..970f0022ec52 100644
--- a/fs/coda/cache.c
+++ b/fs/coda/cache.c
@@ -93,14 +93,12 @@ static void coda_flag_children(struct dentry *parent, int flag)
 	struct dentry *de;
 
 	spin_lock(&parent->d_lock);
-	rcu_read_lock();
 	hlist_for_each_entry(de, &parent->d_children, d_sib) {
 		struct inode *inode = d_inode_rcu(de);
 		/* don't know what to do with negative dentries */
 		if (inode)
 			coda_flag_inode(inode, flag);
 	}
-	rcu_read_unlock();
 	spin_unlock(&parent->d_lock);
 }
 
-- 
2.50.0.107.gf914562f5916.dirty
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.