svn commit: r229604 - in stable/9: sbin/mount_nfs sys/fs/nfsclient
sys/nfsclient
John Baldwin
jhb at FreeBSD.org
Thu Jan 5 17:22:33 UTC 2012
Author: jhb
Date: Thu Jan 5 17:22:32 2012
New Revision: 229604
URL: http://svn.freebsd.org/changeset/base/229604
Log:
MFC 227507: Finish making 'wcommitsize' an NFS client mount option.
Modified:
stable/9/sbin/mount_nfs/mount_nfs.8
stable/9/sbin/mount_nfs/mount_nfs.c
stable/9/sys/fs/nfsclient/nfs_clvfsops.c
stable/9/sys/nfsclient/nfs_vfsops.c
Directory Properties:
stable/9/sbin/mount_nfs/ (props changed)
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
Modified: stable/9/sbin/mount_nfs/mount_nfs.8
==============================================================================
--- stable/9/sbin/mount_nfs/mount_nfs.8 Thu Jan 5 17:20:03 2012 (r229603)
+++ stable/9/sbin/mount_nfs/mount_nfs.8 Thu Jan 5 17:22:32 2012 (r229604)
@@ -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
Modified: stable/9/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- stable/9/sbin/mount_nfs/mount_nfs.c Thu Jan 5 17:20:03 2012 (r229603)
+++ stable/9/sbin/mount_nfs/mount_nfs.c Thu Jan 5 17:22:32 2012 (r229604)
@@ -612,6 +612,13 @@ fallback_mount(struct iovec *iov, int io
}
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) {
Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu Jan 5 17:20:03 2012 (r229603)
+++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu Jan 5 17:22:32 2012 (r229604)
@@ -715,7 +715,7 @@ static const char *nfs_opts[] = { "from"
"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) {
Modified: stable/9/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- stable/9/sys/nfsclient/nfs_vfsops.c Thu Jan 5 17:20:03 2012 (r229603)
+++ stable/9/sys/nfsclient/nfs_vfsops.c Thu Jan 5 17:22:32 2012 (r229604)
@@ -787,7 +787,7 @@ static const char *nfs_opts[] = { "from"
"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) {
More information about the svn-src-stable-9
mailing list