diff options
author | David Howells <dhowells@redhat.com> | 2021-10-20 17:45:28 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2022-01-07 12:22:19 +0300 |
commit | e8a07c9d22afdace966353231d0273d29efe0890 (patch) | |
tree | 05ac1f37dc2a4d0c699e34cf00e44796169f2c16 /fs/fscache/Makefile | |
parent | 1e1236b841166f1d2daf36fdf6bb3e656bc5f5ca (diff) | |
download | linux-e8a07c9d22afdace966353231d0273d29efe0890.tar.xz |
fscache: Implement a hash function
Implement a function to generate hashes. It needs to be stable over time
and endianness-independent as the hashes will appear on disk in future
patches. It can assume that its input is a multiple of four bytes in size
and alignment.
This is borrowed from the VFS and simplified. le32_to_cpu() is added to
make it endianness-independent.
Changes
=======
ver #3:
- Read the data being hashed in an endianness-independent way[1].
- Change the size parameter to be in bytes rather than words.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/CAHk-=whtkzB446+hX0zdLsdcUJsJ=8_-0S1mE_R+YurThfUbLA@mail.gmail.com [1]
Link: https://lore.kernel.org/r/163819586113.215744.1699465806130102367.stgit@warthog.procyon.org.uk/ # v1
Link: https://lore.kernel.org/r/163906888735.143852.10944614318596881429.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/163967082342.1823006.8915671045444488742.stgit@warthog.procyon.org.uk/ # v3
Link: https://lore.kernel.org/r/164021493624.640689.9990442668811178628.stgit@warthog.procyon.org.uk/ # v4
Diffstat (limited to 'fs/fscache/Makefile')
0 files changed, 0 insertions, 0 deletions