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;
}
bufferlist *header,
map<string, bufferlist> *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);
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);
int FileStore::omap_get_keys(coll_t c, const ghobject_t &hoid, set<string> *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);
const set<string> &keys,
map<string, bufferlist> *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);
const set<string> &keys,
set<string> *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);
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);
}