True RADOS objects have a uint64_t objver associated, increasing upon each write.
This commit adds the same for librados_test_stub objects.
Signed-off-by: Or Ozeri <oro@il.ibm.com>
namespace librados {
TestMemCluster::File::File()
- : snap_id(), exists(true) {
+ : objver(0), snap_id(), exists(true) {
}
TestMemCluster::File::File(const File &rhs)
: data(rhs.data),
mtime(rhs.mtime),
+ objver(rhs.objver),
snap_id(rhs.snap_id),
exists(rhs.exists) {
}
bufferlist data;
time_t mtime;
+ uint64_t objver;
uint64_t snap_id;
std::vector<uint64_t> snaps;
file->mtime = ceph_clock_now().sec();
m_pool->files[{get_namespace(), oid}].push_back(file);
}
+
+ file->objver++;
return file;
}