Re: [PATCH v2 7/6] xfs_db: add missing string name for DBM_COWDATA

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

 




On 11/28/18 6:54 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> In db/check.c, typename[] is supposed to have strings for every DBM_
> type, but we forgot one.  Add it now.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
> v2: add build time check
> ---
>  db/check.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/db/check.c b/db/check.c
> index 352aab3f..442600be 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -164,8 +164,19 @@ static const char	*typename[] = {
>  	"btrmap",
>  	"btrefcnt",
>  	"rldata",
> +	"cowdata",
>  	NULL
>  };
> +
> +/*
> + * Make sure typename has the same number of elements as there are DBM types.
> + * This function isn't called anywhere; we just use it to trip up the compiler.
> + */
> +static inline void check_typename(void)
> +{
> +	BUILD_BUG_ON(ARRAY_SIZE(typename) != DBM_NDBM + 1);
> +}
> +
>  static int		verbose;
>  
>  #define	CHECK_BLIST(b)	(blist_size && check_blist(b))

Seems ok, if it won't cause unused warnings ...

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