]> git.ipfire.org Git - people/ms/linux.git/commit - block/bdev.c
block: turn bdev->bd_openers into an atomic_t
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Mar 2022 05:29:07 +0000 (07:29 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 12:54:09 +0000 (06:54 -0600)
commit9acf381f3e8f715175c29f4b6d722f6b6797d139
tree9f0a39c15820a6772d4cd0b60f458010b5ac6c64
parentdbdc1be32591af023db2812706f01e6cd2f42bfc
block: turn bdev->bd_openers into an atomic_t

All manipulation of bd_openers is under disk->open_mutex and will remain
so for the foreseeable future.  But at least one place reads it without
the lock (blkdev_get) and there are more to be added.  So make sure the
compiler does not do turn the increments and decrements into non-atomic
sequences by using an atomic_t.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220330052917.2566582-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bdev.c
block/partitions/core.c
include/linux/blk_types.h
include/linux/blkdev.h