Re: [PATCH 07/13] libfrog: fix bitmap error communication problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/25/19 4:34 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> Convert all the libfrog code and callers away from the libc-style
> indirect errno returns to directly returning error codes to callers.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  libfrog/bitmap.c |   13 +++++++------
>  libfrog/bitmap.h |    2 +-
>  repair/rmap.c    |    4 ++--
>  scrub/phase6.c   |   20 +++++++++++---------
>  4 files changed, 21 insertions(+), 18 deletions(-)
> 
> 
> diff --git a/libfrog/bitmap.c b/libfrog/bitmap.c
> index 4dafc4c9..be95965f 100644
> --- a/libfrog/bitmap.c
> +++ b/libfrog/bitmap.c
> @@ -23,7 +23,8 @@
>   */
>  
>  #define avl_for_each_range_safe(pos, n, l, first, last) \
> -	for (pos = (first), n = pos->avl_nextino, l = (last)->avl_nextino; pos != (l); \
> +	for (pos = (first), n = pos->avl_nextino, l = (last)->avl_nextino; \
> +			pos != (l); \
>  			pos = n, n = pos ? pos->avl_nextino : NULL)

unrelated cosmetic change? *shrug* ok may as well :)

>  
>  #define avl_for_each_safe(tree, pos, n) \
> @@ -67,18 +68,18 @@ static struct avl64ops bitmap_ops = {
>  
>  /* Initialize a bitmap. */
>  int
> -bitmap_init(
> +bitmap_alloc(
>  	struct bitmap		**bmapp)
>  {
>  	struct bitmap		*bmap;
>  
>  	bmap = calloc(1, sizeof(struct bitmap));
>  	if (!bmap)

sooooo (!bmap) /could/ be success if sizeof(struct bitmap) is zero, but I think
it's safe to ignore that case :)

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux