All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Cc: "Gustavo A . R . Silva" <gustavoars@kernel.org>
Subject: [PATCH 1/7] xfs: remove the EFD size asserts in xlog_recover_efd_commit_pass2
Date: Mon, 19 Apr 2021 10:27:58 +0200	[thread overview]
Message-ID: <20210419082804.2076124-2-hch@lst.de> (raw)
In-Reply-To: <20210419082804.2076124-1-hch@lst.de>

We never actually look at the extent array in the efd items, and should
eventually stop writing them out at all when it is time for a incompat
log change.  Ѕo don't bother with the asserts at all, and thus with the
the structures defined just to be used with it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/libxfs/xfs_log_format.h | 20 ++------------------
 fs/xfs/xfs_extfree_item.c      | 10 ++--------
 fs/xfs/xfs_extfree_item.h      |  2 +-
 fs/xfs/xfs_ondisk.h            |  2 --
 4 files changed, 5 insertions(+), 29 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index 8bd00da6d2a40f..ea0fe9f121adff 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -598,29 +598,13 @@ typedef struct xfs_efi_log_format_64 {
  * log.  The efd_extents array is a variable size array whose
  * size is given by efd_nextents;
  */
-typedef struct xfs_efd_log_format {
+struct xfs_efd_log_format {
 	uint16_t		efd_type;	/* efd log item type */
 	uint16_t		efd_size;	/* size of this item */
 	uint32_t		efd_nextents;	/* # of extents freed */
 	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_t		efd_extents[1];	/* array of extents freed */
-} xfs_efd_log_format_t;
-
-typedef struct xfs_efd_log_format_32 {
-	uint16_t		efd_type;	/* efd log item type */
-	uint16_t		efd_size;	/* size of this item */
-	uint32_t		efd_nextents;	/* # of extents freed */
-	uint64_t		efd_efi_id;	/* id of corresponding efi */
-	xfs_extent_32_t		efd_extents[1];	/* array of extents freed */
-} __attribute__((packed)) xfs_efd_log_format_32_t;
-
-typedef struct xfs_efd_log_format_64 {
-	uint16_t		efd_type;	/* efd log item type */
-	uint16_t		efd_size;	/* size of this item */
-	uint32_t		efd_nextents;	/* # of extents freed */
-	uint64_t		efd_efi_id;	/* id of corresponding efi */
-	xfs_extent_64_t		efd_extents[1];	/* array of extents freed */
-} xfs_efd_log_format_64_t;
+};
 
 /*
  * RUI/RUD (reverse mapping) log format definitions
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index 93223ebb33721e..ac17fdb9283489 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -253,7 +253,7 @@ static inline int
 xfs_efd_item_sizeof(
 	struct xfs_efd_log_item *efdp)
 {
-	return sizeof(xfs_efd_log_format_t) +
+	return sizeof(struct xfs_efd_log_format) +
 	       (efdp->efd_format.efd_nextents - 1) * sizeof(xfs_extent_t);
 }
 
@@ -743,13 +743,7 @@ xlog_recover_efd_commit_pass2(
 	struct xlog_recover_item	*item,
 	xfs_lsn_t			lsn)
 {
-	struct xfs_efd_log_format	*efd_formatp;
-
-	efd_formatp = item->ri_buf[0].i_addr;
-	ASSERT((item->ri_buf[0].i_len == (sizeof(xfs_efd_log_format_32_t) +
-		((efd_formatp->efd_nextents - 1) * sizeof(xfs_extent_32_t)))) ||
-	       (item->ri_buf[0].i_len == (sizeof(xfs_efd_log_format_64_t) +
-		((efd_formatp->efd_nextents - 1) * sizeof(xfs_extent_64_t)))));
+	struct xfs_efd_log_format	*efd_formatp = item->ri_buf[0].i_addr;
 
 	xlog_recover_release_intent(log, XFS_LI_EFI, efd_formatp->efd_efi_id);
 	return 0;
diff --git a/fs/xfs/xfs_extfree_item.h b/fs/xfs/xfs_extfree_item.h
index cd2860c875bf50..6b80452ad2a71b 100644
--- a/fs/xfs/xfs_extfree_item.h
+++ b/fs/xfs/xfs_extfree_item.h
@@ -61,7 +61,7 @@ struct xfs_efd_log_item {
 	struct xfs_log_item	efd_item;
 	struct xfs_efi_log_item *efd_efip;
 	uint			efd_next_extent;
-	xfs_efd_log_format_t	efd_format;
+	struct xfs_efd_log_format efd_format;
 };
 
 /*
diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h
index 0aa87c2101049c..7328ff92e0ee8a 100644
--- a/fs/xfs/xfs_ondisk.h
+++ b/fs/xfs/xfs_ondisk.h
@@ -118,8 +118,6 @@ xfs_check_ondisk_structs(void)
 	/* log structures */
 	XFS_CHECK_STRUCT_SIZE(struct xfs_buf_log_format,	88);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_dq_logformat,		24);
-	XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_32,	28);
-	XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_64,	32);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_32,	28);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_64,	32);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_extent_32,		12);
-- 
2.30.1


  reply	other threads:[~2021-04-19  8:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  8:27 cleanup the EFI/EFD definitions Christoph Hellwig
2021-04-19  8:27 ` Christoph Hellwig [this message]
2021-04-20 16:26   ` [PATCH 1/7] xfs: remove the EFD size asserts in xlog_recover_efd_commit_pass2 Darrick J. Wong
2021-04-19  8:27 ` [PATCH 2/7] xfs: clean up the EFI and EFD log format handling Christoph Hellwig
2021-04-20 17:05   ` Darrick J. Wong
2021-04-21  5:55     ` Christoph Hellwig
2021-04-22  0:19       ` Darrick J. Wong
2021-04-19  8:28 ` [PATCH 3/7] xfs: pass a xfs_efi_log_item to xfs_efi_item_sizeof Christoph Hellwig
2021-04-20 17:09   ` Darrick J. Wong
2021-04-21  5:56     ` Christoph Hellwig
2021-04-22  0:29       ` Darrick J. Wong
2021-04-19  8:28 ` [PATCH 4/7] xfs: pass a xfs_efd_log_item to xfs_efd_item_sizeof Christoph Hellwig
2021-04-20 17:10   ` Darrick J. Wong
2021-04-19  8:28 ` [PATCH 5/7] xfs: add a xfs_efi_item_sizeof helper Christoph Hellwig
2021-04-20 17:11   ` Darrick J. Wong
2021-04-19  8:28 ` [PATCH 6/7] xfs: add a xfs_efd_item_sizeof helper Christoph Hellwig
2021-04-20 17:12   ` Darrick J. Wong
2021-04-19  8:28 ` [PATCH 7/7] xfs: Replace one-element arrays with flexible-array members Christoph Hellwig
2021-04-20 17:15   ` Darrick J. Wong
2021-04-20 22:16   ` Gustavo A. R. Silva

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=20210419082804.2076124-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=gustavoars@kernel.org \
    --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.