mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
block: replace fmode_t with a block-specific type for block open flags
The only overlap between the block open flags mapped into the fmode_t and
other uses of fmode_t are FMODE_READ and FMODE_WRITE. Define a new
blk_mode_t instead for use in blkdev_get_by_{dev,path}, ->open and
->ioctl and stop abusing fmode_t.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jack Wang <jinpu.wang@ionos.com> [rnbd]
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/r/20230608110258.189493-28-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
5e4ea83467
commit
05bdb99653
@@ -1640,7 +1640,7 @@ static struct block_device *open_backing_dev(struct drbd_device *device,
|
||||
struct block_device *bdev;
|
||||
int err = 0;
|
||||
|
||||
bdev = blkdev_get_by_path(bdev_path, FMODE_READ | FMODE_WRITE,
|
||||
bdev = blkdev_get_by_path(bdev_path, BLK_OPEN_READ | BLK_OPEN_WRITE,
|
||||
claim_ptr, NULL);
|
||||
if (IS_ERR(bdev)) {
|
||||
drbd_err(device, "open(\"%s\") failed with %ld\n",
|
||||
|
||||
Reference in New Issue
Block a user