linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, avi@scylladb.com
Subject: [PATCH 09/10] iomap: add a IOMAP_DIO_NOALLOC flag
Date: Tue, 12 Jan 2021 17:26:15 +0100	[thread overview]
Message-ID: <20210112162616.2003366-10-hch@lst.de> (raw)
In-Reply-To: <20210112162616.2003366-1-hch@lst.de>

Add a flag to request that the iomap instances do not allocate blocks
by translating it to another new IOMAP_NOALLOC flag.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/iomap/direct-io.c  | 2 ++
 include/linux/iomap.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 96dc72debc4b79..a01f1d182685b4 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -436,6 +436,8 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
 
 	if (is_sync_kiocb(iocb))
 		dio_flags |= IOMAP_DIO_FORCE_WAIT;
+	if (dio_flags & IOMAP_DIO_NOALLOC)
+		flags |= IOMAP_NOALLOC;
 
 	dio = kmalloc(sizeof(*dio), GFP_KERNEL);
 	if (!dio)
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index e7865654dd0dca..a92890d5dc6799 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -122,6 +122,7 @@ struct iomap_page_ops {
 #define IOMAP_FAULT		(1 << 3) /* mapping for page fault */
 #define IOMAP_DIRECT		(1 << 4) /* direct I/O */
 #define IOMAP_NOWAIT		(1 << 5) /* do not block */
+#define IOMAP_NOALLOC		(1 << 6) /* do not allocate blocks */
 
 struct iomap_ops {
 	/*
@@ -257,6 +258,7 @@ struct iomap_dio_ops {
 };
 
 #define IOMAP_DIO_FORCE_WAIT	(1 << 0)	/* force waiting for I/O */
+#define IOMAP_DIO_NOALLOC	(1 << 1)	/* do not allocate blocks */
 
 ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
 		const struct iomap_ops *ops, const struct iomap_dio_ops *dops,
-- 
2.29.2


  parent reply	other threads:[~2021-01-12 16:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 16:26 [RFC] another attempt to reduce sub-block DIO serialisation Christoph Hellwig
2021-01-12 16:26 ` [PATCH 01/10] xfs: factor out a xfs_ilock_iocb helper Christoph Hellwig
2021-01-12 22:41   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 02/10] xfs: make xfs_file_aio_write_checks IOCB_NOWAIT-aware Christoph Hellwig
2021-01-12 22:42   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 03/10] xfs: cleanup the read/write helper naming Christoph Hellwig
2021-01-12 22:43   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 04/10] xfs: remove the buffered I/O fallback assert Christoph Hellwig
2021-01-12 22:44   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 05/10] xfs: simplify the read/write tracepoints Christoph Hellwig
2021-01-12 22:54   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 06/10] xfs: improve the reflink_bounce_dio_write tracepoint Christoph Hellwig
2021-01-12 22:56   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 07/10] xfs: split unaligned DIO write code out Christoph Hellwig
2021-01-12 23:00   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 08/10] iomap: pass a flags argument to iomap_dio_rw Christoph Hellwig
2021-01-12 16:26 ` Christoph Hellwig [this message]
2021-01-12 23:29   ` [PATCH 09/10] iomap: add a IOMAP_DIO_NOALLOC flag Dave Chinner
2021-01-13 15:32     ` Brian Foster
2021-01-13 22:49       ` Dave Chinner
2021-01-14 10:23         ` Brian Foster
2021-01-14 10:43           ` Avi Kivity
2021-01-14 17:29       ` Christoph Hellwig
2021-01-14 17:26     ` Christoph Hellwig
2021-01-12 16:26 ` [PATCH 10/10] xfs: reduce exclusive locking on unaligned dio Christoph Hellwig

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=20210112162616.2003366-10-hch@lst.de \
    --to=hch@lst.de \
    --cc=avi@scylladb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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).