struct bkey_s_c old, struct bkey_s_c new,
unsigned flags)
{
- struct bkey_s_c_stripe old_s = { NULL };
- struct bkey_s_c_stripe new_s = { NULL };
+ struct bkey_s_c_stripe old_s = { .k = NULL };
+ struct bkey_s_c_stripe new_s = { .k = NULL };
struct bch_replicas_padded r;
unsigned i;
int ret = 0;
struct btree_iter *iter = NULL;
struct bkey_s_c k;
u64 min, max, start, pos, *hint;
- int ret;
+ int ret = 0;
u64 cpu = raw_smp_processor_id();
unsigned bits = (c->opts.inodes_32bit
struct bch_hash_info {
u8 type;
- union {
- __le64 crc_key;
- SIPHASH_KEY siphash_key;
- };
+ /*
+ * For crc32 or crc64 string hashes the first key value of
+ * the siphash_key (k0) is used as the key.
+ */
+ SIPHASH_KEY siphash_key;
};
static inline struct bch_hash_info
struct bch_hash_info info = {
.type = (bi->bi_flags >> INODE_STR_HASH_OFFSET) &
~(~0U << INODE_STR_HASH_BITS),
- .crc_key = bi->bi_hash_seed,
+ .siphash_key = { .k0 = bi->bi_hash_seed }
};
if (unlikely(info.type == BCH_STR_HASH_SIPHASH_OLD)) {
{
switch (info->type) {
case BCH_STR_HASH_CRC32C:
- ctx->crc32c = crc32c(~0, &info->crc_key, sizeof(info->crc_key));
+ ctx->crc32c = crc32c(~0, &info->siphash_key.k0,
+ sizeof(info->siphash_key.k0));
break;
case BCH_STR_HASH_CRC64:
- ctx->crc64 = crc64_be(~0, &info->crc_key, sizeof(info->crc_key));
+ ctx->crc64 = crc64_be(~0, &info->siphash_key.k0,
+ sizeof(info->siphash_key.k0));
break;
case BCH_STR_HASH_SIPHASH_OLD:
case BCH_STR_HASH_SIPHASH: