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

2023-07-31 Thread Christoph Hellwig
On Mon, Jul 31, 2023 at 12:50:34PM +0200, Jan Kara wrote: > I think the bdev_handle name is fine for the struct. After all it is > equivalent of an open handle for the block device so IMHO bdev_handle > captures that better than bdev_ctx. Agreed. -- dm-devel mailing list dm-devel@redhat.com https

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

2023-07-31 Thread Jan Kara
On Wed 12-07-23 18:06:35, Haris Iqbal wrote: > On Thu, Jul 6, 2023 at 5:38 PM Christoph Hellwig wrote: > > > > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > > Create struct bdev_handle that contains all parameters that need to be > > > passed to blkdev_put() and provide blkdev_get_

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

2023-07-12 Thread Haris Iqbal
On Thu, Jul 6, 2023 at 5:38 PM Christoph Hellwig wrote: > > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > 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 inste

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

2023-07-12 Thread Haris Iqbal
On Thu, Jul 6, 2023 at 5:38 PM Christoph Hellwig wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > 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 instea

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

2023-07-09 Thread Matthew Wilcox
On Tue, Jul 04, 2023 at 07:06:26AM -0700, Bart Van Assche wrote: > On 7/4/23 05:21, Jan Kara wrote: > > +struct bdev_handle { > > + struct block_device *bdev; > > + void *holder; > > +}; > > Please explain in the patch description why a holder pointer is introduced > in struct bdev_handle and

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

2023-07-09 Thread Jan Kara
On Tue 04-07-23 10:28:36, Keith Busch wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > > + void *holder, const struct blk_holder_ops *hops) > > +{ > > + struct bdev_handle *handle = kmalloc

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

2023-07-09 Thread Bart Van Assche
On 7/4/23 09:14, Matthew Wilcox wrote: On Tue, Jul 04, 2023 at 07:06:26AM -0700, Bart Van Assche wrote: On 7/4/23 05:21, Jan Kara wrote: +struct bdev_handle { + struct block_device *bdev; + void *holder; +}; Please explain in the patch description why a holder pointer is introduce

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

2023-07-09 Thread Jan Kara
On Tue 04-07-23 07:06:26, Bart Van Assche wrote: > On 7/4/23 05:21, Jan Kara wrote: > > +struct bdev_handle { > > + struct block_device *bdev; > > + void *holder; > > +}; > > Please explain in the patch description why a holder pointer is introduced > in struct bdev_handle and how it relates t

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

2023-07-09 Thread Jan Kara
On Tue 04-07-23 13:43:51, Matthew Wilcox wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > > + void *holder, const struct blk_holder_ops *hops) > > +{ > > + struct bdev_handle *handle = kmal

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

2023-07-07 Thread Jan Kara
On Fri 07-07-23 04:28:41, Christoph Hellwig wrote: > On Thu, Jul 06, 2023 at 06:14:33PM +0200, Jan Kara wrote: > > > 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

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

2023-07-07 Thread Christoph Hellwig
On Thu, Jul 06, 2023 at 06:14:33PM +0200, Jan Kara wrote: > > 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); > > I'd maybe use bdev_close() instead of bdev_releas

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

2023-07-06 Thread Jan Kara
On Thu 06-07-23 08:38:40, Christoph Hellwig wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > 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 pl

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

2023-07-06 Thread Christoph Hellwig
On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > 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 o

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

2023-07-04 Thread Keith Busch
On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > + void *holder, const struct blk_holder_ops *hops) > +{ > + struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle), > +

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

2023-07-04 Thread Bart Van Assche
On 7/4/23 05:21, Jan Kara wrote: +struct bdev_handle { + struct block_device *bdev; + void *holder; +}; Please explain in the patch description why a holder pointer is introduced in struct bdev_handle and how it relates to the bd_holder pointer in struct block_device. Is one of th

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

2023-07-04 Thread Matthew Wilcox
On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > + void *holder, const struct blk_holder_ops *hops) > +{ > + struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle), > +

[dm-devel] [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Jan Kara
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. CC: Ala