Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 May 2013 23:05:30 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r250027 - head/sys/kern
Message-ID:  <20130506200530.GD3047@kib.kiev.ua>
In-Reply-To: <20130506181610.GA1390@garage.freebsd.pl>
References:  <201304281912.r3SJC9bL030636@svn.freebsd.org> <20130506181610.GA1390@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help

--UxbNYeHgyZbry9TP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 06, 2013 at 08:16:11PM +0200, Pawel Jakub Dawidek wrote:
> On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote:
> > Author: kib
> > Date: Sun Apr 28 19:12:09 2013
> > New Revision: 250027
> > URL: http://svnweb.freebsd.org/changeset/base/250027
> >=20
> > Log:
> >   Eliminate the layering violation in the kern_sendfile().  When quering
> >   the file size, use VOP_GETATTR() instead of accessing vnode vm_object
> >   un_pager.vnp.vnp_size.
>=20
> Doesn't it add extra I/O to query file system about file's attributes?
> If it does, does it matter here?

It should not, typically.

E.g. UFS always keeps the unpacked inode in memory for any non-reclaimed
vnode.  For NFS, vnode usually caches the attributes.

Anyway, using VOP_GETATTR() is the only sanctioned way to get file size.
Directly accessing vm_object assumes that vm_object is of OBJT_VNODE type,
which is no longer true.

--UxbNYeHgyZbry9TP
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQIcBAEBAgAGBQJRiA0JAAoJEJDCuSvBvK1B10MP/i4gYi1YAdTccTbjcskPR6A2
c0jV67YroTrggYP83xOvjMmijvXcDonWayj2z/OndBcNrc4ciNdUhpL+FWChKTtO
+aNB3uexoM8LP1J7j0r44+4K4bZ5hv81LMjtdVVCYMWlBNeq6YqOkkX053XZm7D/
c547hPsDBfmS/UVsHr2Tm9WNPkMfkXAD4cx0WPKDkL6N4PI87e/Yclweqk6YqVlL
yt3sVrCNU0dxagWdnRTLmtS0aVytp/f3sCIhX8F34Wf0lmQQW+x3ybjXN9OY7QLk
oC4XC7KFRZ5OASZxjKjtWTQbRs9AKWJJgT7qbUC2SaZN2jnGbT62bjpNw2gQlhMs
UdkyLv9WgWmNr24ldlOL+tOXbhLODqjxahevLPgMWMjSjkuce12YPy3EzqOBOgK1
75B2et19uDpwoGpAtSw+IWehBOHkTHBTwSLcDhHlBkhaN+Zt6d3uI66lzUDS00eT
3HsKr9anZRtcw1j8luhcX7XLh4WscYAXQ5xRKoMgAZ7PPPGfxtJmzYzd1uUWfeIz
dy+3pVRg7q12YM+X9dc+hOtD8QqMRDCyQoHv6E8i3TQqJ5p6Ke9L0f4rp57W5yxh
GU6d3UORaFsAHKBEPs6anlvQaP3p2JfqNzXy/3PfVRnTnw8bNykKLSPB4qz6Rmvo
UHTkkXLE4vWJLWTyqpz0
=bu9x
-----END PGP SIGNATURE-----

--UxbNYeHgyZbry9TP--



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