Create struct bdev_handle that contains all parameters that need to be passed to blkdev_put() and provide bdev_open_* functions that return this structure instead of plain bdev pointer.
Jan Kara (30): block: Provide bdev_open_* functions block: Use bdev_open_by_dev() in blkdev_open() block: Use bdev_open_by_dev() in disk_scan_partitions() and blkdev_bszset() drdb: Convert to use bdev_open_by_path() pktcdvd: Convert to bdev_open_by_dev() rnbd-srv: Convert to use bdev_open_by_path() xen/blkback: Convert to bdev_open_by_dev() zram: Convert to use bdev_open_by_dev() bcache: Convert to bdev_open_by_path() dm: Convert to bdev_open_by_dev() md: Convert to bdev_open_by_dev() mtd: block2mtd: Convert to bdev_open_by_dev/path() nvmet: Convert to bdev_open_by_path() s390/dasd: Convert to bdev_open_by_path() scsi: target: Convert to bdev_open_by_path() PM: hibernate: Convert to bdev_open_by_dev() PM: hibernate: Drop unused snapshot_test argument mm/swap: Convert to use bdev_open_by_dev() fs: Convert to bdev_open_by_dev() btrfs: Convert to bdev_open_by_path() erofs: Convert to use bdev_open_by_path() ext4: Convert to bdev_open_by_dev() f2fs: Convert to bdev_open_by_dev/path() jfs: Convert to bdev_open_by_dev() nfs/blocklayout: Convert to use bdev_open_by_dev/path() ocfs2: Convert to use bdev_open_by_dev() reiserfs: Convert to bdev_open_by_dev/path() xfs: Convert to bdev_open_by_path() bcache: Fixup error handling in register_cache() block: Remove blkdev_get_by_*() functions
block/bdev.c | 65 ++++++++++------- block/fops.c | 44 +++++++----- block/genhd.c | 12 ++-- block/ioctl.c | 6 +- drivers/block/drbd/drbd_int.h | 2 + drivers/block/drbd/drbd_nl.c | 65 +++++++++-------- drivers/block/pktcdvd.c | 76 +++++++++++--------- drivers/block/rnbd/rnbd-srv.c | 27 +++---- drivers/block/rnbd/rnbd-srv.h | 2 +- drivers/block/xen-blkback/blkback.c | 4 +- drivers/block/xen-blkback/common.h | 4 +- drivers/block/xen-blkback/xenbus.c | 40 ++++++----- drivers/block/zram/zram_drv.c | 31 ++++---- drivers/block/zram/zram_drv.h | 2 +- drivers/md/bcache/bcache.h | 2 + drivers/md/bcache/super.c | 95 ++++++++++++------------ drivers/md/dm.c | 20 +++--- drivers/md/md.c | 23 +++--- drivers/md/md.h | 4 +- drivers/mtd/devices/block2mtd.c | 51 +++++++------ drivers/nvme/target/io-cmd-bdev.c | 20 +++--- drivers/nvme/target/nvmet.h | 1 + drivers/s390/block/dasd.c | 12 ++-- drivers/s390/block/dasd_genhd.c | 45 ++++++------ drivers/s390/block/dasd_int.h | 2 +- drivers/s390/block/dasd_ioctl.c | 2 +- drivers/target/target_core_iblock.c | 19 ++--- drivers/target/target_core_iblock.h | 1 + drivers/target/target_core_pscsi.c | 26 +++---- drivers/target/target_core_pscsi.h | 2 +- fs/btrfs/dev-replace.c | 14 ++-- fs/btrfs/ioctl.c | 18 +++-- fs/btrfs/volumes.c | 107 ++++++++++++++-------------- fs/btrfs/volumes.h | 6 +- fs/cramfs/inode.c | 2 +- fs/erofs/data.c | 4 +- fs/erofs/internal.h | 2 +- fs/erofs/super.c | 20 +++--- fs/ext4/ext4.h | 2 +- fs/ext4/fsmap.c | 9 +-- fs/ext4/super.c | 52 +++++++------- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 13 ++-- fs/jfs/jfs_logmgr.c | 29 ++++---- fs/jfs/jfs_logmgr.h | 2 +- fs/jfs/jfs_mount.c | 3 +- fs/nfs/blocklayout/blocklayout.h | 2 +- fs/nfs/blocklayout/dev.c | 76 ++++++++++---------- fs/ocfs2/cluster/heartbeat.c | 81 +++++++++++---------- fs/reiserfs/journal.c | 56 +++++++-------- fs/reiserfs/procfs.c | 2 +- fs/reiserfs/reiserfs.h | 11 +-- fs/romfs/super.c | 2 +- fs/super.c | 15 ++-- fs/xfs/xfs_buf.c | 22 +++--- fs/xfs/xfs_buf.h | 3 +- fs/xfs/xfs_super.c | 42 ++++++----- include/linux/blkdev.h | 12 +++- include/linux/device-mapper.h | 1 + include/linux/fs.h | 1 + include/linux/pktcdvd.h | 4 +- include/linux/swap.h | 1 + kernel/power/hibernate.c | 14 ++-- kernel/power/power.h | 2 +- kernel/power/swap.c | 37 +++++----- mm/swapfile.c | 23 +++--- 66 files changed, 739 insertions(+), 657 deletions(-)