mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
block: replace fmode_t with a block-specific type for block open flags
The only overlap between the block open flags mapped into the fmode_t and
other uses of fmode_t are FMODE_READ and FMODE_WRITE. Define a new
blk_mode_t instead for use in blkdev_get_by_{dev,path}, ->open and
->ioctl and stop abusing fmode_t.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jack Wang <jinpu.wang@ionos.com> [rnbd]
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/r/20230608110258.189493-28-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
5e4ea83467
commit
05bdb99653
11
block/blk.h
11
block/blk.h
@@ -396,7 +396,7 @@ void disk_free_zone_bitmaps(struct gendisk *disk);
|
||||
void disk_clear_zone_settings(struct gendisk *disk);
|
||||
int blkdev_report_zones_ioctl(struct block_device *bdev, unsigned int cmd,
|
||||
unsigned long arg);
|
||||
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);
|
||||
#else /* CONFIG_BLK_DEV_ZONED */
|
||||
static inline void disk_free_zone_bitmaps(struct gendisk *disk) {}
|
||||
@@ -407,7 +407,7 @@ static inline int blkdev_report_zones_ioctl(struct block_device *bdev,
|
||||
return -ENOTTY;
|
||||
}
|
||||
static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
|
||||
fmode_t mode, unsigned int cmd, unsigned long arg)
|
||||
blk_mode_t mode, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
return -ENOTTY;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ static inline void bio_release_page(struct bio *bio, struct page *page)
|
||||
|
||||
struct request_queue *blk_alloc_queue(int node_id);
|
||||
|
||||
int disk_scan_partitions(struct gendisk *disk, fmode_t mode);
|
||||
int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode);
|
||||
|
||||
int disk_alloc_events(struct gendisk *disk);
|
||||
void disk_add_events(struct gendisk *disk);
|
||||
@@ -466,8 +466,9 @@ extern struct device_attribute dev_attr_events_poll_msecs;
|
||||
|
||||
extern struct attribute_group blk_trace_attr_group;
|
||||
|
||||
int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
|
||||
loff_t lend);
|
||||
blk_mode_t file_to_blk_mode(struct file *file);
|
||||
int truncate_bdev_range(struct block_device *bdev, blk_mode_t mode,
|
||||
loff_t lstart, loff_t lend);
|
||||
long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg);
|
||||
long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user