mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
block: remove rcu_read_lock() from part_stat_lock()
The RCU lock is required only in disk_map_sector_rcu() to lookup the partition. After that request holds reference to related hd_struct. Replace get_cpu() with preempt_disable() - returned cpu index is unused. [hch: rebased] Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
b5af37ab3a
commit
8ab1d40a64
2 changed files with 10 additions and 5 deletions
|
@ -21,8 +21,8 @@ struct disk_stats {
|
|||
*
|
||||
* part_stat_read() can be called at any time.
|
||||
*/
|
||||
#define part_stat_lock() ({ rcu_read_lock(); get_cpu(); })
|
||||
#define part_stat_unlock() do { put_cpu(); rcu_read_unlock(); } while (0)
|
||||
#define part_stat_lock() preempt_disable()
|
||||
#define part_stat_unlock() preempt_enable()
|
||||
|
||||
#define part_stat_get_cpu(part, field, cpu) \
|
||||
(per_cpu_ptr((part)->dkstats, (cpu))->field)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue