aboutsummaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-01-09 11:42:50 +0100
committerJens Axboe <axboe@kernel.dk>2021-01-24 18:15:57 -0700
commit6f0d9689b670bc9f9640ff87b3f9226b7806dea2 (patch)
tree56428c55621af77d28f43ad7545416d6b2fb4218 /block/genhd.c
parentdm: use bdev_read_only to check if a device is read-only (diff)
downloadlinux-dev-6f0d9689b670bc9f9640ff87b3f9226b7806dea2.tar.xz
linux-dev-6f0d9689b670bc9f9640ff87b3f9226b7806dea2.zip
block: remove the NULL bdev check in bdev_read_only
Only a single caller can end up in bdev_read_only, so move the check there. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 419548e92d82..484a474648d5 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1657,11 +1657,8 @@ EXPORT_SYMBOL(set_disk_ro);
int bdev_read_only(struct block_device *bdev)
{
- if (!bdev)
- return 0;
return bdev->bd_read_only;
}
-
EXPORT_SYMBOL(bdev_read_only);
/*