svn commit: r227507 - in head: sbin/mount_nfs sys/fs/nfsclient sys/nfsclient

John Baldwin jhb at FreeBSD.org
Mon Nov 14 18:52:07 UTC 2011


Author: jhb
Date: Mon Nov 14 18:52:07 2011
New Revision: 227507
URL: http://svn.freebsd.org/changeset/base/227507

Log:
  Finish making 'wcommitsize' an NFS client mount option.
  
  Reviewed by:	rmacklem
  MFC after:	1 week

Modified:
  head/sbin/mount_nfs/mount_nfs.8
  head/sbin/mount_nfs/mount_nfs.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/nfsclient/nfs_vfsops.c

Modified: head/sbin/mount_nfs/mount_nfs.8
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.8	Mon Nov 14 18:51:39 2011	(r227506)
+++ head/sbin/mount_nfs/mount_nfs.8	Mon Nov 14 18:52:07 2011	(r227507)
@@ -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: head/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.c	Mon Nov 14 18:51:39 2011	(r227506)
+++ head/sbin/mount_nfs/mount_nfs.c	Mon Nov 14 18:52:07 2011	(r227507)
@@ -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: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Mon Nov 14 18:51:39 2011	(r227506)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Mon Nov 14 18:52:07 2011	(r227507)
@@ -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: head/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- head/sys/nfsclient/nfs_vfsops.c	Mon Nov 14 18:51:39 2011	(r227506)
+++ head/sys/nfsclient/nfs_vfsops.c	Mon Nov 14 18:52:07 2011	(r227507)
@@ -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-all mailing list