From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Chandan Babu R <chandan.babu@oracle.com>,
"Darrick J. Wong" <djwong@kernel.org>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 7/8] xfs: remove struct xfs_attr_shortform
Date: Mon, 18 Dec 2023 08:12:12 +1100 [thread overview]
Message-ID: <ZX9kLBb6vYGsQMhy@dread.disaster.area> (raw)
In-Reply-To: <20231217170350.605812-8-hch@lst.de>
On Sun, Dec 17, 2023 at 06:03:49PM +0100, Christoph Hellwig wrote:
> sparse complains about struct xfs_attr_shortform because it embedds a
embeds
> structure with a variable sized array in a variable sized array.
>
> Given that xfs_attr_shortform is not a very useful struture, and the dir2
> equivalent has been removed a long time ago, remove it as well and
> instead provide a xfs_attr_sf_firstentry helper that returns the first
> xfs_attr_sf_entry behind a xfs_attr_sf_hdr.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
....
> diff --git a/fs/xfs/libxfs/xfs_da_format.h b/fs/xfs/libxfs/xfs_da_format.h
> index f9015f88eca706..650fedce40449e 100644
> --- a/fs/xfs/libxfs/xfs_da_format.h
> +++ b/fs/xfs/libxfs/xfs_da_format.h
> @@ -580,18 +580,17 @@ xfs_dir2_block_leaf_p(struct xfs_dir2_block_tail *btp)
> /*
> * Entries are packed toward the top as tight as possible.
> */
> -struct xfs_attr_shortform {
> - struct xfs_attr_sf_hdr { /* constant-structure header block */
> - __be16 totsize; /* total bytes in shortform list */
> - __u8 count; /* count of active entries */
> - __u8 padding;
> - } hdr;
> - struct xfs_attr_sf_entry {
> - uint8_t namelen; /* actual length of name (no NULL) */
> - uint8_t valuelen; /* actual length of value (no NULL) */
> - uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */
> - uint8_t nameval[]; /* name & value bytes concatenated */
> - } list[]; /* variable sized array */
> +struct xfs_attr_sf_hdr { /* constant-structure header block */
> + __be16 totsize; /* total bytes in shortform list */
> + __u8 count; /* count of active entries */
> + __u8 padding;
> +};
> +
> +struct xfs_attr_sf_entry {
> + __u8 namelen; /* actual length of name (no NULL) */
> + __u8 valuelen; /* actual length of value (no NULL) */
> + __u8 flags; /* flags bits (see xfs_attr_leaf.h) */
May as well correct the comment while you are touching this
structure; xfs_attr_leaf.h has not existed for a long time. Perhaps
just "/* XFS_ATTR_* flags */" as they are defined a little further
down this same file...
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2023-12-17 21:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-17 17:03 attr cleanups Christoph Hellwig
2023-12-17 17:03 ` [PATCH 1/8] xfs: make if_data a void pointer Christoph Hellwig
2023-12-18 22:31 ` Darrick J. Wong
2023-12-19 4:20 ` Christoph Hellwig
2023-12-19 4:48 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 2/8] xfs: return if_data from xfs_idata_realloc Christoph Hellwig
2023-12-18 22:29 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 3/8] xfs: move the xfs_attr_sf_lookup tracepoint Christoph Hellwig
2023-12-18 22:39 ` Darrick J. Wong
2023-12-19 4:21 ` Christoph Hellwig
2023-12-19 4:52 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 4/8] xfs: simplify xfs_attr_sf_findname Christoph Hellwig
2023-12-18 22:35 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 5/8] xfs: remove xfs_attr_shortform_lookup Christoph Hellwig
2023-12-18 22:37 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 6/8] xfs: use xfs_attr_sf_findname in xfs_attr_shortform_getvalue Christoph Hellwig
2023-12-18 22:37 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 7/8] xfs: remove struct xfs_attr_shortform Christoph Hellwig
2023-12-17 21:12 ` Dave Chinner [this message]
2023-12-18 4:30 ` Christoph Hellwig
2023-12-18 22:41 ` Darrick J. Wong
2023-12-17 17:03 ` [PATCH 8/8] xfs: remove xfs_attr_sf_hdr_t Christoph Hellwig
2023-12-18 22:39 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2023-12-19 12:08 attr cleanups v2 Christoph Hellwig
2023-12-19 12:08 ` [PATCH 7/8] xfs: remove struct xfs_attr_shortform Christoph Hellwig
2023-12-19 17:35 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZX9kLBb6vYGsQMhy@dread.disaster.area \
--to=david@fromorbit.com \
--cc=chandan.babu@oracle.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.