From: Sage Weil Date: Thu, 18 Jun 2015 13:52:43 +0000 (-0700) Subject: os/FileStore: munge cid -> temp cid on read ops too X-Git-Tag: v9.0.3~52^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6033591d35e259d8608ff47b2c966df92f4c2e3a;p=ceph.git os/FileStore: munge cid -> temp cid on read ops too Signed-off-by: Sage Weil --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index cd0a11306396..a2a424c60a51 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -2846,6 +2846,7 @@ unsigned FileStore::_do_transaction( bool FileStore::exists(coll_t cid, const ghobject_t& oid) { tracepoint(objectstore, exists_enter, cid.c_str()); + _kludge_temp_object_collection(cid, oid); struct stat st; bool retval = stat(cid, oid, &st) == 0; tracepoint(objectstore, exists_exit, retval); @@ -2856,6 +2857,7 @@ int FileStore::stat( coll_t cid, const ghobject_t& oid, struct stat *st, bool allow_eio) { tracepoint(objectstore, stat_enter, cid.c_str()); + _kludge_temp_object_collection(cid, oid); int r = lfn_stat(cid, oid, st); assert(allow_eio || !m_filestore_fail_eio || r != -EIO); if (r < 0) { @@ -2886,6 +2888,7 @@ int FileStore::read( { int got; tracepoint(objectstore, read_enter, cid.c_str(), offset, len); + _kludge_temp_object_collection(cid, oid); dout(15) << "read " << cid << "/" << oid << " " << offset << "~" << len << dendl; @@ -3062,6 +3065,7 @@ int FileStore::fiemap(coll_t cid, const ghobject_t& oid, bufferlist& bl) { tracepoint(objectstore, fiemap_enter, cid.c_str(), offset, len); + _kludge_temp_object_collection(cid, oid); if ((!backend->has_seek_data_hole() && !backend->has_fiemap()) || len <= (size_t)m_filestore_fiemap_threshold) { @@ -4011,6 +4015,7 @@ bool FileStore::debug_mdata_eio(const ghobject_t &oid) { int FileStore::getattr(coll_t cid, const ghobject_t& oid, const char *name, bufferptr &bp) { tracepoint(objectstore, getattr_enter, cid.c_str()); + _kludge_temp_object_collection(cid, oid); dout(15) << "getattr " << cid << "/" << oid << " '" << name << "'" << dendl; FDRef fd; int r = lfn_open(cid, oid, false, &fd); @@ -4059,6 +4064,7 @@ int FileStore::getattr(coll_t cid, const ghobject_t& oid, const char *name, buff int FileStore::getattrs(coll_t cid, const ghobject_t& oid, map& aset) { tracepoint(objectstore, getattrs_enter, cid.c_str()); + _kludge_temp_object_collection(cid, oid); set omap_attrs; map omap_aset; Index index; @@ -4808,6 +4814,7 @@ int FileStore::omap_get(coll_t c, const ghobject_t &hoid, map *out) { tracepoint(objectstore, omap_get_enter, c.c_str()); + _kludge_temp_object_collection(c, hoid); dout(15) << __func__ << " " << c << "/" << hoid << dendl; Index index; int r = get_index(c, &index); @@ -4836,6 +4843,7 @@ int FileStore::omap_get_header( bool allow_eio) { tracepoint(objectstore, omap_get_header_enter, c.c_str()); + _kludge_temp_object_collection(c, hoid); dout(15) << __func__ << " " << c << "/" << hoid << dendl; Index index; int r = get_index(c, &index); @@ -4860,6 +4868,7 @@ int FileStore::omap_get_header( int FileStore::omap_get_keys(coll_t c, const ghobject_t &hoid, set *keys) { tracepoint(objectstore, omap_get_keys_enter, c.c_str()); + _kludge_temp_object_collection(c, hoid); dout(15) << __func__ << " " << c << "/" << hoid << dendl; Index index; int r = get_index(c, &index); @@ -4886,6 +4895,7 @@ int FileStore::omap_get_values(coll_t c, const ghobject_t &hoid, map *out) { tracepoint(objectstore, omap_get_values_enter, c.c_str()); + _kludge_temp_object_collection(c, hoid); dout(15) << __func__ << " " << c << "/" << hoid << dendl; Index index; const char *where = 0; @@ -4921,6 +4931,7 @@ int FileStore::omap_check_keys(coll_t c, const ghobject_t &hoid, set *out) { tracepoint(objectstore, omap_check_keys_enter, c.c_str()); + _kludge_temp_object_collection(c, hoid); dout(15) << __func__ << " " << c << "/" << hoid << dendl; Index index; @@ -4947,6 +4958,7 @@ ObjectMap::ObjectMapIterator FileStore::get_omap_iterator(coll_t c, const ghobject_t &hoid) { tracepoint(objectstore, get_omap_iterator, c.c_str()); + _kludge_temp_object_collection(c, hoid); dout(15) << __func__ << " " << c << "/" << hoid << dendl; Index index; int r = get_index(c, &index); diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 6d83780da27c..699c63895161 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -140,7 +140,7 @@ private: int get_index(coll_t c, Index *index); int init_index(coll_t c); - void _kludge_temp_object_collection(coll_t& cid, ghobject_t& oid) { + void _kludge_temp_object_collection(coll_t& cid, const ghobject_t& oid) { if (oid.hobj.pool < -1 && !cid.is_temp()) cid = cid.get_temp(); }