From: Sage Weil Date: Thu, 21 Aug 2014 20:14:51 +0000 (-0700) Subject: Merge pull request #2253 from adamcrume/wip-lttng X-Git-Tag: v0.86~234 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b9ade5058f72116eb3dc920f442361c2a33b46b;p=ceph.git Merge pull request #2253 from adamcrume/wip-lttng RBD-replay Reviewed-by: Sage Weil --- 5b9ade5058f72116eb3dc920f442361c2a33b46b diff --cc src/Makefile.am index 0f5dc732a9b5,41243a2fa404..b954f3f8d051 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -1,10 -1,9 +1,10 @@@ include Makefile-env.am - SUBDIRS += ocf java - DIST_SUBDIRS += gtest ocf libs3 java + SUBDIRS += ocf java tracing + DIST_SUBDIRS += gtest ocf libs3 java tracing + # subdirs include arch/Makefile.am diff --cc src/os/FileStore.cc index 08b29f730097,41eca1cbcb79..afda6192a1d0 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@@ -4445,12 -4424,9 +4542,13 @@@ int FileStore::collection_list(coll_t c int r = get_index(c, &index); if (r < 0) return r; + + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = index->collection_list(&ls); assert(!m_filestore_fail_eio || r != -EIO); + tracepoint(objectstore, collection_list_exit, r); return r; } @@@ -4458,18 -4434,12 +4556,19 @@@ int FileStore::omap_get(coll_t c, cons bufferlist *header, map *out) { + tracepoint(objectstore, omap_get_enter, c.c_str()); dout(15) << __func__ << " " << c << "/" << hoid << dendl; - IndexedPath path; - int r = lfn_find(c, hoid, &path); + Index index; + int r = get_index(c, &index); if (r < 0) return r; + { + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = lfn_find(hoid, index); + if (r < 0) + return r; + } r = object_map->get(hoid, header, out); if (r < 0 && r != -ENOENT) { assert(!m_filestore_fail_eio || r != -EIO); @@@ -4484,18 -4455,12 +4584,19 @@@ int FileStore::omap_get_header bufferlist *bl, bool allow_eio) { + tracepoint(objectstore, omap_get_header_enter, c.c_str()); dout(15) << __func__ << " " << c << "/" << hoid << dendl; - IndexedPath path; - int r = lfn_find(c, hoid, &path); + Index index; + int r = get_index(c, &index); if (r < 0) return r; + { + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = lfn_find(hoid, index); + if (r < 0) + return r; + } r = object_map->get_header(hoid, bl); if (r < 0 && r != -ENOENT) { assert(allow_eio || !m_filestore_fail_eio || r != -EIO); @@@ -4506,18 -4472,12 +4608,19 @@@ int FileStore::omap_get_keys(coll_t c, const ghobject_t &hoid, set *keys) { + tracepoint(objectstore, omap_get_keys_enter, c.c_str()); dout(15) << __func__ << " " << c << "/" << hoid << dendl; - IndexedPath path; - int r = lfn_find(c, hoid, &path); + Index index; + int r = get_index(c, &index); if (r < 0) return r; + { + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = lfn_find(hoid, index); + if (r < 0) + return r; + } r = object_map->get_keys(hoid, keys); if (r < 0 && r != -ENOENT) { assert(!m_filestore_fail_eio || r != -EIO); @@@ -4530,18 -4491,12 +4634,19 @@@ int FileStore::omap_get_values(coll_t c const set &keys, map *out) { + tracepoint(objectstore, omap_get_values_enter, c.c_str()); dout(15) << __func__ << " " << c << "/" << hoid << dendl; - IndexedPath path; - int r = lfn_find(c, hoid, &path); + Index index; + int r = get_index(c, &index); if (r < 0) return r; + { + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = lfn_find(hoid, index); + if (r < 0) + return r; + } r = object_map->get_values(hoid, keys, out); if (r < 0 && r != -ENOENT) { assert(!m_filestore_fail_eio || r != -EIO); @@@ -4554,19 -4510,12 +4660,20 @@@ int FileStore::omap_check_keys(coll_t c const set &keys, set *out) { + tracepoint(objectstore, omap_check_keys_enter, c.c_str()); dout(15) << __func__ << " " << c << "/" << hoid << dendl; - IndexedPath path; - int r = lfn_find(c, hoid, &path); + + Index index; + int r = get_index(c, &index); if (r < 0) return r; + { + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = lfn_find(hoid, index); + if (r < 0) + return r; + } r = object_map->check_keys(hoid, keys, out); if (r < 0 && r != -ENOENT) { assert(!m_filestore_fail_eio || r != -EIO); @@@ -4578,18 -4528,12 +4686,19 @@@ ObjectMap::ObjectMapIterator FileStore::get_omap_iterator(coll_t c, const ghobject_t &hoid) { + tracepoint(objectstore, get_omap_iterator, c.c_str()); dout(15) << __func__ << " " << c << "/" << hoid << dendl; - IndexedPath path; - int r = lfn_find(c, hoid, &path); + Index index; + int r = get_index(c, &index); if (r < 0) - return ObjectMap::ObjectMapIterator(); + return ObjectMap::ObjectMapIterator(); + { + assert(NULL != index.index); + RWLock::RLocker l((index.index)->access_lock); + r = lfn_find(hoid, index); + if (r < 0) + return ObjectMap::ObjectMapIterator(); + } return object_map->get_iterator(hoid); }