Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: rename struct gendisk zone_wplugs_lock field

Rename struct gendisk zone_wplugs_lock field to zone_wplugs_hash_lock to
clearly indicates that this is the spinlock used for manipulating the
hash table of zone write plugs.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
b7cbc30e c30e8c4b

+13 -12
+12 -11
block/blk-zoned.c
··· 514 514 * are racing with other submission context, so we may already have a 515 515 * zone write plug for the same zone. 516 516 */ 517 - spin_lock_irqsave(&disk->zone_wplugs_lock, flags); 517 + spin_lock_irqsave(&disk->zone_wplugs_hash_lock, flags); 518 518 hlist_for_each_entry_rcu(zwplg, &disk->zone_wplugs_hash[idx], node) { 519 519 if (zwplg->zone_no == zwplug->zone_no) { 520 - spin_unlock_irqrestore(&disk->zone_wplugs_lock, flags); 520 + spin_unlock_irqrestore(&disk->zone_wplugs_hash_lock, 521 + flags); 521 522 return false; 522 523 } 523 524 } ··· 530 529 * necessarilly in the active condition. 531 530 */ 532 531 zones_cond = rcu_dereference_check(disk->zones_cond, 533 - lockdep_is_held(&disk->zone_wplugs_lock)); 532 + lockdep_is_held(&disk->zone_wplugs_hash_lock)); 534 533 if (zones_cond) 535 534 zwplug->cond = zones_cond[zwplug->zone_no]; 536 535 else ··· 538 537 539 538 hlist_add_head_rcu(&zwplug->node, &disk->zone_wplugs_hash[idx]); 540 539 atomic_inc(&disk->nr_zone_wplugs); 541 - spin_unlock_irqrestore(&disk->zone_wplugs_lock, flags); 540 + spin_unlock_irqrestore(&disk->zone_wplugs_hash_lock, flags); 542 541 543 542 return true; 544 543 } ··· 591 590 WARN_ON_ONCE(zwplug->flags & BLK_ZONE_WPLUG_PLUGGED); 592 591 WARN_ON_ONCE(!bio_list_empty(&zwplug->bio_list)); 593 592 594 - spin_lock_irqsave(&disk->zone_wplugs_lock, flags); 593 + spin_lock_irqsave(&disk->zone_wplugs_hash_lock, flags); 595 594 blk_zone_set_cond(rcu_dereference_check(disk->zones_cond, 596 - lockdep_is_held(&disk->zone_wplugs_lock)), 595 + lockdep_is_held(&disk->zone_wplugs_hash_lock)), 597 596 zwplug->zone_no, zwplug->cond); 598 597 hlist_del_init_rcu(&zwplug->node); 599 598 atomic_dec(&disk->nr_zone_wplugs); 600 - spin_unlock_irqrestore(&disk->zone_wplugs_lock, flags); 599 + spin_unlock_irqrestore(&disk->zone_wplugs_hash_lock, flags); 601 600 602 601 call_rcu(&zwplug->rcu_head, disk_free_zone_wplug_rcu); 603 602 } ··· 1740 1739 1741 1740 void disk_init_zone_resources(struct gendisk *disk) 1742 1741 { 1743 - spin_lock_init(&disk->zone_wplugs_lock); 1742 + spin_lock_init(&disk->zone_wplugs_hash_lock); 1744 1743 } 1745 1744 1746 1745 /* ··· 1830 1829 { 1831 1830 unsigned long flags; 1832 1831 1833 - spin_lock_irqsave(&disk->zone_wplugs_lock, flags); 1832 + spin_lock_irqsave(&disk->zone_wplugs_hash_lock, flags); 1834 1833 zones_cond = rcu_replace_pointer(disk->zones_cond, zones_cond, 1835 - lockdep_is_held(&disk->zone_wplugs_lock)); 1836 - spin_unlock_irqrestore(&disk->zone_wplugs_lock, flags); 1834 + lockdep_is_held(&disk->zone_wplugs_hash_lock)); 1835 + spin_unlock_irqrestore(&disk->zone_wplugs_hash_lock, flags); 1837 1836 1838 1837 kfree_rcu_mightsleep(zones_cond); 1839 1838 }
+1 -1
include/linux/blkdev.h
··· 200 200 u8 __rcu *zones_cond; 201 201 unsigned int zone_wplugs_hash_bits; 202 202 atomic_t nr_zone_wplugs; 203 - spinlock_t zone_wplugs_lock; 203 + spinlock_t zone_wplugs_hash_lock; 204 204 struct mempool *zone_wplugs_pool; 205 205 struct hlist_head *zone_wplugs_hash; 206 206 struct workqueue_struct *zone_wplugs_wq;