linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@googlemail.com>
To: Miklos Szeredi <miklos@szeredi.hu>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Subject: [PATCH vfs-next 2/2] ovl: Adapt ovl_dir_fsync() to updated API in ->fsync()
Date: Fri, 22 Jul 2011 17:56:00 +0200	[thread overview]
Message-ID: <1311350160-3651-1-git-send-email-sedat.dilek@gmail.com> (raw)

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

                 reply	other threads:[~2011-07-22 15:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1311350160-3651-1-git-send-email-sedat.dilek@gmail.com \
    --to=sedat.dilek@googlemail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=sedat.dilek@gmail.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).