linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add invalidate_disk() helper for drivers to invalidate the gendisk
@ 2021-09-22 12:37 Xie Yongji
  2021-09-22 12:37 ` [PATCH v2 1/4] block: Add invalidate_disk() helper " Xie Yongji
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Xie Yongji @ 2021-09-22 12:37 UTC (permalink / raw)
  To: axboe, josef, hch; +Cc: linux-block, nbd, yixingchen

This series comes from Christoph Hellwig's suggestion [1]. Some block
device drivers such as loop driver and nbd driver need to invalidate
the gendisk when the backend is detached so that the gendisk can be
reused by the new backend. Now the invalidation is done in device
driver with their own ways. To avoid code duplication and hide
some internals of the implementation, this series adds a block layer
helper and makes both loop driver and nbd driver use it.

[1] https://lore.kernel.org/all/YTmqJHd7YWAQ2lZ7@infradead.org/

V1 to V2:
- Rename invalidate_gendisk() to invalidate_disk()
- Add a cleanup patch to remove bdev checks and bdev variable in __loop_clr_fd()

Xie Yongji (4):
  block: Add invalidate_disk() helper to invalidate the gendisk
  loop: Use invalidate_disk() helper to invalidate gendisk
  loop: Remove the unnecessary bdev checks and unused bdev variable
  nbd: Use invalidate_disk() helper on disconnect

 block/genhd.c         | 20 ++++++++++++++++++++
 drivers/block/loop.c  | 15 ++++-----------
 drivers/block/nbd.c   | 12 +++---------
 include/linux/genhd.h |  2 ++
 4 files changed, 29 insertions(+), 20 deletions(-)

-- 
2.11.0


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

end of thread, other threads:[~2021-10-21 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 12:37 [PATCH v2 0/4] Add invalidate_disk() helper for drivers to invalidate the gendisk Xie Yongji
2021-09-22 12:37 ` [PATCH v2 1/4] block: Add invalidate_disk() helper " Xie Yongji
2021-09-22 14:41   ` Christoph Hellwig
2021-09-22 12:37 ` [PATCH v2 2/4] loop: Use invalidate_disk() helper to invalidate gendisk Xie Yongji
2021-09-22 12:37 ` [PATCH v2 3/4] loop: Remove the unnecessary bdev checks and unused bdev variable Xie Yongji
2021-09-22 14:43   ` Christoph Hellwig
2021-09-22 12:37 ` [PATCH v2 4/4] nbd: Use invalidate_disk() helper on disconnect Xie Yongji
2021-09-22 14:47   ` Christoph Hellwig
2021-10-21  3:41 ` [PATCH v2 0/4] Add invalidate_disk() helper for drivers to invalidate the gendisk Yongji Xie
2021-10-21 16:12 ` Jens Axboe

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