}
hobject_t next;
- hobject_t current = response.handle;
+ hobject_t lower_bound = response.handle;
+ dout(10) << " pgnls lower_bound " << lower_bound << dendl;
+
+ hobject_t current = lower_bound;
osr->flush();
int r = pgbackend->objects_list_partial(
current,
++ls_iter;
}
+ dout(10) << " pgnls candidate 0x" << std::hex << candidate.get_hash()
+ << " vs lower bound 0x" << lower_bound.get_hash() << dendl;
+
if (cmp(candidate, next, get_sort_bitwise()) >= 0) {
break;
}
if (filter && !pgls_filter(filter, candidate, filter_out))
continue;
+ dout(20) << "pgnls item 0x" << std::hex
+ << candidate.get_hash()
+ << ", rev 0x" << hobject_t::_reverse_bits(candidate.get_hash())
+ << std::dec << " "
+ << candidate.oid.name << dendl;
+
librados::ListObjectImpl item;
item.nspace = candidate.get_namespace();
item.oid = candidate.oid.name;
item.locator = candidate.get_key();
response.entries.push_back(item);
}
+
if (next.is_max() &&
missing_iter == pg_log.get_missing().missing.end() &&
ls_iter == sentries.end()) {
result = 1;
- }
- response.handle = next;
+
+ if (get_osdmap()->test_flag(CEPH_OSDMAP_SORTBITWISE)) {
+ // Set response.handle to the start of the next PG
+ // according to the object sort order. Only do this if
+ // the cluster is in bitwise mode; with legacy nibblewise
+ // sort PGs don't always cover contiguous ranges of the
+ // hash order.
+ response.handle = info.pgid.pgid.get_hobj_end(
+ pool.info.get_pg_num());
+ }
+ } else {
+ response.handle = next;
+ }
+ dout(10) << "pgls handle=" << response.handle << dendl;
::encode(response, osd_op.outdata);
if (filter)
::encode(filter_out, osd_op.outdata);