diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-10-04 15:58:43 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:28 -0400 |
commit | 73501ab82c44b1249916ded8dcb883f7705b1549 (patch) | |
tree | 0b60bc0940103196e3a77e3c0cd0b57b4e3851af /fs/bcachefs/inode.c | |
parent | bd09d268978e1206d81a169039cf86f639817854 (diff) |
bcachefs: Don't use sha256 for siphash str hash key
With the refactoring that's coming to add fuse support, we want
bch2_hash_info_init() to be cheaper so we don't have to rely on anything
cached besides the inode in the btree.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/inode.c')
-rw-r--r-- | fs/bcachefs/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c index fc38cfb9e939..3dc46faaebbc 100644 --- a/fs/bcachefs/inode.c +++ b/fs/bcachefs/inode.c @@ -6,8 +6,7 @@ #include "error.h" #include "extents.h" #include "inode.h" -#include "io.h" -#include "keylist.h" +#include "str_hash.h" #include <linux/random.h> @@ -303,11 +302,13 @@ void bch2_inode_init(struct bch_fs *c, struct bch_inode_unpacked *inode_u, struct bch_inode_unpacked *parent) { s64 now = bch2_current_time(c); + enum bch_str_hash_type str_hash = + bch2_str_hash_opt_to_type(c, c->opts.str_hash); memset(inode_u, 0, sizeof(*inode_u)); /* ick */ - inode_u->bi_flags |= c->opts.str_hash << INODE_STR_HASH_OFFSET; + inode_u->bi_flags |= str_hash << INODE_STR_HASH_OFFSET; get_random_bytes(&inode_u->bi_hash_seed, sizeof(inode_u->bi_hash_seed)); |