@@ -1297,6 +1297,7 @@ static struct flags {
{ NFSEXP_V4ROOT, {"v4root", ""}},
{ NFSEXP_PNFS, {"pnfs", ""}},
{ NFSEXP_SECURITY_LABEL, {"security_label", ""}},
+ { NFSEXP_FILE_SYNC, {"file_sync", ""}},
{ 0, {"", ""}}
};
@@ -1269,6 +1269,7 @@ nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
status = nfsd4_clone_file_range(rqstp, src, clone->cl_src_pos,
dst, clone->cl_dst_pos, clone->cl_count,
EX_ISSYNC(cstate->current_fh.fh_export));
+ /* cel: check the "file_sync" export option as well */
nfsd_file_put(dst);
nfsd_file_put(src);
@@ -1205,9 +1205,10 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
exp = fhp->fh_export;
- if (!EX_ISSYNC(exp))
+ if (exp->ex_flags & NFSEXP_FILE_SYNC)
+ *stable = NFS_FILE_SYNC;
+ else if (!EX_ISSYNC(exp))
*stable = NFS_UNSTABLE;
-
if (*stable && !fhp->fh_use_wgather)
flags |= RWF_SYNC;
@@ -53,9 +53,10 @@
*/
#define NFSEXP_V4ROOT 0x10000
#define NFSEXP_PNFS 0x20000
+#define NFSEXP_FILE_SYNC 0x40000
/* All flags that we claim to support. (Note we don't support NOACL.) */
-#define NFSEXP_ALLFLAGS 0x3FEFF
+#define NFSEXP_ALLFLAGS 0x7FEFF
/* The flags that may vary depending on security flavor: */
#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \