diff mbox series

[8/8] xfs: remove xfs_attr_sf_hdr_t

Message ID 20231217170350.605812-9-hch@lst.de (mailing list archive)
State Superseded
Headers show
Series [1/8] xfs: make if_data a void pointer | expand

Commit Message

Christoph Hellwig Dec. 17, 2023, 5:03 p.m. UTC
Remove the last two users of the typedef and move the comment next to
its declaration to a more useful place.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/libxfs/xfs_attr_leaf.c | 4 ++--
 fs/xfs/libxfs/xfs_attr_sf.h   | 8 --------
 fs/xfs/libxfs/xfs_da_format.h | 5 ++++-
 3 files changed, 6 insertions(+), 11 deletions(-)

Comments

Darrick J. Wong Dec. 18, 2023, 10:39 p.m. UTC | #1
On Sun, Dec 17, 2023 at 06:03:50PM +0100, Christoph Hellwig wrote:
> Remove the last two users of the typedef and move the comment next to
> its declaration to a more useful place.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Woo, fewer typedefs.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/libxfs/xfs_attr_leaf.c | 4 ++--
>  fs/xfs/libxfs/xfs_attr_sf.h   | 8 --------
>  fs/xfs/libxfs/xfs_da_format.h | 5 ++++-
>  3 files changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index e1281ab413c832..6374bf10724207 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -816,7 +816,7 @@ xfs_attr_sf_removename(
>  	/*
>  	 * Fix up the start offset of the attribute fork
>  	 */
> -	if (totsize == sizeof(xfs_attr_sf_hdr_t) && xfs_has_attr2(mp) &&
> +	if (totsize == sizeof(struct xfs_attr_sf_hdr) && xfs_has_attr2(mp) &&
>  	    (dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
>  	    !(args->op_flags & (XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE))) {
>  		xfs_attr_fork_remove(dp, args->trans);
> @@ -824,7 +824,7 @@ xfs_attr_sf_removename(
>  		xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);
>  		dp->i_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);
>  		ASSERT(dp->i_forkoff);
> -		ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) ||
> +		ASSERT(totsize > sizeof(struct xfs_attr_sf_hdr) ||
>  				(args->op_flags & XFS_DA_OP_ADDNAME) ||
>  				!xfs_has_attr2(mp) ||
>  				dp->i_df.if_format == XFS_DINODE_FMT_BTREE);
> diff --git a/fs/xfs/libxfs/xfs_attr_sf.h b/fs/xfs/libxfs/xfs_attr_sf.h
> index a1d5ef88ca2673..0600b4e408fa36 100644
> --- a/fs/xfs/libxfs/xfs_attr_sf.h
> +++ b/fs/xfs/libxfs/xfs_attr_sf.h
> @@ -6,14 +6,6 @@
>  #ifndef __XFS_ATTR_SF_H__
>  #define	__XFS_ATTR_SF_H__
>  
> -/*
> - * Attribute storage when stored inside the inode.
> - *
> - * Small attribute lists are packed as tightly as possible so as
> - * to fit into the literal area of the inode.
> - */
> -typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
> -
>  /*
>   * We generate this then sort it, attr_list() must return things in hash-order.
>   */
> diff --git a/fs/xfs/libxfs/xfs_da_format.h b/fs/xfs/libxfs/xfs_da_format.h
> index 650fedce40449e..dcfe2fe9edc385 100644
> --- a/fs/xfs/libxfs/xfs_da_format.h
> +++ b/fs/xfs/libxfs/xfs_da_format.h
> @@ -578,7 +578,10 @@ xfs_dir2_block_leaf_p(struct xfs_dir2_block_tail *btp)
>  #define XFS_ATTR_LEAF_MAPSIZE	3	/* how many freespace slots */
>  
>  /*
> - * Entries are packed toward the top as tight as possible.
> + * Attribute storage when stored inside the inode.
> + *
> + * Small attribute lists are packed as tightly as possible so as
> + * to fit into the literal area of the inode.
>   */
>  struct xfs_attr_sf_hdr {	/* constant-structure header block */
>  	__be16	totsize;	/* total bytes in shortform list */
> -- 
> 2.39.2
> 
>
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index e1281ab413c832..6374bf10724207 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -816,7 +816,7 @@  xfs_attr_sf_removename(
 	/*
 	 * Fix up the start offset of the attribute fork
 	 */
-	if (totsize == sizeof(xfs_attr_sf_hdr_t) && xfs_has_attr2(mp) &&
+	if (totsize == sizeof(struct xfs_attr_sf_hdr) && xfs_has_attr2(mp) &&
 	    (dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
 	    !(args->op_flags & (XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE))) {
 		xfs_attr_fork_remove(dp, args->trans);
@@ -824,7 +824,7 @@  xfs_attr_sf_removename(
 		xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);
 		dp->i_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);
 		ASSERT(dp->i_forkoff);
-		ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) ||
+		ASSERT(totsize > sizeof(struct xfs_attr_sf_hdr) ||
 				(args->op_flags & XFS_DA_OP_ADDNAME) ||
 				!xfs_has_attr2(mp) ||
 				dp->i_df.if_format == XFS_DINODE_FMT_BTREE);
diff --git a/fs/xfs/libxfs/xfs_attr_sf.h b/fs/xfs/libxfs/xfs_attr_sf.h
index a1d5ef88ca2673..0600b4e408fa36 100644
--- a/fs/xfs/libxfs/xfs_attr_sf.h
+++ b/fs/xfs/libxfs/xfs_attr_sf.h
@@ -6,14 +6,6 @@ 
 #ifndef __XFS_ATTR_SF_H__
 #define	__XFS_ATTR_SF_H__
 
-/*
- * Attribute storage when stored inside the inode.
- *
- * Small attribute lists are packed as tightly as possible so as
- * to fit into the literal area of the inode.
- */
-typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
-
 /*
  * We generate this then sort it, attr_list() must return things in hash-order.
  */
diff --git a/fs/xfs/libxfs/xfs_da_format.h b/fs/xfs/libxfs/xfs_da_format.h
index 650fedce40449e..dcfe2fe9edc385 100644
--- a/fs/xfs/libxfs/xfs_da_format.h
+++ b/fs/xfs/libxfs/xfs_da_format.h
@@ -578,7 +578,10 @@  xfs_dir2_block_leaf_p(struct xfs_dir2_block_tail *btp)
 #define XFS_ATTR_LEAF_MAPSIZE	3	/* how many freespace slots */
 
 /*
- * Entries are packed toward the top as tight as possible.
+ * Attribute storage when stored inside the inode.
+ *
+ * Small attribute lists are packed as tightly as possible so as
+ * to fit into the literal area of the inode.
  */
 struct xfs_attr_sf_hdr {	/* constant-structure header block */
 	__be16	totsize;	/* total bytes in shortform list */