History

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".

Linus Torvalds committed 14 years ago

Commit 5707c871 parent 0145acc1 file · +4 −5Browse files

Unified · Split

include/linux/dcache.h+4−5
@@ -54,18 +54,17 @@ extern struct dentry_stat_t dentry_stat; · 53 unmodified lines
54static inline int dentry_cmp(const unsigned char *cs, size_t scount,54static inline int dentry_cmp(const unsigned char *cs, size_t scount,
55 const unsigned char *ct, size_t tcount)55 const unsigned char *ct, size_t tcount)
56{56{
57 int ret;
58 if (scount != tcount)57 if (scount != tcount)
59 return 1;58 return 1;
59
60 do {60 do {
61 ret = (*cs != *ct);61 if (*cs != *ct)
62 if (ret)62 return 1;
63 break;
64 cs++;63 cs++;
65 ct++;64 ct++;
66 tcount--;65 tcount--;
67 } while (tcount);66 } while (tcount);
68 return ret;67 return 0;
69}68}
70 69
71/* Name hashing routines. Initial hash value */70/* Name hashing routines. Initial hash value */