xfs
[Top] [All Lists]

Re: [PATCH] xfs: negative_icount.patch V2

To: Stuart Brodsky <sbrodsky@xxxxxxx>
Subject: Re: [PATCH] xfs: negative_icount.patch V2
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 29 Jul 2010 16:55:14 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1280434718.7149.4.camel@xxxxxxxxxxxxxxxxxxxxxxxxx>
References: <1280434718.7149.4.camel@xxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-08-17)
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));

<Prev in Thread] Current Thread [Next in Thread>