remove blkdev_get as a public API v2

From: Christoph Hellwig
Date: Mon Sep 21 2020 - 03:20:45 EST


Hi Jens,

this series removes blkdev_get as a public API, leaving it as just an
implementation detail of blkdev_get_by_path and blkdev_get_by_dev. The
reason for that is that blkdev_get is a very confusing API that requires
a struct block_device to be fed in, but then actually consumes the
reference. And it turns out just using the two above mentioned APIs
actually significantly simplifies the code as well.

Changes since v1:
- fix a mismerged that left a stray bdget_disk around
- factour the partition scan at registration time code into a new
helper.

Diffstat:
block/genhd.c | 35 ++++++---------
block/ioctl.c | 13 ++---
drivers/block/nbd.c | 8 +--
drivers/block/pktcdvd.c | 92 +++++-----------------------------------
drivers/block/zram/zram_drv.c | 7 +--
drivers/char/raw.c | 51 ++++++++--------------
drivers/ide/ide-gd.c | 2
drivers/s390/block/dasd_genhd.c | 15 +-----
fs/block_dev.c | 12 ++---
fs/ocfs2/cluster/heartbeat.c | 28 ++++--------
include/linux/blk_types.h | 4 -
include/linux/blkdev.h | 1
include/linux/genhd.h | 2
include/linux/suspend.h | 4 -
include/linux/swap.h | 3 -
kernel/power/swap.c | 21 +++------
kernel/power/user.c | 26 +++--------
mm/swapfile.c | 45 ++++++++++---------
18 files changed, 130 insertions(+), 239 deletions(-)