Signed-off-by: Sage Weil <sage@redhat.com>
string ceph_osd_op_flag_string(unsigned flags)
{
string s;
- for (unsigned i=0; i<31; ++i) {
+ for (unsigned i=0; i<32; ++i) {
if (flags & (1u<<i)) {
if (s.length())
s += "+";
return string("-");
}
+string ceph_osd_alloc_hint_flag_string(unsigned flags)
+{
+ string s;
+ for (unsigned i=0; i<32; ++i) {
+ if (flags & (1u<<i)) {
+ if (s.length())
+ s += "+";
+ s += ceph_osd_alloc_hint_flag_name(1u << i);
+ }
+ }
+ if (s.length())
+ return s;
+ return string("-");
+}
+
void pg_shard_t::encode(bufferlist &bl) const
{
ENCODE_START(1, 1, bl);
string ceph_osd_flag_string(unsigned flags);
/// conver CEPH_OSD_OP_FLAG_* op flags to a string
string ceph_osd_op_flag_string(unsigned flags);
+/// conver CEPH_OSD_ALLOC_HINT_FLAG_* op flags to a string
+string ceph_osd_alloc_hint_flag_string(unsigned flags);
struct pg_shard_t {
int32_t osd;