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 4/7] xfs: split direct IO write path from xfs_file_aio_write
Date: Thu, 16 Dec 2010 07:06:29 -0500	[thread overview]
Message-ID: <20101216120629.GC20445@infradead.org> (raw)
In-Reply-To: <1292376208-16282-5-git-send-email-david@fromorbit.com>

> +STATIC ssize_t
> +xfs_file_dio_aio_write(
> +	struct kiocb		*iocb,
> +	const struct iovec	*iovp,
> +	unsigned long		nr_segs,
> +	loff_t			pos,
> +	size_t			ocount,
> +	int			*need_i_mutex,
> +	int			*iolock)

need_i_mutex == 1 is equivalent to iolock == XFS_IOLOCK_EXCL, I think
it's a good idea to throw in a patch to remove the need_i_mutex variable
before this patch.

Maybe that patch can even add xfs_rw_lock or similar helpers to
manipulate the i_mutex, the iolock, and the iolock variable together?

Speaking of that, shouldn't xfs_file_aio_read also take the iolock
exclusive during the page invalidation and then demote it, just like
the write case?  The above helpers would enforce that nicely.

> +	if ((pos & target->bt_smask) || (count & target->bt_smask))
> +		return XFS_ERROR(-EINVAL);

For the error traps to work this needs to be

	-XFS_ERROR(EINVAL);

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

  reply	other threads:[~2010-12-16 12:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15  1:23 [PATCH 0/7] xfs: serialise unaligned direct IOs Dave Chinner
2010-12-15  1:23 ` [PATCH 1/7] xfs: ensure sync write errors are returned Dave Chinner
2010-12-16 11:57   ` Christoph Hellwig
2010-12-16 21:57     ` Dave Chinner
2010-12-16 20:50   ` Alex Elder
2010-12-17  6:43     ` Dave Chinner
2010-12-15  1:23 ` [PATCH 2/7] xfs: factor common post-write isize handling code Dave Chinner
2010-12-15  1:23 ` [PATCH 4/7] xfs: split direct IO write path from xfs_file_aio_write Dave Chinner
2010-12-16 12:06   ` Christoph Hellwig [this message]
2010-12-17  7:31     ` Dave Chinner
2010-12-20 11:29       ` Christoph Hellwig
2010-12-21  0:51         ` Dave Chinner
2010-12-15  1:23 ` [PATCH 5/7] xfs: split buffered " Dave Chinner
2010-12-15  1:23 ` [PATCH 6/7] xfs: factor common write setup code Dave Chinner
2010-12-15  1:23 ` [PATCH 7/7] xfs: serialise unaligned direct IOs 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=20101216120629.GC20445@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