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
5454 static inline int dentry_cmp(const unsigned char *cs, size_t scount,
5555 const unsigned char *ct, size_t tcount)
5656 {
57− int ret;
5857 if (scount != tcount)
5958 return 1;
59+
6060 do {
61− ret = (*cs != *ct);
62− if (ret)
63− break;
61+ if (*cs != *ct)
62+ return 1;
6463 cs++;
6564 ct++;
6665 tcount--;
6766 } while (tcount);
68− return ret;
67+ return 0;
6968 }
7069
7170 /* Name hashing routines. Initial hash value */