From: Jan Kara <jack@suse.cz>
To: hch@infradead.org
Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: [PATCH 1/2] vfs: Create filemap_flush_range()
Date: Wed, 3 Aug 2011 22:49:04 +0200 [thread overview]
Message-ID: <1312404545-15400-2-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1312404545-15400-1-git-send-email-jack@suse.cz>
Create a version of filemap_flush() function which can take a range.
Signed-off-by: Jan Kara <jack@suse.cz>
---
include/linux/fs.h | 2 ++
mm/filemap.c | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 786b3b1..091cf90 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2177,6 +2177,8 @@ extern int invalidate_inode_pages2_range(struct address_space *mapping,
extern int write_inode_now(struct inode *, int);
extern int filemap_fdatawrite(struct address_space *);
extern int filemap_flush(struct address_space *);
+extern int filemap_flush_range(struct address_space *mapping, loff_t start,
+ loff_t end);
extern int filemap_fdatawait(struct address_space *);
extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
loff_t lend);
diff --git a/mm/filemap.c b/mm/filemap.c
index 867d402..8fd2347 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -253,6 +253,22 @@ int filemap_flush(struct address_space *mapping)
EXPORT_SYMBOL(filemap_flush);
/**
+ * filemap_flush_range - mostly a non-blocking flush of a mapping range
+ * @mapping: target address_space
+ * @start: offset in bytes where the range starts
+ * @end: offset in bytes where the range ends (inclusive)
+ *
+ * This is a mostly non-blocking flush. Not suitable for data-integrity
+ * purposes - I/O may not be started against all dirty pages.
+ */
+int filemap_flush_range(struct address_space *mapping, loff_t start,
+ loff_t end)
+{
+ return __filemap_fdatawrite_range(mapping, start, end, WB_SYNC_NONE);
+}
+EXPORT_SYMBOL(filemap_flush_range);
+
+/**
* filemap_fdatawait_range - wait for writeback to complete
* @mapping: address space structure to wait for
* @start_byte: offset in bytes where the range starts
--
1.7.1
next prev parent reply other threads:[~2011-08-03 20:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-03 20:49 [PATCH 0/2] Improve writeout pattern from xfs_flush_pages() Jan Kara
2011-08-03 20:49 ` Jan Kara [this message]
2011-08-03 20:49 ` [PATCH 2/2] xfs: Call filemap_flush_range() for async xfs_flush_pages() call Jan Kara
2011-08-03 22:03 ` Christoph Hellwig
2011-08-03 22:34 ` Vivek Goyal
2011-08-04 10:03 ` Jan Kara
2011-08-03 21:42 ` [PATCH 0/2] Improve writeout pattern from xfs_flush_pages() Christoph Hellwig
2011-08-04 10:36 ` Jan Kara
2011-08-04 10:42 ` Christoph Hellwig
2011-08-04 12:07 ` Jan Kara
2011-08-04 12:19 ` Christoph Hellwig
2011-08-04 12:37 ` Jan Kara
2011-08-04 12:41 ` 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=1312404545-15400-2-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--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).