ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] remove blkdev_get as a public API
@ 2020-09-17 16:57 Christoph Hellwig
  2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 01/14] block: move the NEED_PART_SCAN flag to struct gendisk Christoph Hellwig
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Christoph Hellwig @ 2020-09-17 16:57 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Josef Bacik, Minchan Kim, Stefan Haberland, Jan Hoeppner,
	Joseph Qi, Rafael J. Wysocki, Pavel Machek, Len Brown,
	Andrew Morton, linux-kernel, nbd, linux-ide, linux-s390,
	linux-fsdevel, ocfs2-devel, linux-pm, linux-mm, linux-block

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.

Diffstat:
 block/genhd.c                   |   11 ++--
 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 |   13 +----
 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, 119 insertions(+), 224 deletions(-)

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [Ocfs2-devel] remove blkdev_get as a public API v2
@ 2020-09-21  7:19 Christoph Hellwig
  2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 03/14] block: cleanup blkdev_bszset Christoph Hellwig
  0 siblings, 1 reply; 24+ messages in thread
From: Christoph Hellwig @ 2020-09-21  7:19 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Josef Bacik, Minchan Kim, Stefan Haberland, Jan Hoeppner,
	Joseph Qi, Rafael J. Wysocki, Pavel Machek, Len Brown,
	Andrew Morton, linux-kernel, nbd, linux-ide, linux-s390,
	linux-fsdevel, ocfs2-devel, linux-pm, linux-mm, linux-block

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(-)

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-09-24  8:56 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 16:57 [Ocfs2-devel] remove blkdev_get as a public API Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 01/14] block: move the NEED_PART_SCAN flag to struct gendisk Christoph Hellwig
2020-09-24  8:56   ` Jan Kara
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 02/14] block: switch register_disk to use blkdev_get_by_dev Christoph Hellwig
2020-09-18  8:52   ` Sergei Shtylyov
2020-09-19  5:15     ` Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 03/14] block: cleanup blkdev_bszset Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 04/14] pktcdvd: remove the if 0'ed pkt_start_recovery function Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 05/14] pktcdvd: use blkdev_get_by_dev instead of open coding it Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 06/14] zram: cleanup backing_dev_store Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 07/14] raw: don't keep unopened block device around Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 08/14] dasd: cleanup dasd_scan_partitions Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 09/14] ocfs2: cleanup o2hb_region_dev_store Christoph Hellwig
2020-09-18  2:11   ` Joseph Qi
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 10/14] mm: cleanup claim_swapfile Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 11/14] PM: rewrite is_hibernate_resume_dev to not require an inode Christoph Hellwig
2020-09-17 17:26   ` Rafael J. Wysocki
2020-09-19  9:06   ` Pavel Machek
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 12/14] mm: split swap_type_of Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 13/14] PM: mm: cleanup swsusp_swap_check Christoph Hellwig
2020-09-18 16:01   ` Rafael J. Wysocki
2020-09-19  9:06   ` Pavel Machek
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 14/14] block: mark blkdev_get static Christoph Hellwig
2020-09-21  7:19 [Ocfs2-devel] remove blkdev_get as a public API v2 Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 03/14] block: cleanup blkdev_bszset Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).