Christoph Hellwig 4c728ef583 add a vfs_fsync helper
Fsync currently has a fdatawrite/fdatawait pair around the method call,
and a mutex_lock/unlock of the inode mutex.  All callers of fsync have
to duplicate this, but we have a few and most of them don't quite get
it right.  This patch adds a new vfs_fsync that takes care of this.
It's a little more complicated as usual as ->fsync might get a NULL file
pointer and just a dentry from nfsd, but otherwise gets afile and we
want to take the mapping and file operations from it when it is there.

Notes on the fsync callers:

 - ecryptfs wasn't calling filemap_fdatawrite / filemap_fdatawait on the
   	lower file
 - coda wasn't calling filemap_fdatawrite / filemap_fdatawait on the host
	file, and returning 0 when ->fsync was missing
 - shm wasn't calling either filemap_fdatawrite / filemap_fdatawait nor
   taking i_mutex.  Now given that shared memory doesn't have disk
   backing not doing anything in fsync seems fine and I left it out of
   the vfs_fsync conversion for now, but in that case we might just
   not pass it through to the lower file at all but just call the no-op
   simple_sync_file directly.

[and now actually export vfs_fsync]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2009-01-05 11:54:28 -05:00
..
2008-12-25 11:40:09 +11:00
2009-01-05 11:53:07 -05:00
2008-10-31 00:56:28 -07:00
2009-01-05 11:54:28 -05:00
2009-01-05 11:54:28 -05:00
2008-11-25 16:51:45 -08:00
2009-01-05 11:54:28 -05:00
2008-12-31 18:07:43 -05:00
2008-12-31 18:07:44 -05:00
2008-12-31 18:07:44 -05:00
2008-11-14 10:39:25 +11:00
2008-12-31 18:07:44 -05:00
2008-12-30 16:51:43 -05:00
2008-12-30 16:51:43 -05:00
2009-01-05 11:54:28 -05:00
2008-10-17 02:38:36 +11:00
2009-01-05 11:54:27 -05:00
2009-01-05 11:54:28 -05:00
2008-11-18 15:08:56 +01:00
2009-01-05 11:54:28 -05:00
2008-12-31 18:07:44 -05:00
2008-12-04 17:16:36 +11:00
2008-12-29 16:47:18 +11:00
2008-12-29 08:29:50 +01:00
2008-12-31 18:07:43 -05:00
2009-01-03 11:45:54 -08:00
2008-12-29 08:29:53 +01:00
2008-10-23 05:12:59 -04:00
2008-01-30 13:31:46 +01:00
2008-12-31 18:07:38 -05:00
2008-12-25 11:40:09 +11:00
2009-01-05 11:54:28 -05:00
2009-01-05 11:54:28 -05:00
2009-01-05 11:54:28 -05:00
2008-12-31 18:07:41 -05:00
2009-01-05 11:54:28 -05:00
2008-10-30 11:38:45 -07:00
2009-01-05 11:54:28 -05:00
2009-01-05 11:54:28 -05:00
2009-01-05 11:54:28 -05:00