diff options
author | Jeff Layton <jlayton@redhat.com> | 2018-01-30 15:32:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-31 08:43:35 -0800 |
commit | c0cef30e4ff0dc025f4a1660b8f0ba43ed58426e (patch) | |
tree | 8be4d90a4eb4f64bf0569e7b9e9bf88112722776 /mm | |
parent | 3da90b159b146672f830bcd2489dd3a1f4e9e089 (diff) | |
download | linux-rt-c0cef30e4ff0dc025f4a1660b8f0ba43ed58426e.tar.gz |
iversion: make inode_cmp_iversion{+raw} return bool instead of s64
As Linus points out:
The inode_cmp_iversion{+raw}() functions are pure and utter crap.
Why?
You say that they return 0/negative/positive, but they do so in a
completely broken manner. They return that ternary value as the
sequence number difference in a 's64', which means that if you
actually care about that ternary value, and do the *sane* thing that
the kernel-doc of the function implies is the right thing, you would
do
int cmp = inode_cmp_iversion(inode, old);
if (cmp < 0 ...
and as a result you get code that looks sane, but that doesn't
actually *WORK* right.
Since none of the callers actually care about the ternary value here,
convert the inode_cmp_iversion{+raw} functions to just return a boolean
value (false for matching, true for non-matching).
This matches the existing use of these functions just fine, and makes it
simple to convert them to return a ternary value in the future if we
grow callers that need it.
With this change we can also reimplement inode_cmp_iversion in a simpler
way using inode_peek_iversion.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions