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

Jan Kara <[email protected]>
Newsgroups gmane.linux.kernel.drbd.devel,gmane.linux.kernel.device-mapper.devel,gmane.linux.scsi.target.devel,gmane.linux.drivers.mtd,gmane.comp.file-systems.nilfs.user,gmane.linux.scsi,gmane.comp.emulators.xen.devel,gmane.linux.power-management.general,gmane.comp.file-systems.reiserfs.general,gmane.linux.block,gmane.linux.kernel.bcache.devel,gmane.linux.raid,gmane.linux.nfs,gmane.comp.file-systems.ext4,gmane.linux.kernel.mm,gmane.linux.file-systems.f2fs,gmane.comp.file-systems.ocfs2.devel,gmane.linux.file-systems,gmane.comp.file-systems.btrfs
Message-ID <20230731105034.43skhi5ubze563c3@quack3>
On Wed 12-07-23 18:06:35, Haris Iqbal wrote:
> On Thu, Jul 6, 2023 at 5:38 PM Christoph Hellwig <[email protected]> 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 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?

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.

								Honza
-- 
Jan Kara <[email protected]>
SUSE Labs, CR
_______________________________________________
drbd-dev mailing list
[email protected]
https://lists.linbit.com/mailman/listinfo/drbd-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.