* [PATCH] block: partition: use RCU_INIT_POINTER() for NULLing.
@ 2016-05-05 17:54 Muhammad Falak R Wani
2016-05-05 18:31 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Muhammad Falak R Wani @ 2016-05-05 17:54 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, linux-kernel
It is safe to use RCU_INIT_POINTER() to NULL, instead of
rcu_assign_pointer().
This results in slightly smaller/faster code.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
block/partition-generic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 2c6ae2a..e5219d5 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -262,8 +262,8 @@ void delete_partition(struct gendisk *disk, int partno)
if (!part)
return;
- rcu_assign_pointer(ptbl->part[partno], NULL);
- rcu_assign_pointer(ptbl->last_lookup, NULL);
+ RCU_INIT_POINTER(ptbl->part[partno], NULL);
+ RCU_INIT_POINTER(ptbl->last_lookup, NULL);
kobject_put(part->holder_dir);
device_del(part_to_dev(part));
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] block: partition: use RCU_INIT_POINTER() for NULLing.
2016-05-05 17:54 [PATCH] block: partition: use RCU_INIT_POINTER() for NULLing Muhammad Falak R Wani
@ 2016-05-05 18:31 ` Christoph Hellwig
2016-05-05 18:35 ` Muhammad Falak R Wani
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2016-05-05 18:31 UTC (permalink / raw)
To: Muhammad Falak R Wani; +Cc: Jens Axboe, linux-block, linux-kernel
On Thu, May 05, 2016 at 11:24:06PM +0530, Muhammad Falak R Wani wrote:
> It is safe to use RCU_INIT_POINTER() to NULL, instead of
> rcu_assign_pointer().
> This results in slightly smaller/faster code.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Muhammad,
please stop sending these patches. They make the code less reusbale,
and we (or rather Paul) are working on making rcu_assign_pointer do
the right thing.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block: partition: use RCU_INIT_POINTER() for NULLing.
2016-05-05 18:31 ` Christoph Hellwig
@ 2016-05-05 18:35 ` Muhammad Falak R Wani
0 siblings, 0 replies; 3+ messages in thread
From: Muhammad Falak R Wani @ 2016-05-05 18:35 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jens Axboe, linux-block, linux-kernel
On Thu, May 05, 2016 at 11:31:19AM -0700, Christoph Hellwig wrote:
> On Thu, May 05, 2016 at 11:24:06PM +0530, Muhammad Falak R Wani wrote:
> > It is safe to use RCU_INIT_POINTER() to NULL, instead of
> > rcu_assign_pointer().
> > This results in slightly smaller/faster code.
> >
> > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
>
> Muhammad,
>
> please stop sending these patches. They make the code less reusbale,
> and we (or rather Paul) are working on making rcu_assign_pointer do
> the right thing.
Sorry, my bad!
Wont send any of these now. I just thought it might be the right thing
to do, till the time Paul et al make it do the right thing.
-mfrw
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-05 18:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-05 17:54 [PATCH] block: partition: use RCU_INIT_POINTER() for NULLing Muhammad Falak R Wani
2016-05-05 18:31 ` Christoph Hellwig
2016-05-05 18:35 ` Muhammad Falak R Wani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox