Date: Sat, 30 Nov 2013 15:22:33 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Rick Macklem <rmacklem@uoguelph.ca> Cc: Kirk McKusick <mckusick@mckusick.com>, FreeBSD FS <freebsd-fs@freebsd.org> Subject: Re: RFC: NFS client patch to reduce sychronous writes Message-ID: <20131130132233.GZ59496@kib.kiev.ua> In-Reply-To: <1355437347.22943634.1385682620696.JavaMail.root@uoguelph.ca> References: <20131128191851.GM59496@kib.kiev.ua> <1355437347.22943634.1385682620696.JavaMail.root@uoguelph.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
--4oAqxJayxW1dikgl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, Nov 28, 2013 at 06:50:20PM -0500, Rick Macklem wrote:
> obcount =3D 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 yo=
u prefer)
> bp =3D nfs_getcacheblk(vp, lbn, obcount, td);
>=20
> if (bp !=3D NULL) {
> long save;
>=20
> mtx_lock(&np->n_mtx);
> np->n_size =3D uio->uio_offset + n;
> np->n_flag |=3D 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);
>=20
> save =3D bp->b_flags & B_CACHE;
> bcount =3D on + n;
> allocbuf(bp, bcount);
> bp->b_flags |=3D save;
> if (noncontig_write !=3D 0 && bcount > obcount)
> vfs_bio_bzero_buf(bp, obcount, bcount -
> obcount);
> *** This zeros bytes from "obcount" (the offset of the old EOF) to "bcoun=
t"
> (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.
--4oAqxJayxW1dikgl
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)
iQIcBAEBAgAGBQJSmeaYAAoJEJDCuSvBvK1BpGIP/1n2j1K6vE0EWb+xDJR0dJVa
cr1yrpgYUjwrPLdoCzU8zyERahaIFd4i97jD6JFF2qksKNJyGBNAdfoei5IktIZf
OHKXR8LKpMW5vBxNtMZpwy/UMR7sgFsAVna9NJ9GEYPJT1QMPOGG3mi4YO4nkuiu
t2ZAMQCrwdQl/e9ehniot1WduSxb1kzcMUrJ3rPJME1GFLHsvEfY14udGvwxS44S
fDPXNTmcYdS2IfDnGO+KB85eKFqclBjQxI+pIFQg6yss5ojFaQQvCdZ/+MeFpuVW
GwGogqgoZ/QAfw0gBw9eOUPYJh7HIAraF6vDwq+fksKPLdTLevWzwWVEfhijfXRa
00206vE023Y4j5xZwSUcvK39sJMBSvdOoRojCnCSS0/2WCrVKbA0vLnKLVpA5lOP
jUbp3vNSKQJFUyUi0GKzWJJ1Hr4KL423SymIKQdW4+IuvAr0iJoMhTj9qgi02fuQ
4V3PPJhuvEQiJVdM3alrhL+S0pObwSiVc4U2mTAS4g+3POJmy+pwv6gVO2fdCKI9
9lS1JAcrkYWAof3q7DtlhriXkdHf3DtjHVel1H25Wo3iYCntcFcqbnKibOpAHZKt
Qg+lT/iZJ24pJpYUlVHEIvae8aWFXhOiMH1sVlZ5fdjJ1hm3CgIBu69lBQyKAmLH
+tQtN4LEF7fM144gkok3
=QkIU
-----END PGP SIGNATURE-----
--4oAqxJayxW1dikgl--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131130132233.GZ59496>
