diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-02 14:47:15 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-02 14:47:15 -0800 |
commit | 5707c87f20bca9e76969bb4096149de6ef74cbb9 (patch) | |
tree | 37151409a6dd304b4382bb979be1ad43802a583c /include/linux/dcache.h | |
parent | 0145acc202ca613b23b5383e55df3c32a92ad1bf (diff) | |
download | lwn-5707c87f20bca9e76969bb4096149de6ef74cbb9.tar.gz lwn-5707c87f20bca9e76969bb4096149de6ef74cbb9.zip |
vfs: clarify and clean up dentry_cmp()
It did some odd things for unclear reasons. As this is one of the
functions that gets changed when doing word-at-a-time compares, this is
yet another of the "don't change any semantics, but clean things up so
that subsequent patches don't get obscured by the cleanups".
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r-- | include/linux/dcache.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index f1c7eb8461be..4270bedd2308 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -54,18 +54,17 @@ extern struct dentry_stat_t dentry_stat; static inline int dentry_cmp(const unsigned char *cs, size_t scount, const unsigned char *ct, size_t tcount) { - int ret; if (scount != tcount) return 1; + do { - ret = (*cs != *ct); - if (ret) - break; + if (*cs != *ct) + return 1; cs++; ct++; tcount--; } while (tcount); - return ret; + return 0; } /* Name hashing routines. Initial hash value */ |