Skip to contentSkip to conversation

block: partition: use RCU_INIT_POINTER() for NULLing.

PATCH In review Muhammad Falak R Wani 2 participants 3 messages May 5, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: partition: use RCU_INIT_POINTER() for NULLing.

It is safe to use RCU_INIT_POINTER() to NULL, instead of rcu_assign_pointer().
This results in slightly smaller/faster code.

---
 block/partition-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/partition-generic.c +2 -2
index 2c6ae2a..e5219d5 100644
@@ -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));
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 5 lines · Muhammad Falak R Wani

It is safe to use RCU_INIT_POINTER() to NULL, instead of rcu_assign_pointer().
This results in slightly smaller/faster code.

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.

#2 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · Muhammad Falak R Wani

It is safe to use RCU_INIT_POINTER() to NULL, instead of rcu_assign_pointer().
This results in slightly smaller/faster code.

Quoted 7 lines
Quoted 1 line

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