diff mbox series

[4/7] xfs: pass a xfs_efd_log_item to xfs_efd_item_sizeof

Message ID 20210419082804.2076124-5-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/7] xfs: remove the EFD size asserts in xlog_recover_efd_commit_pass2 | expand

Commit Message

Christoph Hellwig April 19, 2021, 8:28 a.m. UTC
xfs_efd_log_item only looks at the embedded xfs_efd_log_item structure,
so pass that directly and rename the function to xfs_efd_log_item_sizeof.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_extfree_item.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Darrick J. Wong April 20, 2021, 5:10 p.m. UTC | #1
On Mon, Apr 19, 2021 at 10:28:01AM +0200, Christoph Hellwig wrote:
> xfs_efd_log_item only looks at the embedded xfs_efd_log_item structure,
> so pass that directly and rename the function to xfs_efd_log_item_sizeof.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_extfree_item.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
> index 7ae570d1944590..f15d6cfca6e2f1 100644
> --- a/fs/xfs/xfs_extfree_item.c
> +++ b/fs/xfs/xfs_extfree_item.c
> @@ -195,11 +195,11 @@ xfs_efd_item_free(struct xfs_efd_log_item *efdp)
>   * structure.
>   */
>  static inline int
> -xfs_efd_item_sizeof(
> -	struct xfs_efd_log_item *efdp)
> +xfs_efd_log_item_sizeof(

Same naming complaint as the last patch, though the code changes
themselves look fine to me.

--D

> +	struct xfs_efd_log_format *elf)
>  {
>  	return sizeof(struct xfs_efd_log_format) +
> -	       (efdp->efd_format.efd_nextents - 1) * sizeof(struct xfs_extent);
> +	       (elf->efd_nextents - 1) * sizeof(struct xfs_extent);
>  }
>  
>  STATIC void
> @@ -209,7 +209,7 @@ xfs_efd_item_size(
>  	int			*nbytes)
>  {
>  	*nvecs += 1;
> -	*nbytes += xfs_efd_item_sizeof(EFD_ITEM(lip));
> +	*nbytes += xfs_efd_log_item_sizeof(&EFD_ITEM(lip)->efd_format);
>  }
>  
>  /*
> @@ -234,7 +234,7 @@ xfs_efd_item_format(
>  
>  	xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_EFD_FORMAT,
>  			&efdp->efd_format,
> -			xfs_efd_item_sizeof(efdp));
> +			xfs_efd_log_item_sizeof(&efdp->efd_format));
>  }
>  
>  /*
> -- 
> 2.30.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index 7ae570d1944590..f15d6cfca6e2f1 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -195,11 +195,11 @@  xfs_efd_item_free(struct xfs_efd_log_item *efdp)
  * structure.
  */
 static inline int
-xfs_efd_item_sizeof(
-	struct xfs_efd_log_item *efdp)
+xfs_efd_log_item_sizeof(
+	struct xfs_efd_log_format *elf)
 {
 	return sizeof(struct xfs_efd_log_format) +
-	       (efdp->efd_format.efd_nextents - 1) * sizeof(struct xfs_extent);
+	       (elf->efd_nextents - 1) * sizeof(struct xfs_extent);
 }
 
 STATIC void
@@ -209,7 +209,7 @@  xfs_efd_item_size(
 	int			*nbytes)
 {
 	*nvecs += 1;
-	*nbytes += xfs_efd_item_sizeof(EFD_ITEM(lip));
+	*nbytes += xfs_efd_log_item_sizeof(&EFD_ITEM(lip)->efd_format);
 }
 
 /*
@@ -234,7 +234,7 @@  xfs_efd_item_format(
 
 	xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_EFD_FORMAT,
 			&efdp->efd_format,
-			xfs_efd_item_sizeof(efdp));
+			xfs_efd_log_item_sizeof(&efdp->efd_format));
 }
 
 /*