Skip to content

Commit

Permalink
vfs: clarify and clean up dentry_cmp()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds committed Mar 2, 2012
1 parent 0145acc commit 5707c87
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/linux/dcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5707c87

Please sign in to comment.