|
|
Log in / Subscribe / Register

add a ->free_disk block_device_operation v2

From:  Christoph Hellwig <hch-AT-lst.de>
To:  Jens Axboe <axboe-AT-kernel.dk>
Subject:  add a ->free_disk block_device_operation v2
Date:  Wed, 09 Feb 2022 09:21:15 +0100
Message-ID:  <20220209082121.2628452-1-hch@lst.de>
Cc:  "Michael S. Tsirkin" <mst-AT-redhat.com>, Jason Wang <jasowang-AT-redhat.com>, Paolo Bonzini <pbonzini-AT-redhat.com>, Stefan Hajnoczi <stefanha-AT-redhat.com>, Maxim Levitsky <maximlevitsky-AT-gmail.com>, Alex Dubov <oakad-AT-yahoo.com>, Ulf Hansson <ulf.hansson-AT-linaro.org>, linux-block-AT-vger.kernel.org, virtualization-AT-lists.linux-foundation.org, linux-mmc-AT-vger.kernel.org
Archive-link:  Article

Hi Jens,

this series adds a ->free_disk method to struct block_device_operation so that
drivers can defer freeing their disk private data until the gendisk goes away
and don't need to play games with the validity of ->private_data.

This also converts three simple drivers over as example, but eventually I
imagine that all drivers with private data will use it.

Changes since v1:
 - fix a tag_set use after free in virtio_blk

Diffstat:
 block/genhd.c                       |    4 +
 drivers/block/virtio_blk.c          |   74 ++++++++++--------------------------
 drivers/memstick/core/ms_block.c    |   64 +++++++------------------------
 drivers/memstick/core/ms_block.h    |    1 
 drivers/memstick/core/mspro_block.c |   57 ++++-----------------------
 include/linux/blkdev.h              |    1 
 6 files changed, 51 insertions(+), 150 deletions(-)


Copyright © 2022, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds