svn commit: r250027 - head/sys/kern

Konstantin Belousov kostikbel at gmail.com
Mon May 6 20:05:38 UTC 2013


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
> > 
> > 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.
> 
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20130506/5379fb17/attachment.sig>


More information about the svn-src-all mailing list