From: Vishal Kanaujia Date: Fri, 27 May 2016 10:06:58 +0000 (+0530) Subject: mds: Removed tmap fetch code from Cdir X-Git-Tag: v11.0.0~252^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f54bc0f3c305837b4db0c33d2de0c2b073dfd7d0;p=ceph.git mds: Removed tmap fetch code from Cdir * TMAP keeps object's xattr within the object. It is deprecated in * Jewel. Post Jewel, we would use only omap. For old clusters, we * would force-convert tmap to omap. Removed tmap code in CDir.cc * and CDir.h. Fixes: http://tracker.ceph.com/issues/15922 Signed-off-by: Vishal Kanaujia --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 3f47918c9ed8..a9a5c9fce078 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1481,57 +1481,6 @@ void CDir::fetch(MDSInternalContextBase *c, const std::set& keys) _omap_fetch(c, keys); } -class C_IO_Dir_TMAP_Fetched : public CDirIOContext { - public: - bufferlist bl; - - C_IO_Dir_TMAP_Fetched(CDir *d) : CDirIOContext(d) { } - void finish(int r) { - dir->_tmap_fetched(bl, r); - } -}; - -void CDir::_tmap_fetch() -{ - // start by reading the first hunk of it - C_IO_Dir_TMAP_Fetched *fin = new C_IO_Dir_TMAP_Fetched(this); - object_t oid = get_ondisk_object(); - object_locator_t oloc(cache->mds->mdsmap->get_metadata_pool()); - ObjectOperation rd; - rd.tmap_get(&fin->bl, NULL); - cache->mds->objecter->read(oid, oloc, rd, CEPH_NOSNAP, NULL, 0, - new C_OnFinisher(fin, cache->mds->finisher)); -} - -void CDir::_tmap_fetched(bufferlist& bl, int r) -{ - LogChannelRef clog = cache->mds->clog; - dout(10) << "_tmap_fetched " << bl.length() << " bytes for " << *this << dendl; - - assert(r == 0 || r == -ENOENT); - assert(is_auth()); - assert(!is_frozen()); - - bufferlist header; - map omap; - - if (bl.length() == 0) { - r = -ENODATA; - } else { - bufferlist::iterator p = bl.begin(); - ::decode(header, p); - ::decode(omap, p); - - if (!p.end()) { - clog->warn() << "tmap buffer of dir " << dirfrag() << " has " - << bl.length() - p.get_off() << " extra bytes\n"; - } - bl.clear(); - } - - _omap_fetched(header, omap, true, r); -} - class C_IO_Dir_OMAP_Fetched : public CDirIOContext { MDSInternalContextBase *fin; public: @@ -1773,12 +1722,6 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map& omap, assert(!is_frozen()); if (hdrbl.length() == 0) { - if (r != -ENODATA) { // called by _tmap_fetched() ? - dout(10) << "_fetched 0 byte from omap, retry tmap" << dendl; - _tmap_fetch(); - return; - } - dout(0) << "_fetched missing object for " << *this << dendl; clog->error() << "dir " << dirfrag() << " object missing on disk; some files may be lost\n"; @@ -2119,8 +2062,6 @@ void CDir::_omap_commit(int op_prio) if (!is_new() && !state_test(CDir::STATE_FRAGMENTING)) op.stat(NULL, (ceph::real_time*) NULL, NULL); - op.tmap_to_omap(true); // convert tmap to omap - if (!to_set.empty()) op.omap_set(to_set); if (!to_remove.empty()) @@ -2143,8 +2084,6 @@ void CDir::_omap_commit(int op_prio) if (!is_new() && !state_test(CDir::STATE_FRAGMENTING)) op.stat(NULL, (ceph::real_time*)NULL, NULL); - op.tmap_to_omap(true); // convert tmap to omap - /* * save the header at the last moment.. If we were to send it off before other * updates, but die before sending them all, we'd think that the on-disk state diff --git a/src/mds/CDir.h b/src/mds/CDir.h index 4818fb8808eb..8ad9edb87459 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -638,8 +638,6 @@ protected: void _omap_fetched(bufferlist& hdrbl, std::map& omap, bool complete, int r); - void _tmap_fetch(); - void _tmap_fetched(bufferlist &bl, int r); // -- commit -- compact_map > waiting_for_commit;