class C_Dir_Committed : public Context {
CDir *dir;
- version_t version, last_renamed_version;
+ version_t version;
public:
- C_Dir_Committed(CDir *d, version_t v, version_t lrv) : dir(d), version(v), last_renamed_version(lrv) { }
+ C_Dir_Committed(CDir *d, version_t v) : dir(d), version(v) { }
void finish(int r) {
- dir->_committed(version, last_renamed_version);
+ dir->_committed(version);
}
};
if (committed_dn == items.end())
cache->mds->objecter->mutate(oid, oloc, m, snapc, ceph_clock_now(g_ceph_context), 0, NULL,
- new C_Dir_Committed(this, get_version(),
- inode->inode.last_renamed_version));
+ new C_Dir_Committed(this, get_version()));
else { // send in a different Context
- C_GatherBuilder gather(g_ceph_context,
- new C_Dir_Committed(this, get_version(),
- inode->inode.last_renamed_version));
+ C_GatherBuilder gather(g_ceph_context, new C_Dir_Committed(this, get_version()));
while (committed_dn != items.end()) {
ObjectOperation n = ObjectOperation();
committed_dn = _commit_partial(n, snaps, max_write_size, committed_dn);
*
* @param v version i just committed
*/
-void CDir::_committed(version_t v, version_t lrv)
+void CDir::_committed(version_t v)
{
- dout(10) << "_committed v " << v << " (last renamed " << lrv << ") on " << *this << dendl;
+ dout(10) << "_committed v " << v << " on " << *this << dendl;
assert(is_auth());
bool stray = inode->is_stray();
unsigned max_write_size=-1,
map_t::iterator last_committed_dn=map_t::iterator());
void _encode_dentry(CDentry *dn, bufferlist& bl, const set<snapid_t> *snaps);
- void _committed(version_t v, version_t last_renamed_version);
+ void _committed(version_t v);
void wait_for_commit(Context *c, version_t v=0);
// -- dirtyness --
if (!silent) {
if (pi) {
- pi->last_renamed_version = pi->version;
pi->ctime = mdr->now;
if (linkmerge)
pi->nlink--;
::encode(version, bl);
::encode(file_data_version, bl);
::encode(xattr_version, bl);
- ::encode(last_renamed_version, bl);
+ ::encode(backtrace_version, bl);
::encode(old_pools, bl);
ENCODE_FINISH(bl);
::decode(file_data_version, p);
::decode(xattr_version, p);
if (struct_v >= 2)
- ::decode(last_renamed_version, p);
+ ::decode(backtrace_version, p);
if (struct_v >= 7)
::decode(old_pools, p);
f->dump_unsigned("version", version);
f->dump_unsigned("file_data_version", file_data_version);
f->dump_unsigned("xattr_version", xattr_version);
- f->dump_unsigned("last_renamed_version", last_renamed_version);
+ f->dump_unsigned("backtrace_version", backtrace_version);
}
void inode_t::generate_test_instances(list<inode_t*>& ls)
version_t file_data_version; // auth only
version_t xattr_version;
- version_t last_renamed_version; // when i was last renamed
+ version_t backtrace_version;
inode_t() : ino(0), rdev(0),
mode(0), uid(0), gid(0),
size(0), truncate_seq(0), truncate_size(0), truncate_from(0),
truncate_pending(0),
time_warp_seq(0),
- version(0), file_data_version(0), xattr_version(0), last_renamed_version(0) {
+ version(0), file_data_version(0), xattr_version(0), backtrace_version(0) {
clear_layout();
memset(&dir_layout, 0, sizeof(dir_layout));
}
}
}
+ bool is_backtrace_updated() {
+ return backtrace_version == version;
+ }
+ void update_backtrace() {
+ backtrace_version = version;
+ }
+
void add_old_pool(int64_t l) {
+ backtrace_version = version;
old_pools.push_back(l);
}