Thread (143 messages) 143 messages, 5 authors, 2021-05-27

Re: [PATCH 21/45] xfs: embed the xlog_op_header in the unmount record

From: Dave Chinner <david@fromorbit.com>
Date: 2021-03-11 02:55:31

On Mon, Mar 08, 2021 at 04:15:23PM -0800, Darrick J. Wong wrote:
On Fri, Mar 05, 2021 at 04:11:19PM +1100, Dave Chinner wrote:
quoted
From: Dave Chinner <redacted>

Remove another case where xlog_write() has to prepend an opheader to
a log transaction. The unmount record + ophdr is smaller than the
minimum amount of space guaranteed to be free in an iclog (2 *
sizeof(ophdr)) and so we don't have to care about an unmount record
being split across 2 iclogs.

Signed-off-by: Dave Chinner <redacted>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_log.c | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index b2f9fb1b4fed..94711b9ff007 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -798,12 +798,22 @@ xlog_write_unmount_record(
 	struct xlog		*log,
 	struct xlog_ticket	*ticket)
 {
-	struct xfs_unmount_log_format ulf = {
-		.magic = XLOG_UNMOUNT_TYPE,
+	struct  {
+		struct xlog_op_header ophdr;
+		struct xfs_unmount_log_format ulf;
+	} unmount_rec = {
I wonder, should we have a BUILD_BUG_ON to confirm sizeof(umount_rec)
just in case some weird architecture injects padding between these two?
Prior to this code we formatted the op header and unmount record in
separate incore buffers and wrote them to disk with no gap, right?
Yup. Easy enough to add.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help