mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
block: introduce holder ops
Add a new blk_holder_ops structure, which is passed to blkdev_get_by_* and installed in the block_device for exclusive claims. It will be used to allow the block layer to call back into the user of the block device for thing like notification of a removed device or a device resize. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Link: https://lore.kernel.org/r/20230601094459.1350643-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
00080f7fb7
commit
0718afd47f
34 changed files with 90 additions and 56 deletions
|
@ -1470,10 +1470,15 @@ void blkdev_show(struct seq_file *seqf, off_t offset);
|
|||
#define BLKDEV_MAJOR_MAX 0
|
||||
#endif
|
||||
|
||||
struct blk_holder_ops {
|
||||
};
|
||||
|
||||
struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder,
|
||||
const struct blk_holder_ops *hops);
|
||||
struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
|
||||
void *holder);
|
||||
struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder);
|
||||
int bd_prepare_to_claim(struct block_device *bdev, void *holder);
|
||||
void *holder, const struct blk_holder_ops *hops);
|
||||
int bd_prepare_to_claim(struct block_device *bdev, void *holder,
|
||||
const struct blk_holder_ops *hops);
|
||||
void bd_abort_claiming(struct block_device *bdev, void *holder);
|
||||
void blkdev_put(struct block_device *bdev, fmode_t mode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue