Merge branch '6.5/scsi-staging' into 6.5/scsi-fixes
[sfrench/cifs-2.6.git] / block / blk-zoned.c
index da92ce0c5da98304b4cb6b75cdfa93177ea38745..619ee41a51cc8c81b0333f4f95a70e3b3ed7c442 100644 (file)
@@ -57,16 +57,10 @@ EXPORT_SYMBOL_GPL(blk_zone_cond_str);
  */
 bool blk_req_needs_zone_write_lock(struct request *rq)
 {
-       if (blk_rq_is_passthrough(rq))
-               return false;
-
        if (!rq->q->disk->seq_zones_wlock)
                return false;
 
-       if (bdev_op_is_zoned_write(rq->q->disk->part0, req_op(rq)))
-               return blk_rq_zone_is_seq(rq);
-
-       return false;
+       return blk_rq_is_seq_zoned_write(rq);
 }
 EXPORT_SYMBOL_GPL(blk_req_needs_zone_write_lock);
 
@@ -329,8 +323,8 @@ static int blkdev_copy_zone_to_user(struct blk_zone *zone, unsigned int idx,
  * BLKREPORTZONE ioctl processing.
  * Called from blkdev_ioctl.
  */
-int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
-                             unsigned int cmd, unsigned long arg)
+int blkdev_report_zones_ioctl(struct block_device *bdev, unsigned int cmd,
+               unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        struct zone_report_args args;
@@ -362,8 +356,8 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
        return 0;
 }
 
-static int blkdev_truncate_zone_range(struct block_device *bdev, fmode_t mode,
-                                     const struct blk_zone_range *zrange)
+static int blkdev_truncate_zone_range(struct block_device *bdev,
+               blk_mode_t mode, const struct blk_zone_range *zrange)
 {
        loff_t start, end;
 
@@ -382,7 +376,7 @@ static int blkdev_truncate_zone_range(struct block_device *bdev, fmode_t mode,
  * BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing.
  * Called from blkdev_ioctl.
  */
-int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
+int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode,
                           unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
@@ -396,7 +390,7 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
        if (!bdev_is_zoned(bdev))
                return -ENOTTY;
 
-       if (!(mode & FMODE_WRITE))
+       if (!(mode & BLK_OPEN_WRITE))
                return -EBADF;
 
        if (copy_from_user(&zrange, argp, sizeof(struct blk_zone_range)))