Thread (20 messages) 20 messages, 6 authors, 2023-07-31

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

From: Haris Iqbal <haris.iqbal@ionos.com>
Date: 2023-07-12 16:06:53
Also in: dm-devel, linux-bcache, linux-block, linux-btrfs, linux-f2fs-devel, linux-fsdevel, linux-mm, linux-nfs, linux-nvme, linux-pm, linux-raid, linux-s390, linux-scsi, linux-xfs, target-devel, xen-devel

On Thu, Jul 6, 2023 at 5:38 PM Christoph Hellwig [off-list ref] wrote:
On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
quoted
Create struct bdev_handle that contains all parameters that need to be
passed to blkdev_put() and provide blkdev_get_handle_* functions that
return this structure instead of plain bdev pointer. This will
eventually allow us to pass one more argument to blkdev_put() without
too much hassle.
Can we use the opportunity to come up with better names?  blkdev_get_*
was always a rather horrible naming convention for something that
ends up calling into ->open.

What about:

struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
                const struct blk_holder_ops *hops);
struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
                void *holder, const struct blk_holder_ops *hops);
void bdev_release(struct bdev_handle *handle);
+1 to this.
Also, if we are removing "handle" from the function, should the name
of the structure it returns also change? Would something like bdev_ctx
be better?

(Apologies for the previous non-plaintext email)
?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help