From owner-svn-src-head@FreeBSD.ORG Mon Nov 14 18:52:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B125B106564A; Mon, 14 Nov 2011 18:52:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 966698FC12; Mon, 14 Nov 2011 18:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEIq75j061905; Mon, 14 Nov 2011 18:52:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEIq71t061900; Mon, 14 Nov 2011 18:52:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111141852.pAEIq71t061900@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Nov 2011 18:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227507 - in head: sbin/mount_nfs sys/fs/nfsclient sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:52:07 -0000 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) {