linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
Cc: Sergey Meirovich <rathamahata@gmail.com>
Subject: [PATCH 2/3] xfs: always use unwritten extents for direct I/O writes
Date: Tue, 04 Feb 2014 09:24:04 -0800	[thread overview]
Message-ID: <20140204172516.641738827@bombadil.infradead.org> (raw)
In-Reply-To: 20140204172402.380571745@bombadil.infradead.org

[-- Attachment #1: 0002-xfs-always-use-unwritten-extents-for-direct-I-O-writ.patch --]
[-- Type: text/plain, Size: 1447 bytes --]

To allow aio writes beyond i_size we need to create unwritten extents for
newly allocated blocks, similar to how we already do inside i_size.

Instead of adding another special case we now use unwritten extents
unconditionally.  This also marks the end of directly allocation data
extents in all of XFS - we now always use either delalloc or unwritten
extents.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_iomap.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 22d1cbe..3b80eba 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -128,7 +128,6 @@ xfs_iomap_write_direct(
 	xfs_fsblock_t	firstfsb;
 	xfs_extlen_t	extsz, temp;
 	int		nimaps;
-	int		bmapi_flag;
 	int		quota_flag;
 	int		rt;
 	xfs_trans_t	*tp;
@@ -200,18 +199,15 @@ xfs_iomap_write_direct(
 
 	xfs_trans_ijoin(tp, ip, 0);
 
-	bmapi_flag = 0;
-	if (offset < XFS_ISIZE(ip) || extsz)
-		bmapi_flag |= XFS_BMAPI_PREALLOC;
-
 	/*
 	 * From this point onwards we overwrite the imap pointer that the
 	 * caller gave to us.
 	 */
 	xfs_bmap_init(&free_list, &firstfsb);
 	nimaps = 1;
-	error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, bmapi_flag,
-				&firstfsb, 0, imap, &nimaps, &free_list);
+	error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
+				XFS_BMAPI_PREALLOC, &firstfsb, 0,
+				imap, &nimaps, &free_list);
 	if (error)
 		goto out_bmap_cancel;
 
-- 
1.7.10.4



  parent reply	other threads:[~2014-02-04 17:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 17:24 [PATCH 0/3] support appending AIO writes Christoph Hellwig
2014-02-04 17:24 ` [PATCH 1/3] direct-io: add flag to allow aio writes beyond i_size Christoph Hellwig
2014-02-04 17:24 ` Christoph Hellwig [this message]
2014-02-04 17:24 ` [PATCH 3/3] xfs: allow appending aio writes Christoph Hellwig
2014-02-04 22:29 ` [PATCH 0/3] support appending AIO writes Dave Chinner
2014-02-05  6:57   ` Christoph Hellwig
2014-02-05  7:59     ` Dave Chinner
2014-02-05 13:55     ` Al Viro
2014-02-05 14:52 ` Sergey Meirovich
2014-02-06 16:29   ` Sergey Meirovich
2014-02-06 22:51     ` Dave Chinner
2014-02-07  9:40       ` Sergey Meirovich

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=20140204172516.641738827@bombadil.infradead.org \
    --to=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rathamahata@gmail.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;
as well as URLs for NNTP newsgroup(s).