* [PATCH] afs: inode: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
@ 2014-08-22 13:43 Andreea-Cristina Bernat
2015-02-11 12:57 ` David Howells
0 siblings, 1 reply; 3+ messages in thread
From: Andreea-Cristina Bernat @ 2014-08-22 13:43 UTC (permalink / raw)
To: dhowells, linux-afs, linux-kernel; +Cc: paulmck
The use of "rcu_assign_pointer()" is NULLing out the pointer.
According to RCU_INIT_POINTER()'s block comment:
"1. This use of RCU_INIT_POINTER() is NULLing out the pointer"
it is better to use it instead of rcu_assign_pointer() because it has a
smaller overhead.
The following Coccinelle semantic patch was used:
@@
@@
- rcu_assign_pointer
+ RCU_INIT_POINTER
(..., NULL)
Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
---
fs/afs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 2946712..6457621 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -445,7 +445,7 @@ void afs_evict_inode(struct inode *inode)
mutex_lock(&vnode->permits_lock);
permits = vnode->permits;
- rcu_assign_pointer(vnode->permits, NULL);
+ RCU_INIT_POINTER(vnode->permits, NULL);
mutex_unlock(&vnode->permits_lock);
if (permits)
call_rcu(&permits->rcu, afs_zap_permits);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] afs: inode: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
2014-08-22 13:43 [PATCH] afs: inode: Replace rcu_assign_pointer() with RCU_INIT_POINTER() Andreea-Cristina Bernat
@ 2015-02-11 12:57 ` David Howells
2015-02-11 15:13 ` Paul E. McKenney
0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2015-02-11 12:57 UTC (permalink / raw)
To: Andreea-Cristina Bernat; +Cc: dhowells, linux-afs, linux-kernel, paulmck
I've applied these two patches, but one of them throws up a problem in
Fengguang's magic auto-compilation thing.
David
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] afs: inode: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
2015-02-11 12:57 ` David Howells
@ 2015-02-11 15:13 ` Paul E. McKenney
0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2015-02-11 15:13 UTC (permalink / raw)
To: David Howells; +Cc: Andreea-Cristina Bernat, linux-afs, linux-kernel
On Wed, Feb 11, 2015 at 12:57:39PM +0000, David Howells wrote:
> I've applied these two patches, but one of them throws up a problem in
> Fengguang's magic auto-compilation thing.
Hello, David,
I seem to have fat-fingered Fengguang's magic auto-compilation thing's
email. (One of those mornings, I guess...) Could you please point me
at it?
Thanx, Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-11 15:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22 13:43 [PATCH] afs: inode: Replace rcu_assign_pointer() with RCU_INIT_POINTER() Andreea-Cristina Bernat
2015-02-11 12:57 ` David Howells
2015-02-11 15:13 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox