Merge tag 'compat-ioctl-5.5' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd...
[linux-2.6-block.git] / include / linux / blkdev.h
index 2c8cd22b176b3bdc258177e39660b9a363d00132..6012e2592628ce1de3b90c69f9462b40e319e844 100644 (file)
@@ -349,25 +349,25 @@ struct queue_limits {
        enum blk_zoned_model    zoned;
 };
 
+typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx,
+                              void *data);
+
 #ifdef CONFIG_BLK_DEV_ZONED
 
-/*
- * Maximum number of zones to report with a single report zones command.
- */
-#define BLK_ZONED_REPORT_MAX_ZONES     8192U
+#define BLK_ALL_ZONES  ((unsigned int)-1)
+int blkdev_report_zones(struct block_device *bdev, sector_t sector,
+                       unsigned int nr_zones, report_zones_cb cb, void *data);
 
 extern unsigned int blkdev_nr_zones(struct block_device *bdev);
-extern int blkdev_report_zones(struct block_device *bdev,
-                              sector_t sector, struct blk_zone *zones,
-                              unsigned int *nr_zones);
-extern int blkdev_reset_zones(struct block_device *bdev, sector_t sectors,
-                             sector_t nr_sectors, gfp_t gfp_mask);
+extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
+                           sector_t sectors, sector_t nr_sectors,
+                           gfp_t gfp_mask);
 extern int blk_revalidate_disk_zones(struct gendisk *disk);
 
 extern int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
                                     unsigned int cmd, unsigned long arg);
-extern int blkdev_reset_zones_ioctl(struct block_device *bdev, fmode_t mode,
-                                   unsigned int cmd, unsigned long arg);
+extern int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
+                                 unsigned int cmd, unsigned long arg);
 
 #else /* CONFIG_BLK_DEV_ZONED */
 
@@ -388,9 +388,9 @@ static inline int blkdev_report_zones_ioctl(struct block_device *bdev,
        return -ENOTTY;
 }
 
-static inline int blkdev_reset_zones_ioctl(struct block_device *bdev,
-                                          fmode_t mode, unsigned int cmd,
-                                          unsigned long arg)
+static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
+                                        fmode_t mode, unsigned int cmd,
+                                        unsigned long arg)
 {
        return -ENOTTY;
 }
@@ -411,7 +411,6 @@ struct request_queue {
 
        /* sw queues */
        struct blk_mq_ctx __percpu      *queue_ctx;
-       unsigned int            nr_queues;
 
        unsigned int            queue_depth;
 
@@ -1711,7 +1710,7 @@ struct block_device_operations {
        /* this callback is with swap_lock and sometimes page table lock held */
        void (*swap_slot_free_notify) (struct block_device *, unsigned long);
        int (*report_zones)(struct gendisk *, sector_t sector,
-                           struct blk_zone *zones, unsigned int *nr_zones);
+                       unsigned int nr_zones, report_zones_cb cb, void *data);
        struct module *owner;
        const struct pr_ops *pr_ops;
 };