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>
This commit is contained in:
Linus Torvalds 2012-03-02 14:47:15 -08:00
parent 0145acc202
commit 5707c87f20

View file

@ -54,18 +54,17 @@ extern struct dentry_stat_t dentry_stat;
static inline int dentry_cmp(const unsigned char *cs, size_t scount, static inline int dentry_cmp(const unsigned char *cs, size_t scount,
const unsigned char *ct, size_t tcount) const unsigned char *ct, size_t tcount)
{ {
int ret;
if (scount != tcount) if (scount != tcount)
return 1; return 1;
do { do {
ret = (*cs != *ct); if (*cs != *ct)
if (ret) return 1;
break;
cs++; cs++;
ct++; ct++;
tcount--; tcount--;
} while (tcount); } while (tcount);
return ret; return 0;
} }
/* Name hashing routines. Initial hash value */ /* Name hashing routines. Initial hash value */