Skip to content

RFC block: *add_disk*() driver conversions __register_blkdev()

Luis Chamberlain linux-block lkml oe-kbuild-all 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12floppy: fix add_disk() assumption on exitdrivers/block/floppy.c+0 -130 replies
2/12floppy: use blk_cleanup_disk()drivers/block/floppy.c+1 -50 replies
3/12floppy: add error handling support for add_disk()drivers/block/floppy.c+11 -40 replies
4/12scsi/sd: use blk_cleanup_queue() insted of put_disk()drivers/scsi/sd.c+1 -10 replies
5/12scsi/sd: add error handling support for add_disk()drivers/scsi/sd.c+5 -10 replies
6/12scsi/sr: use blk_cleanup_disk() instead of put_disk()drivers/scsi/sr.c+1 -10 replies
7/12scsi/sr: add error handling support for add_disk()drivers/scsi/sr.c+4 -10 replies
8/12block/ataflop: use the blk_cleanup_disk() helperdrivers/block/ataflop.c+2 -40 replies
9/12block/ataflop: add a helper for removing disksdrivers/block/ataflop.c+18 -130 replies
10/12block/ataflop add error handling support for add_disk()drivers/block/ataflop.c+6 -70 replies
11/12block/brd: add error handling support for add_disk()drivers/block/brd.c+8 -20 replies
12/12block: make probe in blk_request_module() return an errorblock/genhd.c drivers/block/ataflop.c drivers/block/brd.c +5 more+50 -240 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/12] block: *add_disk*() driver conversions __register_blkdev()

This is the 4th group of driver conversion examples. This set is complete, as there are only a few drivers which use __register_blkdev(). The __register_blkdev() call uses an optional probe call, and if set will be used when blk_request_module() is called for the block device. Since these probe calls can fail, now that we added *add_disk*() error handling, take advatage of this and extend the probe call to capture the errors.

There are only a few drivers which benefit from this. The meat of the work is the last patch, which includes all driver conversions. The rest of the patches are adding add_disk() error handling in the other places of the drivers.

Luis Chamberlain (12):
floppy: fix add_disk() assumption on exit
floppy: use blk_cleanup_disk()
floppy: add error handling support for add_disk() scsi/sd: use blk_cleanup_queue() insted of put_disk() scsi/sd: add error handling support for add_disk() scsi/sr: use blk_cleanup_disk() instead of put_disk() scsi/sr: add error handling support for add_disk() block/ataflop: use the blk_cleanup_disk() helper block/ataflop: add a helper for removing disks block/ataflop add error handling support for add_disk() block/brd: add error handling support for add_disk()
block: make probe in blk_request_module() return an error

 block/genhd.c           | 15 ++++++----
 drivers/block/ataflop.c | 66 ++++++++++++++++++++++++-----------------
 drivers/block/brd.c     | 17 ++++++++---
 drivers/block/floppy.c  | 48 ++++++++++++++----------------
 drivers/block/loop.c    |  6 ++--
 drivers/scsi/sd.c       | 11 +++++--
 drivers/scsi/sr.c       |  7 +++--
 fs/block_dev.c          |  5 +++-
 include/linux/genhd.h   |  4 +--
 9 files changed, 105 insertions(+), 74 deletions(-)
Signature · 1 line
2.27.0