Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: move a few internal definitions out of blkdev.h

All these helpers are only used in core block code, so move them out of
the public header.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/r/20230608110258.189493-26-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
cfb42576 bd6abfc8

+21 -29
+21 -2
block/blk.h
··· 394 394 #ifdef CONFIG_BLK_DEV_ZONED 395 395 void disk_free_zone_bitmaps(struct gendisk *disk); 396 396 void disk_clear_zone_settings(struct gendisk *disk); 397 - #else 397 + int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, 398 + unsigned int cmd, unsigned long arg); 399 + int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, 400 + unsigned int cmd, unsigned long arg); 401 + #else /* CONFIG_BLK_DEV_ZONED */ 398 402 static inline void disk_free_zone_bitmaps(struct gendisk *disk) {} 399 403 static inline void disk_clear_zone_settings(struct gendisk *disk) {} 400 - #endif 404 + static inline int blkdev_report_zones_ioctl(struct block_device *bdev, 405 + fmode_t mode, unsigned int cmd, unsigned long arg) 406 + { 407 + return -ENOTTY; 408 + } 409 + static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev, 410 + fmode_t mode, unsigned int cmd, unsigned long arg) 411 + { 412 + return -ENOTTY; 413 + } 414 + #endif /* CONFIG_BLK_DEV_ZONED */ 415 + 416 + struct block_device *bdev_alloc(struct gendisk *disk, u8 partno); 417 + void bdev_add(struct block_device *bdev, dev_t dev); 401 418 402 419 int blk_alloc_ext_minor(void); 403 420 void blk_free_ext_minor(unsigned int minor); ··· 466 449 467 450 extern struct attribute_group blk_trace_attr_group; 468 451 452 + int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart, 453 + loff_t lend); 469 454 long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg); 470 455 long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg); 471 456
-27
include/linux/blkdev.h
··· 318 318 void disk_set_zoned(struct gendisk *disk, enum blk_zoned_model model); 319 319 320 320 #ifdef CONFIG_BLK_DEV_ZONED 321 - 322 321 #define BLK_ALL_ZONES ((unsigned int)-1) 323 322 int blkdev_report_zones(struct block_device *bdev, sector_t sector, 324 323 unsigned int nr_zones, report_zones_cb cb, void *data); ··· 327 328 gfp_t gfp_mask); 328 329 int blk_revalidate_disk_zones(struct gendisk *disk, 329 330 void (*update_driver_data)(struct gendisk *disk)); 330 - 331 - extern int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, 332 - unsigned int cmd, unsigned long arg); 333 - extern int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, 334 - unsigned int cmd, unsigned long arg); 335 - 336 331 #else /* CONFIG_BLK_DEV_ZONED */ 337 - 338 332 static inline unsigned int bdev_nr_zones(struct block_device *bdev) 339 333 { 340 334 return 0; 341 335 } 342 - 343 - static inline int blkdev_report_zones_ioctl(struct block_device *bdev, 344 - fmode_t mode, unsigned int cmd, 345 - unsigned long arg) 346 - { 347 - return -ENOTTY; 348 - } 349 - 350 - static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev, 351 - fmode_t mode, unsigned int cmd, 352 - unsigned long arg) 353 - { 354 - return -ENOTTY; 355 - } 356 - 357 336 #endif /* CONFIG_BLK_DEV_ZONED */ 358 337 359 338 /* ··· 1470 1493 struct block_device *blkdev_get_no_open(dev_t dev); 1471 1494 void blkdev_put_no_open(struct block_device *bdev); 1472 1495 1473 - struct block_device *bdev_alloc(struct gendisk *disk, u8 partno); 1474 - void bdev_add(struct block_device *bdev, dev_t dev); 1475 1496 struct block_device *I_BDEV(struct inode *inode); 1476 - int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart, 1477 - loff_t lend); 1478 1497 1479 1498 #ifdef CONFIG_BLOCK 1480 1499 void invalidate_bdev(struct block_device *bdev);