null_blk: clean up report zones

Make the instance name match the method name and define the name to NULL
instead of providing an inline stub, which is rather pointless for a
method call.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig 2019-11-11 11:39:27 +09:00 коммит произвёл Jens Axboe
Родитель e3f89564c5
Коммит 7fc8fb51a1
3 изменённых файлов: 6 добавлений и 11 удалений

Просмотреть файл

@ -91,7 +91,7 @@ struct nullb {
#ifdef CONFIG_BLK_DEV_ZONED #ifdef CONFIG_BLK_DEV_ZONED
int null_zone_init(struct nullb_device *dev); int null_zone_init(struct nullb_device *dev);
void null_zone_exit(struct nullb_device *dev); void null_zone_exit(struct nullb_device *dev);
int null_zone_report(struct gendisk *disk, sector_t sector, int null_report_zones(struct gendisk *disk, sector_t sector,
struct blk_zone *zones, unsigned int *nr_zones); struct blk_zone *zones, unsigned int *nr_zones);
blk_status_t null_handle_zoned(struct nullb_cmd *cmd, blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector, enum req_opf op, sector_t sector,
@ -105,12 +105,6 @@ static inline int null_zone_init(struct nullb_device *dev)
return -EINVAL; return -EINVAL;
} }
static inline void null_zone_exit(struct nullb_device *dev) {} static inline void null_zone_exit(struct nullb_device *dev) {}
static inline int null_zone_report(struct gendisk *disk, sector_t sector,
struct blk_zone *zones,
unsigned int *nr_zones)
{
return -EOPNOTSUPP;
}
static inline blk_status_t null_handle_zoned(struct nullb_cmd *cmd, static inline blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector, enum req_opf op, sector_t sector,
sector_t nr_sectors) sector_t nr_sectors)
@ -123,5 +117,6 @@ static inline size_t null_zone_valid_read_len(struct nullb *nullb,
{ {
return len; return len;
} }
#define null_report_zones NULL
#endif /* CONFIG_BLK_DEV_ZONED */ #endif /* CONFIG_BLK_DEV_ZONED */
#endif /* __NULL_BLK_H */ #endif /* __NULL_BLK_H */

Просмотреть файл

@ -1470,7 +1470,7 @@ static void null_config_discard(struct nullb *nullb)
static const struct block_device_operations null_ops = { static const struct block_device_operations null_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.report_zones = null_zone_report, .report_zones = null_report_zones,
}; };
static void null_init_queue(struct nullb *nullb, struct nullb_queue *nq) static void null_init_queue(struct nullb *nullb, struct nullb_queue *nq)

Просмотреть файл

@ -66,7 +66,7 @@ void null_zone_exit(struct nullb_device *dev)
kvfree(dev->zones); kvfree(dev->zones);
} }
int null_zone_report(struct gendisk *disk, sector_t sector, int null_report_zones(struct gendisk *disk, sector_t sector,
struct blk_zone *zones, unsigned int *nr_zones) struct blk_zone *zones, unsigned int *nr_zones)
{ {
struct nullb *nullb = disk->private_data; struct nullb *nullb = disk->private_data;