block: replace fmode_t with a block-specific type for block open flags
authorChristoph Hellwig <hch@lst.de>
Thu, 8 Jun 2023 11:02:55 +0000 (13:02 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Jun 2023 14:04:05 +0000 (08:04 -0600)
commit05bdb9965305bbfdae79b31d22df03d1e2cfcb22
tree46b45e49b90a7614afe3f78665b1898970ed5731
parent5e4ea834676e3b8965344ca61d36e1ae236249eb
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>
82 files changed:
arch/um/drivers/ubd_kern.c
arch/xtensa/platforms/iss/simdisk.c
block/bdev.c
block/blk-zoned.c
block/blk.h
block/fops.c
block/genhd.c
block/ioctl.c
drivers/block/amiflop.c
drivers/block/aoe/aoeblk.c
drivers/block/ataflop.c
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_nl.c
drivers/block/floppy.c
drivers/block/loop.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/nbd.c
drivers/block/pktcdvd.c
drivers/block/rbd.c
drivers/block/rnbd/rnbd-clt.c
drivers/block/rnbd/rnbd-srv.c
drivers/block/sunvdc.c
drivers/block/swim.c
drivers/block/swim3.c
drivers/block/ublk_drv.c
drivers/block/xen-blkback/xenbus.c
drivers/block/xen-blkfront.c
drivers/block/z2ram.c
drivers/block/zram/zram_drv.c
drivers/cdrom/cdrom.c
drivers/cdrom/gdrom.c
drivers/md/bcache/bcache.h
drivers/md/bcache/request.c
drivers/md/bcache/super.c
drivers/md/dm-cache-target.c
drivers/md/dm-clone-target.c
drivers/md/dm-core.h
drivers/md/dm-era-target.c
drivers/md/dm-ioctl.c
drivers/md/dm-snap.c
drivers/md/dm-table.c
drivers/md/dm-thin.c
drivers/md/dm-verity-fec.c
drivers/md/dm-verity-target.c
drivers/md/dm.c
drivers/md/dm.h
drivers/md/md.c
drivers/mmc/core/block.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/mtd_blkdevs.c
drivers/mtd/ubi/block.c
drivers/nvme/host/core.c
drivers/nvme/host/ioctl.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h
drivers/nvme/target/io-cmd-bdev.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_genhd.c
drivers/s390/block/dasd_int.h
drivers/s390/block/dasd_ioctl.c
drivers/s390/block/dcssblk.c
drivers/scsi/sd.c
drivers/scsi/sr.c
drivers/target/target_core_iblock.c
drivers/target/target_core_pscsi.c
fs/btrfs/dev-replace.c
fs/btrfs/super.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h
fs/erofs/super.c
fs/ext4/super.c
fs/f2fs/super.c
fs/jfs/jfs_logmgr.c
fs/nfs/blocklayout/dev.c
fs/ocfs2/cluster/heartbeat.c
fs/reiserfs/journal.c
fs/xfs/xfs_super.c
include/linux/blkdev.h
include/linux/cdrom.h
include/linux/device-mapper.h
kernel/power/swap.c
mm/swapfile.c