From f9a9982805b688c7eb9ed62f7d180ba340511e32 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 14 Nov 2011 18:52:07 +0000 Subject: Finish making 'wcommitsize' an NFS client mount option. Reviewed by: rmacklem MFC after: 1 week --- sbin/mount_nfs/mount_nfs.8 | 4 ++++ sbin/mount_nfs/mount_nfs.c | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'sbin/mount_nfs') diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8 index be9e309..bdb0707 100644 --- a/sbin/mount_nfs/mount_nfs.8 +++ b/sbin/mount_nfs/mount_nfs.8 @@ -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 diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 5386723..9da3137 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -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) { -- cgit v1.1