Release 4.12 include/linux/ceph/ceph_frag.h
#ifndef FS_CEPH_FRAG_H
#define FS_CEPH_FRAG_H
/*
* "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.
*/
static inline __u32 ceph_frag_make(__u32 b, __u32 v)
{
return (b << 24) |
(v & (0xffffffu << (24-b)) & 0xffffffu);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 36 | 100.00% | 1 | 100.00% |
Total | 36 | 100.00% | 1 | 100.00% |
static inline __u32 ceph_frag_bits(__u32 f)
{
return f >> 24;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline __u32 ceph_frag_value(__u32 f)
{
return f & 0xffffffu;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline __u32 ceph_frag_mask(__u32 f)
{
return (0xffffffu << (24-ceph_frag_bits(f))) & 0xffffffu;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
static inline __u32 ceph_frag_mask_shift(__u32 f)
{
return 24 - ceph_frag_bits(f);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
static inline bool ceph_frag_contains_value(__u32 f, __u32 v)
{
return (v & ceph_frag_mask(f)) == ceph_frag_value(f);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 27 | 96.43% | 1 | 50.00% |
Yaowei Bai | 1 | 3.57% | 1 | 50.00% |
Total | 28 | 100.00% | 2 | 100.00% |
static inline __u32 ceph_frag_make_child(__u32 f, int by, int i)
{
int newbits = ceph_frag_bits(f) + by;
return ceph_frag_make(newbits,
ceph_frag_value(f) | (i << (24 - newbits)));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 47 | 100.00% | 1 | 100.00% |
Total | 47 | 100.00% | 1 | 100.00% |
static inline bool ceph_frag_is_leftmost(__u32 f)
{
return ceph_frag_value(f) == 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 17 | 94.44% | 1 | 50.00% |
Zhang Zhuoyu | 1 | 5.56% | 1 | 50.00% |
Total | 18 | 100.00% | 2 | 100.00% |
static inline bool ceph_frag_is_rightmost(__u32 f)
{
return ceph_frag_value(f) == ceph_frag_mask(f);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 20 | 95.24% | 1 | 50.00% |
Zhang Zhuoyu | 1 | 4.76% | 1 | 50.00% |
Total | 21 | 100.00% | 2 | 100.00% |
static inline __u32 ceph_frag_next(__u32 f)
{
return ceph_frag_make(ceph_frag_bits(f),
ceph_frag_value(f) + (0x1000000 >> ceph_frag_bits(f)));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 33 | 100.00% | 1 | 100.00% |
Total | 33 | 100.00% | 1 | 100.00% |
/*
* comparator to sort frags logically, as when traversing the
* number space in ascending order...
*/
int ceph_frag_compare(__u32 a, __u32 b);
#endif
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sage Weil | 274 | 98.92% | 2 | 50.00% |
Zhang Zhuoyu | 2 | 0.72% | 1 | 25.00% |
Yaowei Bai | 1 | 0.36% | 1 | 25.00% |
Total | 277 | 100.00% | 4 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.