Lines Matching refs:f
13 const struct bkey_format *f, in bch2_bkey_packed_to_binary_text() argument
16 const u64 *p = high_word(f, k); in bch2_bkey_packed_to_binary_text()
18 unsigned nr_key_bits = bkey_format_key_bits(f) + high_bit_offset; in bch2_bkey_packed_to_binary_text()
405 const struct bkey_format *f = &b->format; in bkey_packed_successor() local
410 EBUG_ON(b->nr_key_bits != bkey_format_key_bits(f)); in bkey_packed_successor()
418 p = nth_word(high_word(f, out), first_bit >> 6); in bkey_packed_successor()
440 static bool bkey_format_has_too_big_fields(const struct bkey_format *f) in bkey_format_has_too_big_fields() argument
442 for (unsigned i = 0; i < f->nr_fields; i++) { in bkey_format_has_too_big_fields()
445 u64 packed_max = f->bits_per_field[i] in bkey_format_has_too_big_fields()
446 ? ~((~0ULL << 1) << (f->bits_per_field[i] - 1)) in bkey_format_has_too_big_fields()
448 u64 field_offset = le64_to_cpu(f->field_offset[i]); in bkey_format_has_too_big_fields()
470 const struct bkey_format *f = &b->format; in bch2_bkey_pack_pos_lossy() local
471 struct pack_state state = pack_state_init(f, out); in bch2_bkey_pack_pos_lossy()
482 for (i = 0; i < f->key_u64s; i++) in bch2_bkey_pack_pos_lossy()
486 le64_to_cpu(f->field_offset[BKEY_FIELD_SNAPSHOT]))) { in bch2_bkey_pack_pos_lossy()
495 le64_to_cpu(f->field_offset[BKEY_FIELD_OFFSET]))) { in bch2_bkey_pack_pos_lossy()
504 le64_to_cpu(f->field_offset[BKEY_FIELD_INODE]))) in bch2_bkey_pack_pos_lossy()
522 out->u64s = f->key_u64s; in bch2_bkey_pack_pos_lossy()
535 !bkey_format_has_too_big_fields(f)); in bch2_bkey_pack_pos_lossy()
570 static void set_format_field(struct bkey_format *f, enum bch_bkey_fields i, in set_format_field() argument
580 f->bits_per_field[i] = bits; in set_format_field()
581 f->field_offset[i] = cpu_to_le64(offset); in set_format_field()
637 struct bkey_format *f, in bch2_bkey_format_invalid() argument
643 if (f->nr_fields != BKEY_NR_FIELDS) { in bch2_bkey_format_invalid()
645 f->nr_fields, BKEY_NR_FIELDS); in bch2_bkey_format_invalid()
653 for (unsigned i = 0; i < f->nr_fields; i++) { in bch2_bkey_format_invalid()
654 if (bch2_bkey_format_field_overflows(f, i)) { in bch2_bkey_format_invalid()
657 unsigned packed_bits = min(64, f->bits_per_field[i]); in bch2_bkey_format_invalid()
663 i, packed_max, le64_to_cpu(f->field_offset[i]), unpacked_max); in bch2_bkey_format_invalid()
667 bits += f->bits_per_field[i]; in bch2_bkey_format_invalid()
670 if (f->key_u64s != DIV_ROUND_UP(bits, 64)) { in bch2_bkey_format_invalid()
672 f->key_u64s, DIV_ROUND_UP(bits, 64)); in bch2_bkey_format_invalid()
679 void bch2_bkey_format_to_text(struct printbuf *out, const struct bkey_format *f) in bch2_bkey_format_to_text() argument
681 prt_printf(out, "u64s %u fields ", f->key_u64s); in bch2_bkey_format_to_text()
683 for (unsigned i = 0; i < ARRAY_SIZE(f->bits_per_field); i++) { in bch2_bkey_format_to_text()
687 f->bits_per_field[i], in bch2_bkey_format_to_text()
688 le64_to_cpu(f->field_offset[i])); in bch2_bkey_format_to_text()
1060 const struct bkey_format *f = bkey_packed(k) ? _f : &bch2_bkey_format_current; in bch2_bkey_swab_key() local
1062 u8 *h = (u8 *) ((u64 *) k->_data + f->key_u64s) - 1; in bch2_bkey_swab_key()