Finish making 'wcommitsize' an NFS client mount option.

Reviewed by:	rmacklem
MFC after:	1 week
This commit is contained in:
John Baldwin 2011-11-14 18:52:07 +00:00
parent 579905d87c
commit 840fb1c02b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227507
4 changed files with 31 additions and 2 deletions

View File

@ -318,6 +318,10 @@ tune the timeout
interval.)
.It Cm udp
Use UDP transport.
.It Cm wcommitsize Ns = Ns Aq Ar value
Set the maximum pending write commit size to the specified value.
This determines the maximum amount of pending write data that the NFS
client is willing to cache for each file.
.It Cm wsize Ns = Ns Aq Ar value
Set the write data size to the specified value.
Ditto the comments w.r.t.\& the

View File

@ -612,6 +612,13 @@ fallback_mount(struct iovec *iov, int iovlen, int mntflags)
}
args.flags |= NFSMNT_ACDIRMAX;
}
if (findopt(iov, iovlen, "wcommitsize", &opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.wcommitsize);
if (ret != 1 || args.wcommitsize < 0) {
errx(1, "illegal wcommitsize: %s", opt);
}
args.flags |= NFSMNT_WCOMMITSIZE;
}
if (findopt(iov, iovlen, "deadthresh", &opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.deadthresh);
if (ret != 1 || args.deadthresh <= 0) {

View File

@ -715,7 +715,7 @@ static const char *nfs_opts[] = { "from", "nfs_args",
"retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport",
"readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec",
"principal", "nfsv4", "gssname", "allgssname", "dirpath",
"negnametimeo", "nocto",
"negnametimeo", "nocto", "wcommitsize",
NULL };
/*
@ -949,6 +949,15 @@ nfs_mount(struct mount *mp)
}
args.flags |= NFSMNT_ACDIRMAX;
}
if (vfs_getopt(mp->mnt_optnew, "wcommitsize", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.wcommitsize);
if (ret != 1 || args.wcommitsize < 0) {
vfs_mount_error(mp, "illegal wcommitsize: %s", opt);
error = EINVAL;
goto out;
}
args.flags |= NFSMNT_WCOMMITSIZE;
}
if (vfs_getopt(mp->mnt_optnew, "timeout", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.timeo);
if (ret != 1 || args.timeo <= 0) {

View File

@ -787,7 +787,7 @@ static const char *nfs_opts[] = { "from", "nfs_args",
"readahead", "readdirsize", "soft", "hard", "mntudp", "tcp", "udp",
"wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin",
"acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3",
"sec", "maxgroups", "principal", "negnametimeo", "nocto",
"sec", "maxgroups", "principal", "negnametimeo", "nocto", "wcommitsize",
NULL };
/*
@ -1019,6 +1019,15 @@ nfs_mount(struct mount *mp)
}
args.flags |= NFSMNT_ACDIRMAX;
}
if (vfs_getopt(mp->mnt_optnew, "wcommitsize", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.wcommitsize);
if (ret != 1 || args.wcommitsize < 0) {
vfs_mount_error(mp, "illegal wcommitsize: %s", opt);
error = EINVAL;
goto out;
}
args.flags |= NFSMNT_WCOMMITSIZE;
}
if (vfs_getopt(mp->mnt_optnew, "deadthresh", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.deadthresh);
if (ret != 1 || args.deadthresh <= 0) {