xfs
[Top] [All Lists]

Re: [PATCH v3] xfs: ensure f_ffree returned by statfs() is non-negative

To: Stuart Brodsky <sbrodsky@xxxxxxx>
Subject: Re: [PATCH v3] xfs: ensure f_ffree returned by statfs() is non-negative
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 6 Aug 2010 09:02:53 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1280931359.12084.2519.camel@xxxxxxxxxxxxxxxxxxxxxxxxx>
References: <1280931359.12084.2519.camel@xxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-08-17)
Good changelog this time around, thanks.

> -       statp->f_ffree = statp->f_files - (sbp->sb_icount -
> sbp->sb_ifree);

Your mailer line-wrapper the patch here.

> +       ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree);
> +       statp->f_ffree = (__u64) (ffree < 0 ? 0 : ffree);

Why not just use min_t here?

        statp->f_ffree = max_t(__int64_t, ffree, 0);

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