Skip to content

Commit 668bfee

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: move a few definitions out of CONFIG_BLK_DEV_ZONED
Allow using a few symbols with IS_ENABLED instead of #idef by moving the declarations out of #idef CONFIG_BLK_DEV_ZONED, and move bdev_nr_zones into the remaining #idef CONFIG_BLK_DEV_ZONED, #else block below. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 70d85be commit 668bfee

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

include/linux/blkdev.h

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -331,22 +331,13 @@ typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx,
331331

332332
void disk_set_zoned(struct gendisk *disk, enum blk_zoned_model model);
333333

334-
#ifdef CONFIG_BLK_DEV_ZONED
335334
#define BLK_ALL_ZONES ((unsigned int)-1)
336335
int blkdev_report_zones(struct block_device *bdev, sector_t sector,
337-
unsigned int nr_zones, report_zones_cb cb, void *data);
338-
unsigned int bdev_nr_zones(struct block_device *bdev);
339-
extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op,
340-
sector_t sectors, sector_t nr_sectors,
341-
gfp_t gfp_mask);
336+
unsigned int nr_zones, report_zones_cb cb, void *data);
337+
int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op,
338+
sector_t sectors, sector_t nr_sectors, gfp_t gfp_mask);
342339
int blk_revalidate_disk_zones(struct gendisk *disk,
343-
void (*update_driver_data)(struct gendisk *disk));
344-
#else /* CONFIG_BLK_DEV_ZONED */
345-
static inline unsigned int bdev_nr_zones(struct block_device *bdev)
346-
{
347-
return 0;
348-
}
349-
#endif /* CONFIG_BLK_DEV_ZONED */
340+
void (*update_driver_data)(struct gendisk *disk));
350341

351342
/*
352343
* Independent access ranges: struct blk_independent_access_range describes
@@ -643,6 +634,8 @@ static inline bool blk_queue_is_zoned(struct request_queue *q)
643634
}
644635

645636
#ifdef CONFIG_BLK_DEV_ZONED
637+
unsigned int bdev_nr_zones(struct block_device *bdev);
638+
646639
static inline unsigned int disk_nr_zones(struct gendisk *disk)
647640
{
648641
return blk_queue_is_zoned(disk->queue) ? disk->nr_zones : 0;
@@ -687,6 +680,11 @@ static inline unsigned int bdev_max_active_zones(struct block_device *bdev)
687680
}
688681

689682
#else /* CONFIG_BLK_DEV_ZONED */
683+
static inline unsigned int bdev_nr_zones(struct block_device *bdev)
684+
{
685+
return 0;
686+
}
687+
690688
static inline unsigned int disk_nr_zones(struct gendisk *disk)
691689
{
692690
return 0;

0 commit comments

Comments
 (0)