Subject: Re: syssrc/ufs/ufs/ufs_vnops.c:ufs_getattr and vap->va_size
To: Sean Doran <smd@ebone.net>
From: Bill Studenmund <wrstuden@zembu.com>
List: tech-kern
Date: 08/24/2000 20:21:51
On Fri, 25 Aug 2000, Sean Doran wrote:

> In the ufs_getattr function there is:
> 
>         vap->va_size = ip->i_ffs_size;
> 
> Why is this 0 when the inode is a device?  Would it be possible/
> convenient/sane to have this be the same size as the medium/partition,
> if the kernel knows it?

Because, at least according to man stat(2), st_size (which comes from
va_size) is "/* file size, in bytes */". i.e. how big the file is on the
file system. As inodes have no allocated blocks on the file system, 0 is
the right value. :-)

Take care,

Bill