| 1347 | }; |
| 1348 | |
| 1349 | void CInode::fetch(MDSContext *fin) |
| 1350 | { |
| 1351 | dout(10) << __func__ << dendl; |
| 1352 | |
| 1353 | C_IO_Inode_Fetched *c = new C_IO_Inode_Fetched(this, fin); |
| 1354 | C_GatherBuilder gather(g_ceph_context, new C_OnFinisher(c, mdcache->mds->finisher)); |
| 1355 | |
| 1356 | object_t oid = CInode::get_object_name(ino(), frag_t(), ""); |
| 1357 | object_locator_t oloc(mdcache->mds->get_metadata_pool()); |
| 1358 | |
| 1359 | // Old on-disk format: inode stored in xattr of a dirfrag |
| 1360 | ObjectOperation rd; |
| 1361 | rd.getxattr("inode", &c->bl, NULL); |
| 1362 | mdcache->mds->objecter->read(oid, oloc, rd, CEPH_NOSNAP, (bufferlist*)NULL, 0, gather.new_sub()); |
| 1363 | |
| 1364 | // Current on-disk format: inode stored in a .inode object |
| 1365 | object_t oid2 = CInode::get_object_name(ino(), frag_t(), ".inode"); |
| 1366 | mdcache->mds->objecter->read(oid2, oloc, 0, 0, CEPH_NOSNAP, &c->bl2, 0, gather.new_sub()); |
| 1367 | |
| 1368 | gather.activate(); |
| 1369 | } |
| 1370 | |
| 1371 | void CInode::_fetched(bufferlist& bl, bufferlist& bl2, Context *fin) |
| 1372 | { |
no test coverage detected