public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 8/9] xfs: introduce new internal log vector structure
Date: Sat, 6 Mar 2010 10:46:10 -0500	[thread overview]
Message-ID: <20100306154610.GA29590@infradead.org> (raw)
In-Reply-To: <1267840284-4652-9-git-send-email-david@fromorbit.com>

On Sat, Mar 06, 2010 at 12:51:23PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> The current log IO vector structure is a flat array and not
> extensible. To make it possible to keep separate log IO vectors for
> individual log items, we need a method of chaining log IO vectors
> together.
> 
> Introduce a new log vector type that can be used to wrap the
> existing log IO vectors on use that internally to the log. This
> means that the existing external interface (xfs_log_write) does not
> change and hence no changes to the transaction commit code are
> required.
> 
> This initial use of the new log vectors does not use the chaining
> capability of the new log vector structure - it is not needed to
> implement the flat vector array the current transaction commit path
> creates.

Looks good to me,


Reviewed-by: Christoph Hellwig <hch@lst.de>

A few comments below:

> +			/* the data section must be 32 bit size aligned */
> +			struct {
> +			    __uint16_t magic;
> +			    __uint16_t pad1;
> +			    __uint32_t pad2; /* may as well make it 64 bits */
> +			} magic = {
> +				.magic = XLOG_UNMOUNT_TYPE,
> +			};
> +			struct xfs_log_iovec reg = {
> +				.i_addr = (void *)&magic,
> +				.i_len = sizeof(magic),
> +				.i_type = XLOG_REG_TYPE_UNMOUNT,
> +			};
> +			struct xfs_log_vec vec = {
> +				.lv_niovecs = 1,
> +			};
> +			/* sigh. c99 initialisers don't work on anon unions */
> +			vec.lv_iovecp = &reg;

I can't see an anonymous union involved anywhere here, and initializing
these normally works just fine (see patch below).

Index: xfs/fs/xfs/xfs_log.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log.c	2010-03-06 16:40:35.817021839 +0100
+++ xfs/fs/xfs/xfs_log.c	2010-03-06 16:41:49.873004518 +0100
@@ -557,9 +557,8 @@ xfs_log_unmount_write(xfs_mount_t *mp)
 			};
 			struct xfs_log_vec vec = {
 				.lv_niovecs = 1,
+				.lv_iovecp = &reg,
 			};
-			/* sigh. c99 initialisers don't work on anon unions */
-			vec.lv_iovecp = &reg;
 
 			/* remove inited flag */
 			tic->t_flags = 0;
@@ -686,9 +685,8 @@ xfs_log_write(
 	int			error;
 	struct xfs_log_vec	vec = {
 		.lv_niovecs = nentries,
+		.lv_iovecp = reg,
 	};
-	/* sigh. c99 initialisers don't work on anon unions */
-	vec.lv_iovecp = reg;
 
 	if (XLOG_FORCED_SHUTDOWN(log))
 		return XFS_ERROR(EIO);
@@ -1201,9 +1199,8 @@ xlog_commit_record(
 	};
 	struct xfs_log_vec vec = {
 		.lv_niovecs = 1,
+		.lv_iovecp = &reg,
 	};
-	/* sigh. c99 initialisers don't work on anon unions */
-	vec.lv_iovecp = &reg;
 
 	ASSERT_ALWAYS(iclog);
 	error = xlog_write(log, &vec, ticket, commitlsnp, iclog,

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2010-03-06 15:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06  1:51 [PATCH 0/9] Log and transaction cleanups, factoring and bug fixes Dave Chinner
2010-03-06  1:51 ` [PATCH 1/9] xfs: factor log item initialisation Dave Chinner
2010-03-06 10:51   ` Christoph Hellwig
2010-03-06  1:51 ` [PATCH 2/9] xfs: Add inode pin counts to traces Dave Chinner
2010-03-06 10:51   ` Christoph Hellwig
2010-03-06  1:51 ` [PATCH 3/9] xfs: remove stale parameter from ->iop_unpin method Dave Chinner
2010-03-06 10:55   ` Christoph Hellwig
2010-03-06  1:51 ` [PATCH 4/9] xfs: fix reservation release commit flag in xfs_bmap_add_attrfork() Dave Chinner
2010-03-06 10:52   ` Christoph Hellwig
2010-03-06  1:51 ` [PATCH 5/9] xfs: split out iclog writing from xfs_trans_commit() Dave Chinner
2010-03-06 11:08   ` Christoph Hellwig
2010-03-06 11:57     ` Dave Chinner
2010-03-06  1:51 ` [PATCH 6/9] xfs: update and factor xfs_trans_committed() Dave Chinner
2010-03-06 11:24   ` Christoph Hellwig
2010-03-06 12:01     ` Dave Chinner
2010-03-06  1:51 ` [PATCH 7/9] xfs: log ticket reservation underestimates the number of iclogs Dave Chinner
2010-03-15  2:13   ` Dave Chinner
2010-03-06  1:51 ` [PATCH 8/9] xfs: introduce new internal log vector structure Dave Chinner
2010-03-06 11:31   ` Christoph Hellwig
2010-03-06 12:06     ` Dave Chinner
2010-03-06 15:46   ` Christoph Hellwig [this message]
2010-03-08  1:16     ` Dave Chinner
2010-03-06  1:51 ` [PATCH 9/9] xfs: factor xlog_write and make use of new " Dave Chinner
2010-03-06 15:48   ` Christoph Hellwig
2010-03-06 10:56 ` [PATCH 0/9] Log and transaction cleanups, factoring and bug fixes Christoph Hellwig
2010-03-09 11:39 ` Christoph Hellwig
2010-03-09 11:48   ` Dave Chinner

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=20100306154610.GA29590@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox