From: Samuel Just Date: Sat, 1 Feb 2014 05:42:45 +0000 (-0800) Subject: os/: allow objects with NO_GEN but non-NO_SHARD shard X-Git-Tag: v0.78~163^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a8c0bb952a13df499b865fd5dc9ff258db27f85;p=ceph.git os/: allow objects with NO_GEN but non-NO_SHARD shard Signed-off-by: Samuel Just --- diff --git a/src/common/hobject.cc b/src/common/hobject.cc index ffc73aa39e3..ecc8cfde4d7 100644 --- a/src/common/hobject.cc +++ b/src/common/hobject.cc @@ -272,7 +272,8 @@ void ghobject_t::generate_test_instances(list& o) ostream& operator<<(ostream& out, const ghobject_t& o) { out << o.hobj; - if (o.generation != ghobject_t::NO_GEN) { + if (o.generation != ghobject_t::NO_GEN || + o.shard_id != ghobject_t::NO_SHARD) { assert(o.shard_id != ghobject_t::NO_SHARD); out << "/" << o.generation << "/" << (unsigned)(o.shard_id); } diff --git a/src/os/DBObjectMap.cc b/src/os/DBObjectMap.cc index f23815a4298..5334521d3cc 100644 --- a/src/os/DBObjectMap.cc +++ b/src/os/DBObjectMap.cc @@ -156,9 +156,8 @@ string DBObjectMap::ghobject_key(const ghobject_t &oid) t += snprintf(t, end - t, ".%llx", (long long unsigned)oid.hobj.pool); snprintf(t, end - t, ".%.*X", (int)(sizeof(oid.hobj.hash)*2), oid.hobj.hash); - if (oid.generation != ghobject_t::NO_GEN) { - assert(oid.shard_id != ghobject_t::NO_SHARD); - + if (oid.generation != ghobject_t::NO_GEN || + oid.shard_id != ghobject_t::NO_SHARD) { t += snprintf(t, end - t, ".%llx", (long long unsigned)oid.generation); t += snprintf(t, end - t, ".%x", (int)oid.shard_id); } diff --git a/src/os/LFNIndex.cc b/src/os/LFNIndex.cc index 92ccebf0249..0310cb5a6c5 100644 --- a/src/os/LFNIndex.cc +++ b/src/os/LFNIndex.cc @@ -661,8 +661,8 @@ string LFNIndex::lfn_generate_object_name(const ghobject_t &oid) t += snprintf(t, end - t, "%llx", (long long unsigned)oid.hobj.pool); full_name += string(buf); - if (oid.generation != ghobject_t::NO_GEN) { - assert(oid.shard_id != ghobject_t::NO_SHARD); + if (oid.generation != ghobject_t::NO_GEN || + oid.shard_id != ghobject_t::NO_SHARD) { full_name.append("_"); t = buf;