mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
block: move bdev_read_only() into the header
This is called for every write in the fast path, move it inline next to get_disk_ro() which is called internally. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
e0d78afeb8
commit
db9a02baa2
@ -1389,12 +1389,6 @@ void set_disk_ro(struct gendisk *disk, bool read_only)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(set_disk_ro);
|
EXPORT_SYMBOL(set_disk_ro);
|
||||||
|
|
||||||
int bdev_read_only(struct block_device *bdev)
|
|
||||||
{
|
|
||||||
return bdev->bd_read_only || get_disk_ro(bdev->bd_disk);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(bdev_read_only);
|
|
||||||
|
|
||||||
void inc_diskseq(struct gendisk *disk)
|
void inc_diskseq(struct gendisk *disk)
|
||||||
{
|
{
|
||||||
disk->diskseq = atomic64_inc_return(&diskseq);
|
disk->diskseq = atomic64_inc_return(&diskseq);
|
||||||
|
@ -221,6 +221,11 @@ static inline int get_disk_ro(struct gendisk *disk)
|
|||||||
test_bit(GD_READ_ONLY, &disk->state);
|
test_bit(GD_READ_ONLY, &disk->state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int bdev_read_only(struct block_device *bdev)
|
||||||
|
{
|
||||||
|
return bdev->bd_read_only || get_disk_ro(bdev->bd_disk);
|
||||||
|
}
|
||||||
|
|
||||||
extern void disk_block_events(struct gendisk *disk);
|
extern void disk_block_events(struct gendisk *disk);
|
||||||
extern void disk_unblock_events(struct gendisk *disk);
|
extern void disk_unblock_events(struct gendisk *disk);
|
||||||
extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
|
extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user