dout(10) << " pgls pg=" << op->get_pg() << " != " << info.pgid << dendl;
result = 0; // hmm?
} else {
- dout(10) << " pgls pg=" << op->get_pg() << dendl;
+ dout(10) << " pgls pg=" << op->get_pg() << " count " << p->op.pgls.count << dendl;
// read into a buffer
+ vector<sobject_t> sentries;
PGLSResponse response;
response.handle = (collection_list_handle_t)(uint64_t)(p->op.pgls.cookie);
- vector<sobject_t> sentries;
- result = osd->store->collection_list_partial(coll, snapid,
- sentries, p->op.pgls.count,
- &response.handle);
+
+ uint64_t high_bit = 1ull << 63;
+ if ((response.handle & high_bit) == 0) {
+ // it's an offset into the missing set
+ version_t v = response.handle;
+ dout(10) << " handle low/missing " << v << dendl;
+ map<version_t, sobject_t>::iterator mp = missing.rmissing.lower_bound(v);
+ result = 0;
+ while (sentries.size() < p->op.pgls.count) {
+ if (mp == missing.rmissing.end()) {
+ dout(10) << " handle finished low/missing, moving to high/ondisk" << dendl;
+ response.handle = high_bit;
+ break;
+ }
+ sentries.push_back(mp->second);
+ response.handle = mp->first + 1;
+ }
+ }
+ if (sentries.size() < p->op.pgls.count &&
+ (response.handle & high_bit)) {
+ // it's a readdir cookie
+ response.handle &= high_bit - 1ull;
+ dout(10) << " handle high/missing " << response.handle << dendl;
+ result = osd->store->collection_list_partial(coll, snapid,
+ sentries, p->op.pgls.count - sentries.size(),
+ &response.handle);
+ response.handle |= high_bit;
+ }
+
if (result == 0) {
vector<sobject_t>::iterator iter;
for (iter = sentries.begin(); iter != sentries.end(); ++iter) {