Lines Matching +full:9 +full:v

17  * @v:		unsigned integer to encode
18 * Returns: size in bytes of the encoded integer - at most 9 bytes
20 int bch2_varint_encode(u8 *out, u64 v) in bch2_varint_encode() argument
22 unsigned bits = fls64(v|1); in bch2_varint_encode()
26 if (likely(bytes < 9)) { in bch2_varint_encode()
27 v <<= bytes; in bch2_varint_encode()
28 v |= ~(~0 << (bytes - 1)); in bch2_varint_encode()
29 v_le = cpu_to_le64(v); in bch2_varint_encode()
33 bytes = 9; in bch2_varint_encode()
34 put_unaligned_le64(v, out); in bch2_varint_encode()
53 u64 v; in bch2_varint_decode() local
58 if (likely(bytes < 9)) { in bch2_varint_decode()
62 v = le64_to_cpu(v_le); in bch2_varint_decode()
63 v >>= bytes; in bch2_varint_decode()
65 v = get_unaligned_le64(++in); in bch2_varint_decode()
68 *out = v; in bch2_varint_decode()
75 * @v: unsigned integer to encode
76 * Returns: size in bytes of the encoded integer - at most 9 bytes
81 int bch2_varint_encode_fast(u8 *out, u64 v) in bch2_varint_encode_fast() argument
83 unsigned bits = fls64(v|1); in bch2_varint_encode_fast()
86 if (likely(bytes < 9)) { in bch2_varint_encode_fast()
87 v <<= bytes; in bch2_varint_encode_fast()
88 v |= ~(~0U << (bytes - 1)); in bch2_varint_encode_fast()
91 bytes = 9; in bch2_varint_encode_fast()
94 put_unaligned_le64(v, out); in bch2_varint_encode_fast()
114 u64 v = get_unaligned_le64(in); in bch2_varint_decode_fast() local
120 if (likely(bytes < 9)) { in bch2_varint_decode_fast()
121 v >>= bytes; in bch2_varint_decode_fast()
122 v &= ~(~0ULL << (7 * bytes)); in bch2_varint_decode_fast()
124 v = get_unaligned_le64(++in); in bch2_varint_decode_fast()
127 *out = v; in bch2_varint_decode_fast()