All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allison Henderson <allison.henderson@oracle.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 04/18] xfsprogs: tag transactions that contain intent done items
Date: Tue, 17 May 2022 17:12:13 -0700	[thread overview]
Message-ID: <20220518001227.1779324-5-allison.henderson@oracle.com> (raw)
In-Reply-To: <20220518001227.1779324-1-allison.henderson@oracle.com>

From: Dave Chinner <dchinner@redhat.com>

Source kernel commit: bb7b1c9c5dd3d24db3f296e365570fd50c8ca80c

Intent whiteouts will require extra work to be done during
transaction commit if the transaction contains an intent done item.

To determine if a transaction contains an intent done item, we want
to avoid having to walk all the items in the transaction to check if
they are intent done items. Hence when we add an intent done item to
a transaction, tag the transaction to indicate that it contains such
an item.

We don't tag the transaction when the defer ops is relogging an
intent to move it forward in the log. Whiteouts will never apply to
these cases, so we don't need to bother looking for them.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
---
 libxfs/xfs_shared.h | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/libxfs/xfs_shared.h b/libxfs/xfs_shared.h
index 25c4cab58851..c4381388c0c1 100644
--- a/libxfs/xfs_shared.h
+++ b/libxfs/xfs_shared.h
@@ -54,13 +54,23 @@ void	xfs_log_get_max_trans_res(struct xfs_mount *mp,
 /*
  * Values for t_flags.
  */
-#define	XFS_TRANS_DIRTY		0x01	/* something needs to be logged */
-#define	XFS_TRANS_SB_DIRTY	0x02	/* superblock is modified */
-#define	XFS_TRANS_PERM_LOG_RES	0x04	/* xact took a permanent log res */
-#define	XFS_TRANS_SYNC		0x08	/* make commit synchronous */
-#define XFS_TRANS_RESERVE	0x20    /* OK to use reserved data blocks */
-#define XFS_TRANS_NO_WRITECOUNT 0x40	/* do not elevate SB writecount */
-#define XFS_TRANS_RES_FDBLKS	0x80	/* reserve newly freed blocks */
+/* Transaction needs to be logged */
+#define XFS_TRANS_DIRTY			(1u << 0)
+/* Superblock is dirty and needs to be logged */
+#define XFS_TRANS_SB_DIRTY		(1u << 1)
+/* Transaction took a permanent log reservation */
+#define XFS_TRANS_PERM_LOG_RES		(1u << 2)
+/* Synchronous transaction commit needed */
+#define XFS_TRANS_SYNC			(1u << 3)
+/* Transaction can use reserve block pool */
+#define XFS_TRANS_RESERVE		(1u << 4)
+/* Transaction should avoid VFS level superblock write accounting */
+#define XFS_TRANS_NO_WRITECOUNT		(1u << 5)
+/* Transaction has freed blocks returned to it's reservation */
+#define XFS_TRANS_RES_FDBLKS		(1u << 6)
+/* Transaction contains an intent done log item */
+#define XFS_TRANS_HAS_INTENT_DONE	(1u << 7)
+
 /*
  * LOWMODE is used by the allocator to activate the lowspace algorithm - when
  * free space is running low the extent allocator may choose to allocate an
-- 
2.25.1


  parent reply	other threads:[~2022-05-18  0:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  0:12 [PATCH 00/18] xfsprogs: Port larp, enable injects and log print for attri/d Allison Henderson
2022-05-18  0:12 ` [PATCH 01/18] xfsprogs: zero inode fork buffer at allocation Allison Henderson
2022-05-18  0:12 ` [PATCH 02/18] xfsprogs: hide log iovec alignment constraints Allison Henderson
2022-05-18  0:12 ` [PATCH 03/18] xfsprogs: don't commit the first deferred transaction without intents Allison Henderson
2022-05-18  0:12 ` Allison Henderson [this message]
2022-05-18  0:12 ` [PATCH 05/18] xfsprogs: Fix double unlock in defer capture code Allison Henderson
2022-05-18  0:12 ` [PATCH 06/18] xfsprogs: Return from xfs_attr_set_iter if there are no more rmtblks to process Allison Henderson
2022-05-18  0:12 ` [PATCH 07/18] xfsprogs: Set up infrastructure for log attribute replay Allison Henderson
2022-05-18  0:12 ` [PATCH 08/18] xfsprogs: Implement attr logging and replay Allison Henderson
2022-05-18  0:31   ` Darrick J. Wong
2022-05-18 16:38     ` Alli
2022-05-18 17:00       ` Darrick J. Wong
2022-05-19 23:11         ` Alli
2022-05-19 23:17           ` Darrick J. Wong
2022-05-18  0:12 ` [PATCH 09/18] xfsprogs: Skip flip flags for delayed attrs Allison Henderson
2022-05-18  0:12 ` [PATCH 10/18] xfsprogs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred Allison Henderson
2022-05-18  0:12 ` [PATCH 11/18] xfsprogs: Remove unused xfs_attr_*_args Allison Henderson
2022-05-18  0:12 ` [PATCH 12/18] xfsprogs: Add log attribute error tag Allison Henderson
2022-05-18  0:12 ` [PATCH 13/18] xfsprogs: Merge xfs_delattr_context into xfs_attr_item Allison Henderson
2022-05-18  0:12 ` [PATCH 14/18] xfsprogs: Add helper function xfs_attr_leaf_addname Allison Henderson
2022-05-18  0:12 ` [PATCH 15/18] xfsprogs: Add helper function xfs_init_attr_trans Allison Henderson
2022-05-18  0:12 ` [PATCH 16/18] xfsprogs: add leaf split error tag Allison Henderson
2022-05-18  0:12 ` [PATCH 17/18] xfsprogs: add leaf to node " Allison Henderson
2022-05-18  0:12 ` [PATCH 18/18] xfsprogs: Add log item printing for ATTRI and ATTRD Allison Henderson
2022-05-18  1:02   ` Darrick J. Wong
2022-05-18 16:38     ` Alli

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=20220518001227.1779324-5-allison.henderson@oracle.com \
    --to=allison.henderson@oracle.com \
    --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.