[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum |
Date: |
Mon, 28 Jun 2021 14:10:44 -0500 |
User-agent: |
NeoMutt/20210205-557-802118 |
> > > +++ b/include/block/block_int.h
> > > @@ -347,6 +347,11 @@ struct BlockDriver {
> > > * clamped to bdrv_getlength() and aligned to request_alignment,
> > > * as well as non-NULL pnum, map, and file; in turn, the driver
> > > * must return an error or set pnum to an aligned non-zero value.
> > > + *
> > > + * Note that @bytes is just a hint on how big of a region the
> > > + * caller wants to inspect. It is not a limit on *pnum.
> > > + * Implementations are free to return larger values of *pnum if
> > > + * doing so does not incur a performance penalty.
> >
> > Worth mention that the cache will benefit of it?
>
> Oh, right, absolutely. Like so:
>
> "block/io.c's bdrv_co_block_status() will clamp *pnum before returning it to
> its caller, but it itself can still make use of the unclamped *pnum value.
> Specifically, the block-status cache for protocol nodes will benefit from
> storing as large a region as possible."
How about this tweak to the wording to make it flow a little better:
block/io.c's bdrv_co_block_status() will utilize an unclamped *pnum
value for the block-status cache on protocol nodes, prior to clamping
*pnum for return to its caller.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[PATCH v2 6/6] block/iscsi: Do not force-cap *pnum, Max Reitz, 2021/06/23
[PATCH v2 2/6] block: block-status cache for data regions, Max Reitz, 2021/06/23
[PATCH v2 4/6] block/file-posix: Do not force-cap *pnum, Max Reitz, 2021/06/23
[PATCH v2 5/6] block/gluster: Do not force-cap *pnum, Max Reitz, 2021/06/23