]> git.baikalelectronics.ru Git - kernel.git/commit
dcache: allow word-at-a-time name hashing with big-endian CPUs
authorWill Deacon <will.deacon@arm.com>
Thu, 12 Dec 2013 17:40:21 +0000 (17:40 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Dec 2013 18:39:01 +0000 (10:39 -0800)
commit2469d56bcf60dca34ad07223ab806a49ae9f7578
tree6832dfcb836f8d5043ba70f17a0ea9c2c428bc4d
parentb4c4286f5a4ee239caff24bf88796a9d96d59dd3
dcache: allow word-at-a-time name hashing with big-endian CPUs

When explicitly hashing the end of a string with the word-at-a-time
interface, we have to be careful which end of the word we pick up.

On big-endian CPUs, the upper-bits will contain the data we're after, so
ensure we generate our masks accordingly (and avoid hashing whatever
random junk may have been sitting after the string).

This patch adds a new dcache helper, bytemask_from_count, which creates
a mask appropriate for the CPU endianness.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/dcache.c
fs/namei.c
include/linux/dcache.h