aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-02 17:47:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-02 17:47:15 -0500
commit5707c87f20bca9e76969bb4096149de6ef74cbb9 (patch)
tree37151409a6dd304b4382bb979be1ad43802a583c /include
parent0145acc202ca613b23b5383e55df3c32a92ad1bf (diff)
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')
-rw-r--r--include/linux/dcache.h9
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;
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 */