From: Ben Myers <bpm@sgi.com>
To: linux-nfs@vger.kernel.org
Subject: [RFC PATCH 2/4] Add datasync argument to nfsd_sync_dir().
Date: Wed, 03 Feb 2010 17:44:34 -0600 [thread overview]
Message-ID: <20100203234434.17677.60881.stgit@case> (raw)
In-Reply-To: <20100203233755.17677.96582.stgit@case>
---
fs/nfsd/nfs4recover.c | 2 +-
fs/nfsd/vfs.c | 18 +++++++++---------
fs/nfsd/vfs.h | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 5a754f7..e8c5938 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -120,7 +120,7 @@ static void
nfsd4_sync_rec_dir(void)
{
mutex_lock(&rec_dir.dentry->d_inode->i_mutex);
- nfsd_sync_dir(rec_dir.dentry);
+ nfsd_sync_dir(rec_dir.dentry, 0);
mutex_unlock(&rec_dir.dentry->d_inode->i_mutex);
}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 79d216f..1a64fb6 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -777,7 +777,7 @@ nfsd_close(struct file *filp)
* b) we expect to have i_mutex already held by the caller
*/
int
-nfsd_sync_dir(struct dentry *dentry)
+nfsd_sync_dir(struct dentry *dentry, int datasync)
{
struct inode *inode = dentry->d_inode;
int error;
@@ -786,7 +786,7 @@ nfsd_sync_dir(struct dentry *dentry)
error = filemap_write_and_wait(inode->i_mapping);
if (!error && inode->i_fop->fsync)
- error = inode->i_fop->fsync(NULL, dentry, 0);
+ error = inode->i_fop->fsync(NULL, dentry, datasync);
return error;
}
@@ -1322,7 +1322,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
}
if (EX_ISSYNC(fhp->fh_export)) {
- err = nfserrno(nfsd_sync_dir(dentry));
+ err = nfserrno(nfsd_sync_dir(dentry, 0));
write_inode_now(dchild->d_inode, 1);
}
@@ -1454,7 +1454,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
*created = 1;
if (EX_ISSYNC(fhp->fh_export)) {
- err = nfserrno(nfsd_sync_dir(dentry));
+ err = nfserrno(nfsd_sync_dir(dentry, 0));
/* setattr will sync the child (or not) */
}
@@ -1592,7 +1592,7 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
if (!host_err) {
if (EX_ISSYNC(fhp->fh_export))
- host_err = nfsd_sync_dir(dentry);
+ host_err = nfsd_sync_dir(dentry, 0);
}
err = nfserrno(host_err);
fh_unlock(fhp);
@@ -1657,7 +1657,7 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
host_err = vfs_link(dold, dirp, dnew);
if (!host_err) {
if (EX_ISSYNC(ffhp->fh_export)) {
- err = nfserrno(nfsd_sync_dir(ddir));
+ err = nfserrno(nfsd_sync_dir(ddir, 0));
write_inode_now(dest, 1);
}
err = 0;
@@ -1757,9 +1757,9 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
host_err = vfs_rename(fdir, odentry, tdir, ndentry);
if (!host_err && EX_ISSYNC(tfhp->fh_export)) {
- host_err = nfsd_sync_dir(tdentry);
+ host_err = nfsd_sync_dir(tdentry, 0);
if (!host_err)
- host_err = nfsd_sync_dir(fdentry);
+ host_err = nfsd_sync_dir(fdentry, 0);
}
mnt_drop_write(ffhp->fh_export->ex_path.mnt);
@@ -1843,7 +1843,7 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
if (host_err)
goto out_drop;
if (EX_ISSYNC(fhp->fh_export))
- host_err = nfsd_sync_dir(dentry);
+ host_err = nfsd_sync_dir(dentry, 0);
out_drop:
mnt_drop_write(fhp->fh_export->ex_path.mnt);
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
index 4b1de0a..89154a5 100644
--- a/fs/nfsd/vfs.h
+++ b/fs/nfsd/vfs.h
@@ -91,7 +91,7 @@ __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
int nfsd_notify_change(struct inode *, struct iattr *);
__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
struct dentry *, int);
-int nfsd_sync_dir(struct dentry *dp);
+int nfsd_sync_dir(struct dentry *dp, int datasync);
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
next prev parent reply other threads:[~2010-02-03 23:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-03 23:44 [RFC PATCH 0/4] wsync export option Ben Myers
2010-02-03 23:44 ` [RFC PATCH 1/4] Add 'wsync' " Ben Myers
2010-02-03 23:44 ` Ben Myers [this message]
2010-02-03 23:44 ` [RFC PATCH 3/4] If 'wsync' call vfs_fsync() instead of write_inode_now() Ben Myers
2010-02-03 23:44 ` [RFC PATCH 4/4] If 'wsync' pass datasync=1 to vfs_fsync() Ben Myers
2010-02-04 15:19 ` Christoph Hellwig
2010-02-04 17:20 ` bpm
2010-02-04 18:30 ` Christoph Hellwig
2010-02-04 18:38 ` Trond Myklebust
2010-02-04 18:40 ` Christoph Hellwig
2010-02-04 18:52 ` Trond Myklebust
2010-02-03 23:47 ` [ RFC PATCH 5/4 ] Add wsync export option to nfs-utils bpm
2010-02-03 23:58 ` [RFC PATCH 0/4] wsync export option Trond Myklebust
2010-02-04 15:21 ` Christoph Hellwig
2010-02-04 15:30 ` Christoph Hellwig
2010-02-04 15:30 ` Christoph Hellwig
2010-02-04 18:15 ` bpm
2010-02-04 18:15 ` bpm
2010-02-04 18:39 ` Christoph Hellwig
2010-02-04 18:39 ` 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=20100203234434.17677.60881.stgit@case \
--to=bpm@sgi.com \
--cc=linux-nfs@vger.kernel.org \
/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 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.