linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andreas Gruenbacher <agruenba@redhat.com>, linux-xfs@vger.kernel.org
Cc: Dan Williams <dan.j.williams@intel.com>,
	linux-fsdevel@vger.kernel.org, cluster-devel@redhat.com,
	linux-ext4@vger.kernel.org
Subject: [PATCH 6/6] iomap: add a page_done callback
Date: Wed,  6 Jun 2018 12:40:33 +0200	[thread overview]
Message-ID: <20180606104033.4947-7-hch@lst.de> (raw)
In-Reply-To: <20180606104033.4947-1-hch@lst.de>

This will be used by gfs2 to attach data to transactions for the journaled
data mode.  But the concept is generic enough that we might be able to
use it for other purposes like encryption/integrity post-processing in the
future.

Based on a patch from Andreas Gruenbacher.

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

diff --git a/fs/iomap.c b/fs/iomap.c
index f2a491b98b7c..a7ecdd5ddd17 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -201,6 +201,9 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
 				copied, page, NULL);
 	}
 
+	if (iomap->page_done)
+		iomap->page_done(inode, pos, copied, page, iomap);
+
 	if (ret < len)
 		iomap_write_failed(inode, pos, len);
 	return ret;
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 69ef622f650e..474e2255ac6e 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -58,6 +58,14 @@ struct iomap {
 		struct dax_device   *dax_dev;
 		void		    *inline_data;
 	};
+
+	/*
+	 * Called when finished processing a page in the mapping returned in
+	 * thus iomap.  At least for now this is only supported in the buffered
+	 * write path.
+	 */
+	void (*page_done)(struct inode *inode, loff_t pos, unsigned copied,
+			struct page *page, struct iomap *iomap);
 };
 
 /*
-- 
2.14.2

  parent reply	other threads:[~2018-06-06 10:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 10:40 iomap preparations for GFS2 Christoph Hellwig
2018-06-06 10:40 ` [PATCH 1/6] fs: factor out a __generic_write_end helper Christoph Hellwig
2018-06-06 10:59   ` Christoph Hellwig
2018-06-06 11:09     ` Andreas Grünbacher
2018-06-06 10:40 ` [PATCH 2/6] iomap: move bdev and dax_dev in a union Christoph Hellwig
2018-06-06 11:37   ` Andreas Gruenbacher
2018-06-06 12:05     ` Christoph Hellwig
2018-06-06 10:40 ` [PATCH 3/6] iomap: mark newly allocated buffer heads as new Christoph Hellwig
2018-06-06 10:40 ` [PATCH 4/6] iomap: complete partial direct I/O writes synchronously Christoph Hellwig
2018-06-06 10:40 ` [PATCH 5/6] iomap: generic inline data handling Christoph Hellwig
2018-06-07 13:50   ` Andreas Grünbacher
2018-06-06 10:40 ` Christoph Hellwig [this message]
2018-06-06 11:37   ` [PATCH 6/6] iomap: add a page_done callback Andreas Gruenbacher
2018-06-06 11:38 ` iomap preparations for GFS2 Andreas Gruenbacher
2018-06-06 15:31   ` Andreas Grünbacher
2018-06-06 15:39     ` Christoph Hellwig
2018-06-14 12:04 iomap preparations for GFS2 v2 Christoph Hellwig
2018-06-14 12:04 ` [PATCH 6/6] iomap: add a page_done callback 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=20180606104033.4947-7-hch@lst.de \
    --to=hch@lst.de \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-ext4@vger.kernel.org \
    --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).