Lines Matching refs:f

26 static inline __u32 ceph_frag_bits(__u32 f)  in ceph_frag_bits()  argument
28 return f >> 24; in ceph_frag_bits()
30 static inline __u32 ceph_frag_value(__u32 f) in ceph_frag_value() argument
32 return f & 0xffffffu; in ceph_frag_value()
34 static inline __u32 ceph_frag_mask(__u32 f) in ceph_frag_mask() argument
36 return (0xffffffu << (24-ceph_frag_bits(f))) & 0xffffffu; in ceph_frag_mask()
38 static inline __u32 ceph_frag_mask_shift(__u32 f) in ceph_frag_mask_shift() argument
40 return 24 - ceph_frag_bits(f); in ceph_frag_mask_shift()
43 static inline int ceph_frag_contains_value(__u32 f, __u32 v) in ceph_frag_contains_value() argument
45 return (v & ceph_frag_mask(f)) == ceph_frag_value(f); in ceph_frag_contains_value()
47 static inline int ceph_frag_contains_frag(__u32 f, __u32 sub) in ceph_frag_contains_frag() argument
50 return ceph_frag_bits(sub) >= ceph_frag_bits(f) && in ceph_frag_contains_frag()
51 (ceph_frag_value(sub) & ceph_frag_mask(f)) == ceph_frag_value(f); in ceph_frag_contains_frag()
54 static inline __u32 ceph_frag_parent(__u32 f) in ceph_frag_parent() argument
56 return ceph_frag_make(ceph_frag_bits(f) - 1, in ceph_frag_parent()
57 ceph_frag_value(f) & (ceph_frag_mask(f) << 1)); in ceph_frag_parent()
59 static inline int ceph_frag_is_left_child(__u32 f) in ceph_frag_is_left_child() argument
61 return ceph_frag_bits(f) > 0 && in ceph_frag_is_left_child()
62 (ceph_frag_value(f) & (0x1000000 >> ceph_frag_bits(f))) == 0; in ceph_frag_is_left_child()
64 static inline int ceph_frag_is_right_child(__u32 f) in ceph_frag_is_right_child() argument
66 return ceph_frag_bits(f) > 0 && in ceph_frag_is_right_child()
67 (ceph_frag_value(f) & (0x1000000 >> ceph_frag_bits(f))) == 1; in ceph_frag_is_right_child()
69 static inline __u32 ceph_frag_sibling(__u32 f) in ceph_frag_sibling() argument
71 return ceph_frag_make(ceph_frag_bits(f), in ceph_frag_sibling()
72 ceph_frag_value(f) ^ (0x1000000 >> ceph_frag_bits(f))); in ceph_frag_sibling()
74 static inline __u32 ceph_frag_left_child(__u32 f) in ceph_frag_left_child() argument
76 return ceph_frag_make(ceph_frag_bits(f)+1, ceph_frag_value(f)); in ceph_frag_left_child()
78 static inline __u32 ceph_frag_right_child(__u32 f) in ceph_frag_right_child() argument
80 return ceph_frag_make(ceph_frag_bits(f)+1, in ceph_frag_right_child()
81 ceph_frag_value(f) | (0x1000000 >> (1+ceph_frag_bits(f)))); in ceph_frag_right_child()
83 static inline __u32 ceph_frag_make_child(__u32 f, int by, int i) in ceph_frag_make_child() argument
85 int newbits = ceph_frag_bits(f) + by; in ceph_frag_make_child()
87 ceph_frag_value(f) | (i << (24 - newbits))); in ceph_frag_make_child()
89 static inline int ceph_frag_is_leftmost(__u32 f) in ceph_frag_is_leftmost() argument
91 return ceph_frag_value(f) == 0; in ceph_frag_is_leftmost()
93 static inline int ceph_frag_is_rightmost(__u32 f) in ceph_frag_is_rightmost() argument
95 return ceph_frag_value(f) == ceph_frag_mask(f); in ceph_frag_is_rightmost()
97 static inline __u32 ceph_frag_next(__u32 f) in ceph_frag_next() argument
99 return ceph_frag_make(ceph_frag_bits(f), in ceph_frag_next()
100 ceph_frag_value(f) + (0x1000000 >> ceph_frag_bits(f))); in ceph_frag_next()