All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/17] Make O_SYNC handling use standard syncing path (Version 2)
@ 2009-08-21 17:23 Jan Kara
  2009-08-21 17:23 ` [PATCH 01/17] vfs: Introduce filemap_fdatawait_range Jan Kara
                   ` (17 more replies)
  0 siblings, 18 replies; 64+ messages in thread
From: Jan Kara @ 2009-08-21 17:23 UTC (permalink / raw)
  To: LKML; +Cc: hch, linux-fsdevel

   Hi,

  first, sorry for a few patches sent before this one - I forgot to give
--compose to git send-email and there was a bug in the third patch.
  This is the second version of my patch set improving O_SYNC implementation.
The changes against previous version are small. Most notably
generic_file_aio_write() now triggers fsync() even when it returns EIOCBQUEUED
so that we behave the same way as generic_file_direct_write() did. I've
added patch renaming generic_file_aio_write_nolock() to device_aio_write()
(since it's used by fs/block_dev.c and drivers/char/raw.c). And finally
I've optimized XFS syncing as Christoph has suggested.
  Any comments welcome and BTW I'd be happy if affected fs maintainers
had a look at those patches so that I can add their ack.
									Honza
---
  Here's some rationale for the patch set:
The patch set unifines O_SYNC handling with standard fsync() path.  After this,
we have just one place forcing a single file to disk so filesystems like ext3 /
ext4 don't have to force a transaction commit in ext?_file_write for O_SYNC
files / IS_SYNC inodes.  The code is also cleaner this way (actually about 150
lines shorter), we don't sync the inode several times as it happened previously
etc.


^ permalink raw reply	[flat|nested] 64+ messages in thread
* [PATCH 01/17] vfs: Introduce filemap_fdatawait_range
@ 2009-08-21 16:59 Jan Kara
  2009-08-21 16:59 ` [PATCH 08/17] ext2: Update comment about generic_osync_inode Jan Kara
  0 siblings, 1 reply; 64+ messages in thread
From: Jan Kara @ 2009-08-21 16:59 UTC (permalink / raw)
  To: LKML; +Cc: hch, linux-fsdevel, Jan Kara

This simple helper saves some filesystems conversion from byte offset
to page numbers and also makes the fdata* interface more complete.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 include/linux/fs.h |    2 ++
 mm/filemap.c       |   20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 67888a9..cb365ad 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2076,6 +2076,8 @@ 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_fdatawait(struct address_space *);
+extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
+				   loff_t lend);
 extern int filemap_write_and_wait(struct address_space *mapping);
 extern int filemap_write_and_wait_range(struct address_space *mapping,
 				        loff_t lstart, loff_t lend);
diff --git a/mm/filemap.c b/mm/filemap.c
index ccea3b6..65b2e50 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -307,6 +307,26 @@ int wait_on_page_writeback_range(struct address_space *mapping,
 }
 
 /**
+ * filemap_fdatawait_range - wait for all under-writeback pages to complete in a given range
+ * @mapping: address space structure to wait for
+ * @start:	offset in bytes where the range starts
+ * @end:	offset in bytes where the range ends (inclusive)
+ *
+ * Walk the list of under-writeback pages of the given address space
+ * in the given range and wait for all of them.
+ *
+ * This is just a simple wrapper so that callers don't have to convert offsets
+ * to page indexes themselves
+ */
+int filemap_fdatawait_range(struct address_space *mapping, loff_t start,
+			    loff_t end)
+{
+	return wait_on_page_writeback_range(mapping, start >> PAGE_CACHE_SHIFT,
+					    end >> PAGE_CACHE_SHIFT);
+}
+EXPORT_SYMBOL(filemap_fdatawait_range);
+
+/**
  * sync_page_range - write and wait on all pages in the passed range
  * @inode:	target inode
  * @mapping:	target address_space
-- 
1.6.0.2


^ permalink raw reply related	[flat|nested] 64+ messages in thread
* [PATCH 0/17] Make O_SYNC handling use standard syncing path
@ 2009-08-19 16:04 Jan Kara
  2009-08-19 16:04 ` [PATCH 08/17] ext2: Update comment about generic_osync_inode Jan Kara
  0 siblings, 1 reply; 64+ messages in thread
From: Jan Kara @ 2009-08-19 16:04 UTC (permalink / raw)
  To: LKML; +Cc: hch


  Hi,

  below comes a patch series that unifies O_SYNC handling with code doing
fsync(). After this, we have just one place forcing a single file to disk so
filesystems like ext3 / ext4 don't have to force a transaction commit in
ext?_file_write for O_SYNC files / IS_SYNC inodes.
  The code is also cleaner this way (actually about 150 lines shorter), we
don't sync the inode several times as it happened previously etc.
  The patchset touches quite some filesystems. Hopefully I've added all the
relevant people to CC for the relevant patches. I've tested via blktrace that
for ext?, xfs, ocfs2 and fat, the file is indeed forced to disk as expected.
Maintainers of pohmelfs and NTFS might want to check that everything works
as expected for them after applying the patches.
  Comments / review welcome.

								Honza

^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2009-08-30 17:30 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-21 17:23 [PATCH 0/17] Make O_SYNC handling use standard syncing path (Version 2) Jan Kara
2009-08-21 17:23 ` [PATCH 01/17] vfs: Introduce filemap_fdatawait_range Jan Kara
2009-08-21 17:23 ` [PATCH 02/17] vfs: Export __generic_file_aio_write() and add some comments Jan Kara
2009-08-21 17:23   ` [Ocfs2-devel] " Jan Kara
2009-08-21 17:23   ` Jan Kara
2009-08-21 17:23 ` [PATCH 03/17] vfs: Remove syncing from generic_file_direct_write() and generic_file_buffered_write() Jan Kara
2009-08-21 17:23   ` [Ocfs2-devel] " Jan Kara
2009-08-21 17:23   ` Jan Kara
2009-08-21 17:23   ` Jan Kara
2009-08-21 17:23 ` [PATCH 04/17] pohmelfs: Use __generic_file_aio_write instead of generic_file_aio_write_nolock Jan Kara
2009-08-21 17:23 ` [PATCH 05/17] ocfs2: " Jan Kara
2009-08-21 17:23   ` [Ocfs2-devel] " Jan Kara
2009-08-21 17:23   ` Jan Kara
2009-08-25 18:58   ` Joel Becker
2009-08-25 18:58     ` [Ocfs2-devel] " Joel Becker
2009-08-25 18:58     ` Joel Becker
2009-08-21 17:23 ` [PATCH 06/17] vfs: Rename generic_file_aio_write_nolock Jan Kara
2009-08-21 17:30   ` Christoph Hellwig
2009-08-21 17:56     ` Jan Kara
2009-08-21 18:07       ` Christoph Hellwig
2009-08-21 17:23 ` [PATCH 07/17] vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode Jan Kara
2009-08-21 17:24   ` [Ocfs2-devel] " Jan Kara
2009-08-21 17:23   ` Jan Kara
2009-08-27 17:35   ` Christoph Hellwig
2009-08-27 17:35     ` [Ocfs2-devel] " Christoph Hellwig
2009-08-27 17:35     ` Christoph Hellwig
2009-08-30 16:35     ` Jamie Lokier
2009-08-30 16:36       ` [Ocfs2-devel] " Jamie Lokier
2009-08-30 16:35       ` Jamie Lokier
2009-08-30 16:39       ` Christoph Hellwig
2009-08-30 16:40         ` [Ocfs2-devel] " Christoph Hellwig
2009-08-30 16:39         ` Christoph Hellwig
2009-08-30 17:29         ` Jamie Lokier
2009-08-30 17:30           ` [Ocfs2-devel] " Jamie Lokier
2009-08-30 17:29           ` Jamie Lokier
2009-08-21 17:23 ` [PATCH 08/17] ext2: Update comment about generic_osync_inode Jan Kara
2009-08-21 17:23 ` [PATCH 09/17] ext3: Remove syncing logic from ext3_file_write Jan Kara
2009-08-21 17:24 ` [PATCH 10/17] ext4: Remove syncing logic from ext4_file_write Jan Kara
2009-08-21 17:24 ` [PATCH 11/17] ntfs: Use new syncing helpers and update comments Jan Kara
2009-08-21 17:24 ` [PATCH 12/17] ocfs2: Update syncing after splicing to match generic version Jan Kara
2009-08-21 17:24   ` [Ocfs2-devel] " Jan Kara
2009-08-21 17:24   ` Jan Kara
2009-08-24 18:35   ` [Ocfs2-devel] " Mark Fasheh
2009-08-24 18:35     ` Mark Fasheh
2009-08-24 18:40     ` Joel Becker
2009-08-24 18:40       ` Joel Becker
2009-08-25 13:13       ` Jan Kara
2009-08-25 13:13         ` Jan Kara
2009-08-21 17:24 ` [PATCH 13/17] xfs: Convert sync_page_range() to simple fdatawrite_range() Jan Kara
2009-08-21 17:24   ` Jan Kara
2009-08-21 17:28   ` Christoph Hellwig
2009-08-21 17:28     ` Christoph Hellwig
2009-08-21 17:59     ` Jan Kara
2009-08-21 17:59       ` Jan Kara
2009-08-21 17:24 ` [PATCH 14/17] pohmelfs: Use new syncing helper Jan Kara
2009-08-21 17:24 ` [PATCH 15/17] nfs: Remove reference to generic_osync_inode from a comment Jan Kara
2009-08-21 17:52   ` Trond Myklebust
2009-08-21 17:52     ` Trond Myklebust
2009-08-21 17:24 ` [PATCH 16/17] fat: Opencode sync_page_range_nolock() Jan Kara
2009-08-21 17:24 ` [PATCH 17/17] vfs: Remove generic_osync_inode() and sync_page_range{_nolock}() Jan Kara
2009-08-22 16:27 ` [PATCH 0/17] Make O_SYNC handling use standard syncing path (Version 2) Jamie Lokier
2009-08-24  9:29   ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2009-08-21 16:59 [PATCH 01/17] vfs: Introduce filemap_fdatawait_range Jan Kara
2009-08-21 16:59 ` [PATCH 08/17] ext2: Update comment about generic_osync_inode Jan Kara
2009-08-19 16:04 [PATCH 0/17] Make O_SYNC handling use standard syncing path Jan Kara
2009-08-19 16:04 ` [PATCH 08/17] ext2: Update comment about generic_osync_inode Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.