diff --git a/support/include/nfs/export.h b/support/include/nfs/export.h index f7a99ba..0911c9a 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_PREALLOC 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 525e5b1..16d03cc 100644 --- a/support/nfs/exports.c +++ b/support/nfs/exports.c @@ -111,6 +111,7 @@ getexportent(int fromkernel, int fromexports) if (fromkernel) { def_ee.e_flags &= ~NFSEXP_ASYNC; def_ee.e_flags &= ~NFSEXP_GATHERED_WRITES; + def_ee.e_flags &= ~NFSEXP_PREALLOC; } def_ee.e_anonuid = 65534; def_ee.e_anongid = 65534; @@ -237,6 +238,7 @@ putexportent(struct exportent *ep) fprintf(fp, "%ssync,", (ep->e_flags & NFSEXP_ASYNC)? "a" : ""); fprintf(fp, "%swdelay,", (ep->e_flags & NFSEXP_GATHERED_WRITES)? "" : "no_"); + fprintf(fp, "%sprealloc,", (ep->e_flags & NFSEXP_PREALLOC)? "" : "no_"); fprintf(fp, "%shide,", (ep->e_flags & NFSEXP_NOHIDE)? "no" : ""); fprintf(fp, "%scrossmnt,", (ep->e_flags & NFSEXP_CROSSMOUNT)? @@ -558,6 +560,10 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr) ep->e_flags &= ~NFSEXP_NOACL; else if (strcmp(opt, "no_acl") == 0) ep->e_flags |= NFSEXP_NOACL; + else if (strcmp(opt, "prealloc") == 0) + ep->e_flags |= NFSEXP_PREALLOC; + else if (strcmp(opt, "no_prealloc") == 0) + ep->e_flags &= ~NFSEXP_PREALLOC; else if (strncmp(opt, "anonuid=", 8) == 0) { char *oe; ep->e_anonuid = strtol(opt+8, &oe, 10); diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 18dfe5a..03dbdca 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -470,6 +470,8 @@ dump(int verbose) c = dumpopt(c, "async"); if (ep->e_flags & NFSEXP_GATHERED_WRITES) c = dumpopt(c, "wdelay"); + if (ep->e_flags & NFSEXP_PREALLOC) + c = dumpopt(c, "prealloc"); if (ep->e_flags & NFSEXP_NOHIDE) c = dumpopt(c, "nohide"); if (ep->e_flags & NFSEXP_CROSSMOUNT)