/* * "Frags" are a way to describe a subset of a 32-bit number space, * using a mask and a value to match against that mask. Any given frag * (subset of the number space) can be partitioned into 2^n sub-frags. * * Frags are encoded into a 32-bit word: * 8 upper bits = "bits" * 24 lower bits = "value" * (We could go to 5+27 bits, but who cares.) * * We use the _most_ significant bits of the 24 bit value. This makes * values logically sort. * * Unfortunately, because the "bits" field is still in the high bits, we * can't sort encoded frags numerically. However, it does allow you * to feed encoded frags as values into frag_contains_value.
*/ staticinline __u32 ceph_frag_make(__u32 b, __u32 v)
{ return (b << 24) |
(v & (0xffffffu << (24-b)) & 0xffffffu);
} staticinline __u32 ceph_frag_bits(__u32 f)
{ return f >> 24;
} staticinline __u32 ceph_frag_value(__u32 f)
{ return f & 0xffffffu;
} staticinline __u32 ceph_frag_mask(__u32 f)
{ return (0xffffffu << (24-ceph_frag_bits(f))) & 0xffffffu;
} staticinline __u32 ceph_frag_mask_shift(__u32 f)
{ return 24 - ceph_frag_bits(f);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.