diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-03 07:40:57 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-25 08:18:57 -0600 |
commit | fa01b1e9733fd59ecb8b5b6d85dfb481d2025fbf (patch) | |
tree | f627199fb47da3dc4fa57dcbf305fff12997a918 /drivers/mmc/core/block.c | |
parent | 250eec9e390e2be6f672f9a77cf29791c189f7da (diff) |
block: add a bdev_is_partition helper
Add a littler helper to make the somewhat arcane bd_contains checks a
little more obvious.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/mmc/core/block.c')
-rw-r--r-- | drivers/mmc/core/block.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index fa313b634135..8d3df0be0355 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -723,7 +723,7 @@ static int mmc_blk_check_blkdev(struct block_device *bdev) * whole block device, not on a partition. This prevents overspray * between sibling partitions. */ - if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains)) + if (!capable(CAP_SYS_RAWIO) || bdev_is_partition(bdev)) return -EPERM; return 0; } |