[PATCH] xfs: negative_icount.patch V2

Christoph Hellwig hch at infradead.org
Thu Jul 29 15:55:14 CDT 2010


On Thu, Jul 29, 2010 at 03:18:38PM -0500, Stuart Brodsky wrote:
> can somebody please review this for me?

For a start it's still missing a useful subject line.

> +       long long               i;

Very bad naming of the variable, something like ffree would bebetter.
Also to fit with the rest of XFS it probably should be a __int64_t.

> +       i = statp->f_files - (sbp->sb_icount - sbp->sb_ifree);
> +       if( i < 0 )

wrong indentation.

> +               statp->f_ffree = 0;     /* cap at 0 */
> +       else
> +               statp->f_ffree = (__u64)i;

and it could probably done simpler as a

	statp->f_ffree = max_t(__int64_t, 0,
			statp->f_files + sbp->sb_ifree - sbp->sb_icount));




More information about the xfs mailing list