From owner-freebsd-fs@FreeBSD.ORG Wed Aug 17 23:56:58 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F201065673 for ; Wed, 17 Aug 2011 23:56:58 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 30F658FC12 for ; Wed, 17 Aug 2011 23:56:58 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EADJUTE6DaFvO/2dsb2JhbABBhEmlIIFAAQYjVhsaAg0ZAlkGrQ+RUoEshAyBEASTE5ER X-IronPort-AV: E=Sophos;i="4.68,242,1312171200"; d="scan'208";a="131414575" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 17 Aug 2011 19:56:57 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 7FC75B3F64; Wed, 17 Aug 2011 19:56:57 -0400 (EDT) Date: Wed, 17 Aug 2011 19:56:57 -0400 (EDT) From: Rick Macklem To: Kostik Belousov Message-ID: <1075004291.300557.1313625417507.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20110817135230.GW17489@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: freebsd-fs@freebsd.org, onwahe@gmail.com Subject: Re: NFS calculation of max commit size X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2011 23:56:58 -0000 Just to correct myself... - The NFS VOP_WRITE() can keep track of a running total of how many bytes is being written: - add uio_resid to this running total at the beginning of the VOP_WRITE() and subtract it back out at the end of VOP_WRITE(). This was incorrectly stated. The value should be subtracted back out when the write rpc completes (ie. buffer has been flushed), since the running total needs to be "how many unwritten NFS bytes are in the buffer cache". At least that was what I was/am thinking... rick