From: bpm@sgi.com
To: linux-nfs@vger.kernel.org
Subject: [ RFC PATCH 5/4 ] Add wsync export option to nfs-utils
Date: Wed, 3 Feb 2010 17:47:58 -0600 [thread overview]
Message-ID: <20100203234758.GI5702@sgi.com> (raw)
In-Reply-To: <20100203233755.17677.96582.stgit@case>
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: out --]
[-- Type: text/plain, Size: 1971 bytes --]
commit 0eacb0dffa603b6fa2dded1d99e9e1d2be73c5da
Author: Ben Myers <bpm@sgi.com>
Date: Wed Feb 3 16:05:22 2010 -0600
diff --git a/support/include/nfs/export.h b/support/include/nfs/export.h
index 1547a87..8119b9a 100644
--- a/support/include/nfs/export.h
+++ b/support/include/nfs/export.h
@@ -17,7 +17,8 @@
#define NFSEXP_ALLSQUASH 0x0008
#define NFSEXP_ASYNC 0x0010
#define NFSEXP_GATHERED_WRITES 0x0020
-/* 40, 80, 100 unused */
+#define NFSEXP_WSYNC 0x0040
+/* 80, 100 unused */
#define NFSEXP_NOHIDE 0x0200
#define NFSEXP_NOSUBTREECHECK 0x0400
#define NFSEXP_NOAUTHNLM 0x0800
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index a93941c..51b94d8 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -223,6 +223,7 @@ putexportent(struct exportent *ep)
FILE *fp;
int *id, i;
char *esc=ep->e_path;
+ char *syncchar;
if (!efp)
return;
@@ -236,7 +237,14 @@ putexportent(struct exportent *ep)
fprintf(fp, "\t%s(", ep->e_hostname);
fprintf(fp, "%s,", (ep->e_flags & NFSEXP_READONLY)? "ro" : "rw");
- fprintf(fp, "%ssync,", (ep->e_flags & NFSEXP_ASYNC)? "a" : "");
+ if (ep->e_flags & NFSEXP_ASYNC) {
+ syncchar = "a";
+ } else if (ep->e_flags & NFSEXP_WSYNC) {
+ syncchar = "w";
+ } else {
+ syncchar = "";
+ }
+ fprintf(fp, "%ssync,", syncchar);
fprintf(fp, "%swdelay,", (ep->e_flags & NFSEXP_GATHERED_WRITES)?
"" : "no_");
fprintf(fp, "%shide,", (ep->e_flags & NFSEXP_NOHIDE)?
@@ -519,7 +527,10 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
clearflags(NFSEXP_ASYNC, active, ep);
else if (!strcmp(opt, "async"))
setflags(NFSEXP_ASYNC, active, ep);
- else if (!strcmp(opt, "nohide"))
+ else if (!strcmp(opt, "wsync")) {
+ clearflags(NFSEXP_ASYNC, active, ep);
+ setflags(NFSEXP_WSYNC, active, ep);
+ } else if (!strcmp(opt, "nohide"))
setflags(NFSEXP_NOHIDE, active, ep);
else if (!strcmp(opt, "hide"))
clearflags(NFSEXP_NOHIDE, active, ep);
next prev parent reply other threads:[~2010-02-03 23:47 UTC|newest]
Thread overview: 17+ 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 ` [RFC PATCH 2/4] Add datasync argument to nfsd_sync_dir() Ben Myers
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 ` bpm [this message]
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 18:15 ` bpm
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=20100203234758.GI5702@sgi.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox