| 1259 | } |
| 1260 | |
| 1261 | void CInode::store(MDSContext *fin) |
| 1262 | { |
| 1263 | dout(10) << __func__ << " " << get_version() << dendl; |
| 1264 | ceph_assert(is_base()); |
| 1265 | |
| 1266 | if (snaprealm) |
| 1267 | purge_stale_snap_data(snaprealm->get_snaps()); |
| 1268 | |
| 1269 | // encode |
| 1270 | bufferlist bl; |
| 1271 | string magic = CEPH_FS_ONDISK_MAGIC; |
| 1272 | using ceph::encode; |
| 1273 | encode(magic, bl); |
| 1274 | encode_store(bl, mdcache->mds->mdsmap->get_up_features()); |
| 1275 | |
| 1276 | // write it. |
| 1277 | SnapContext snapc; |
| 1278 | ObjectOperation m; |
| 1279 | m.write_full(bl); |
| 1280 | |
| 1281 | object_t oid = CInode::get_object_name(ino(), frag_t(), ".inode"); |
| 1282 | object_locator_t oloc(mdcache->mds->get_metadata_pool()); |
| 1283 | |
| 1284 | Context *newfin = |
| 1285 | new C_OnFinisher(new C_IO_Inode_Stored(this, get_version(), fin), |
| 1286 | mdcache->mds->finisher); |
| 1287 | mdcache->mds->objecter->mutate(oid, oloc, m, snapc, |
| 1288 | ceph::real_clock::now(), 0, |
| 1289 | newfin); |
| 1290 | } |
| 1291 | |
| 1292 | void CInode::_stored(int r, version_t v, Context *fin) |
| 1293 | { |
no test coverage detected