diff options
Diffstat (limited to 'fs/ubifs/key.h')
-rw-r--r-- | fs/ubifs/key.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/ubifs/key.h b/fs/ubifs/key.h index 8f7476007549..9ee65086f627 100644 --- a/fs/ubifs/key.h +++ b/fs/ubifs/key.h | |||
@@ -484,7 +484,7 @@ static inline void key_copy(const struct ubifs_info *c, | |||
484 | * @key2: the second key to compare | 484 | * @key2: the second key to compare |
485 | * | 485 | * |
486 | * This function compares 2 keys and returns %-1 if @key1 is less than | 486 | * This function compares 2 keys and returns %-1 if @key1 is less than |
487 | * @key2, 0 if the keys are equivalent and %1 if @key1 is greater than @key2. | 487 | * @key2, %0 if the keys are equivalent and %1 if @key1 is greater than @key2. |
488 | */ | 488 | */ |
489 | static inline int keys_cmp(const struct ubifs_info *c, | 489 | static inline int keys_cmp(const struct ubifs_info *c, |
490 | const union ubifs_key *key1, | 490 | const union ubifs_key *key1, |
@@ -503,6 +503,26 @@ static inline int keys_cmp(const struct ubifs_info *c, | |||
503 | } | 503 | } |
504 | 504 | ||
505 | /** | 505 | /** |
506 | * keys_eq - determine if keys are equivalent. | ||
507 | * @c: UBIFS file-system description object | ||
508 | * @key1: the first key to compare | ||
509 | * @key2: the second key to compare | ||
510 | * | ||
511 | * This function compares 2 keys and returns %1 if @key1 is equal to @key2 and | ||
512 | * %0 if not. | ||
513 | */ | ||
514 | static inline int keys_eq(const struct ubifs_info *c, | ||
515 | const union ubifs_key *key1, | ||
516 | const union ubifs_key *key2) | ||
517 | { | ||
518 | if (key1->u32[0] != key2->u32[0]) | ||
519 | return 0; | ||
520 | if (key1->u32[1] != key2->u32[1]) | ||
521 | return 0; | ||
522 | return 1; | ||
523 | } | ||
524 | |||
525 | /** | ||
506 | * is_hash_key - is a key vulnerable to hash collisions. | 526 | * is_hash_key - is a key vulnerable to hash collisions. |
507 | * @c: UBIFS file-system description object | 527 | * @c: UBIFS file-system description object |
508 | * @key: key | 528 | * @key: key |