xfs
[Top] [All Lists]

Re: [PATCH V2] fix readahead calculations in xfs_dir2_leaf_getdents()

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH V2] fix readahead calculations in xfs_dir2_leaf_getdents()
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Sat, 26 Sep 2009 13:03:42 -0500
Cc: xfs mailing list <xfs@xxxxxxxxxxx>, tobias@xxxxxxxxxxxxxxx
In-reply-to: <20090926170423.GA28387@xxxxxxxxxxxxx>
References: <4ABA5192.80509@xxxxxxxxxxx> <4ABD1D22.2030002@xxxxxxxxxxx> <20090926170423.GA28387@xxxxxxxxxxxxx>
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Christoph Hellwig wrote:
On Fri, Sep 25, 2009 at 02:42:26PM -0500, Eric Sandeen wrote:
V2: use min() as suggested by Jeff, it's tidier.

I disagree with that, with the cast it looks pretty horrible.
At least use min_t to avoid the case, but what's wrong with:

+               /* bufsize may have just been a guess; don't go negative */
+               bufsize = min((bufsize - length), (size_t)0);

                bufsize = bufsize - length > 0 ? bufsize - length : 0;

ok, that's fine too.

I'll pick one.

Anyway, takes this as a


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

for any variant.


thanks,
-Eric

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