summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-06-08 13:02:55 +0200
committerJens Axboe <axboe@kernel.dk>2023-06-12 16:04:05 +0200
commit05bdb9965305bbfdae79b31d22df03d1e2cfcb22 (patch)
tree46b45e49b90a7614afe3f78665b1898970ed5731 /drivers/scsi/sr.c
parentblock: remove unused fmode_t arguments from ioctl handlers (diff)
downloadlinux-05bdb9965305bbfdae79b31d22df03d1e2cfcb22.tar.xz
linux-05bdb9965305bbfdae79b31d22df03d1e2cfcb22.zip
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>
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r--drivers/scsi/sr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 00aaafc8dd78..ce886c8c9dbe 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -484,7 +484,7 @@ static void sr_revalidate_disk(struct scsi_cd *cd)
get_sectorsize(cd);
}
-static int sr_block_open(struct gendisk *disk, fmode_t mode)
+static int sr_block_open(struct gendisk *disk, blk_mode_t mode)
{
struct scsi_cd *cd = scsi_cd(disk);
struct scsi_device *sdev = cd->device;
@@ -518,8 +518,8 @@ static void sr_block_release(struct gendisk *disk)
scsi_device_put(cd->device);
}
-static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
- unsigned long arg)
+static int sr_block_ioctl(struct block_device *bdev, blk_mode_t mode,
+ unsigned cmd, unsigned long arg)
{
struct scsi_cd *cd = scsi_cd(bdev->bd_disk);
struct scsi_device *sdev = cd->device;
@@ -532,7 +532,7 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
mutex_lock(&cd->lock);
ret = scsi_ioctl_block_when_processing_errors(sdev, cmd,
- (mode & FMODE_NDELAY) != 0);
+ (mode & BLK_OPEN_NDELAY));
if (ret)
goto out;
@@ -543,7 +543,7 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
if (ret != -ENOSYS)
goto put;
}
- ret = scsi_ioctl(sdev, mode & FMODE_WRITE, cmd, argp);
+ ret = scsi_ioctl(sdev, mode & BLK_OPEN_WRITE, cmd, argp);
put:
scsi_autopm_put_device(sdev);