xfs
[Top] [All Lists]

Re: [PATCH 5/9] xfs: struct xfs_buf_log_format isn't variable sized.

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 5/9] xfs: struct xfs_buf_log_format isn't variable sized.
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 20 Jun 2012 02:36:12 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1339133914-11148-6-git-send-email-david@xxxxxxxxxxxxx>
References: <1339133914-11148-1-git-send-email-david@xxxxxxxxxxxxx> <1339133914-11148-6-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
I like this patch with two minor nitpicks below.  Given that it's a mostly
unrelated cleanup I'd also propagate it to the first patch in the
series.

> +     base_size = sizeof(struct xfs_buf_log_format) -
> +                 ((XFS_BLF_DATAMAP_SIZE - bip->bli_format.blf_map_size) *
> +                                                             sizeof(uint));

I'd really move this calculation and the comment describing it into a
macro/inline in the header, next to the defintion of struct xfs_buf_log_format.

Also I'd probably rewrite the expressions as:

        offsetoff(struct xfs_buf_log_format, blf_map) +
                (blf->blf_map_size * sizeof(blf->blf_data_map[0]));

>  /*
> + * Minimum and maximum blocksize and sectorsize.
> + * The blocksize upper limit is pretty much arbitrary.
> + * The sectorsize upper limit is due to sizeof(sb_sectsize).
> + */
> +#define XFS_MIN_BLOCKSIZE_LOG        9       /* i.e. 512 bytes */
> +#define XFS_MAX_BLOCKSIZE_LOG        16      /* i.e. 65536 bytes */
> +#define XFS_MIN_BLOCKSIZE    (1 << XFS_MIN_BLOCKSIZE_LOG)
> +#define XFS_MAX_BLOCKSIZE    (1 << XFS_MAX_BLOCKSIZE_LOG)
> +#define XFS_MIN_SECTORSIZE_LOG       9       /* i.e. 512 bytes */
> +#define XFS_MAX_SECTORSIZE_LOG       15      /* i.e. 32768 bytes */
> +#define XFS_MIN_SECTORSIZE   (1 << XFS_MIN_SECTORSIZE_LOG)
> +#define XFS_MAX_SECTORSIZE   (1 << XFS_MAX_SECTORSIZE_LOG)

While I agree with the move of these constants, what does it have to do
with this patch?

<Prev in Thread] Current Thread [Next in Thread>