[PATCH v4 09/21] parallels: Add a note about used bitmap in parallels_check_duplicate()

Alexander Ivanov posted 21 patches 11 months ago
Maintainers: Stefan Hajnoczi <stefanha@redhat.com>, "Denis V. Lunev" <den@openvz.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
[PATCH v4 09/21] parallels: Add a note about used bitmap in parallels_check_duplicate()
Posted by Alexander Ivanov 11 months ago
In parallels_check_duplicate() We use a bitmap for duplication detection.
This bitmap is not related to used_bmap field in BDRVParallelsState. Add
a comment about it to avoid confusion.

Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
 block/parallels.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/parallels.c b/block/parallels.c
index 04c114f696..0ae06ec0b1 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -837,7 +837,10 @@ parallels_check_duplicate(BlockDriverState *bs, BdrvCheckResult *res,
     bool fixed = false;
 
     /*
-     * Create a bitmap of used clusters.
+     * Create a bitmap of used clusters. Please note that this bitmap is not
+     * related to used_bmap field in BDRVParallelsState and is created only for
+     * local usage.
+     *
      * If a bit is set, there is a BAT entry pointing to this cluster.
      * Loop through the BAT entries, check bits relevant to an entry offset.
      * If bit is set, this entry is duplicated. Otherwise set the bit.
-- 
2.40.1
Re: [PATCH v4 09/21] parallels: Add a note about used bitmap in parallels_check_duplicate()
Posted by Denis V. Lunev 10 months, 2 weeks ago
On 12/28/23 11:12, Alexander Ivanov wrote:
> In parallels_check_duplicate() We use a bitmap for duplication detection.
> This bitmap is not related to used_bmap field in BDRVParallelsState. Add
> a comment about it to avoid confusion.
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
> ---
>   block/parallels.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/block/parallels.c b/block/parallels.c
> index 04c114f696..0ae06ec0b1 100644
> --- a/block/parallels.c
> +++ b/block/parallels.c
> @@ -837,7 +837,10 @@ parallels_check_duplicate(BlockDriverState *bs, BdrvCheckResult *res,
>       bool fixed = false;
>   
>       /*
> -     * Create a bitmap of used clusters.
> +     * Create a bitmap of used clusters. Please note that this bitmap is not
> +     * related to used_bmap field in BDRVParallelsState and is created only for
> +     * local usage.
> +     *
>        * If a bit is set, there is a BAT entry pointing to this cluster.
>        * Loop through the BAT entries, check bits relevant to an entry offset.
>        * If bit is set, this entry is duplicated. Otherwise set the bit.
Reviewed-by: Denis V. Lunev <den@openvz.org>