Re: [PATCH 04/15] xfs: remove xfile_stat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 04, 2024 at 07:14:15AM +0100, Christoph Hellwig wrote:
> On Wed, Jan 03, 2024 at 03:45:33PM -0800, Darrick J. Wong wrote:
> > > +		__entry->bytes = inode->i_bytes;
> > 
> > Shouldn't this be (i_blocks << 9) + i_bytes?
> 
> Actually this should just be doing:
> 
> 	__entry->bytes = inode->i_blocks << SECTOR_SHIFT;
> 
> The bytes name here really confused me.

Me too.  It looks like some weird way to encode the bytes used by the
file using a u64 sector count and a u16 byte count for ... some reason?
XFS (and thankfully tmpfs) seem to ignore all that entirely.

> Or we could change the trace
> point to just report i_block directly and not rename it to bytes and
> change the unit?

I prefer to keep the tracepoint in bytes because that's a little easier
than rshifting by 9 in my head.

--D




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux