Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 2013 17:57:01 -0500 (EST)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Kirk McKusick <mckusick@mckusick.com>, FreeBSD FS <freebsd-fs@freebsd.org>
Subject:   Re: RFC: NFS client patch to reduce sychronous writes
Message-ID:  <1288055532.23818811.1385852221143.JavaMail.root@uoguelph.ca>
In-Reply-To: <20131130132233.GZ59496@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Kostik wrote:
> On Thu, Nov 28, 2013 at 06:50:20PM -0500, Rick Macklem wrote:
> > 			obcount = np->n_size - (lbn * biosize);
> > *** This sets obcount to the byte offset within the buffer cache
> > block of
> >     EOF before it is grown by this write (or file size mod biosize,
> >     if you prefer)
> > 			bp = nfs_getcacheblk(vp, lbn, obcount, td);
> > 
> > 			if (bp != NULL) {
> > 				long save;
> > 
> > 				mtx_lock(&np->n_mtx);
> >   				np->n_size = uio->uio_offset + n;
> > 				np->n_flag |= NMODIFIED;
> > 				vnode_pager_setsize(vp, np->n_size);
> > *** n_size is now grown to the new EOF for after the write.
> > 				mtx_unlock(&np->n_mtx);
> > 
> > 				save = bp->b_flags & B_CACHE;
> > 				bcount = on + n;
> > 				allocbuf(bp, bcount);
> > 				bp->b_flags |= save;
> > 				if (noncontig_write != 0 && bcount > obcount)
> > 					vfs_bio_bzero_buf(bp, obcount, bcount -
> > 					    obcount);
> > *** This zeros bytes from "obcount" (the offset of the old EOF) to
> > "bcount"
> >     (which is the offset of EOF after the write).
> 
> I believe that I got it now, the patch in the other message looks
> fine.
> Thank you for the patience.
> 
Thanks for the review. It got me to look more closely at the patch and replace
"bcount" with "on", plus other improvements.

Have fun, rick




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1288055532.23818811.1385852221143.JavaMail.root>