From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:05:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6DF931F; Mon, 6 May 2013 20:05:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3699E; Mon, 6 May 2013 20:05:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r46K5UnP040761; Mon, 6 May 2013 23:05:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r46K5UnP040761 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r46K5UtK040758; Mon, 6 May 2013 23:05:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 6 May 2013 23:05:30 +0300 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r250027 - head/sys/kern Message-ID: <20130506200530.GD3047@kib.kiev.ua> References: <201304281912.r3SJC9bL030636@svn.freebsd.org> <20130506181610.GA1390@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UxbNYeHgyZbry9TP" Content-Disposition: inline In-Reply-To: <20130506181610.GA1390@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:05:38 -0000 --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--