Bug #14229
Updated by Kefu Chai over 8 years ago
<pre><code class="cpp"> int MemStore::read( coll_t cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl, uint32_t op_flags, bool allow_eio) { dout(10) << __func__ << " " << cid << " " << oid << " " << offset << "~" << len << dendl; CollectionRef c = get_collection(cid); if (!c) return -ENOENT; ObjectRef o = c->get_object(oid); if (!o) return -ENOENT; if (offset >= o->get_size()) return 0; size_t l = len; if (l == 0) // note: len == 0 means read the entire object // also need a guard here l = o->get_size(); </pre>