* [PATCH vfs-next 2/2] ovl: Adapt ovl_dir_fsync() to updated API in ->fsync()
@ 2011-07-22 15:56 Sedat Dilek
0 siblings, 0 replies; only message in thread
From: Sedat Dilek @ 2011-07-22 15:56 UTC (permalink / raw)
To: Miklos Szeredi, linux-fsdevel, linux-kernel; +Cc: Sedat Dilek
Based on a proposal patch from Miklos Szeredi <miklos@szeredi.hu>.
Adapt ovl_dir_fsync() to recent changes in vfs-2.6.git#for-next.
Documentation/filesystems/porting says:
[mandatory]
If you have your own ->fsync() you must make sure to call
filemap_write_and_wait_range() so that all dirty pages are synced out properly.
You must also keep in mind that ->fsync() is not called with i_mutex held
anymore, so if you require i_mutex locking you must make sure to take it and
release it yourself.
For more details see:
commit cbc4facd43b3502f644d7f01a9a48f8bec5f3e57
"fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers"
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
fs/overlayfs/readdir.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 48e35a8..6fcda39 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -386,7 +386,8 @@ out_unlock:
return res;
}
-static int ovl_dir_fsync(struct file *file, int datasync)
+static int ovl_dir_fsync(struct file *file, loff_t start, loff_t end,
+ int datasync)
{
struct ovl_dir_file *od = file->private_data;
@@ -400,7 +401,7 @@ static int ovl_dir_fsync(struct file *file, int datasync)
return PTR_ERR(od->realfile);
}
- return vfs_fsync(od->realfile, datasync);
+ return vfs_fsync_range(od->realfile, start, end, datasync);
}
static int ovl_dir_release(struct inode *inode, struct file *file)
--
1.7.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-22 15:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22 15:56 [PATCH vfs-next 2/2] ovl: Adapt ovl_dir_fsync() to updated API in ->fsync() Sedat Dilek
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).