-int FakeStore::remove(object_t oid)
+int FakeStore::remove(object_t oid, Context *onsafe)
{
dout(20) << "remove " << oid << endl;
string fn;
get_oname(oid,fn);
int r = ::unlink(fn.c_str());
+ if (onsafe)
+ g_timer.add_event_after((float)g_conf.fakestore_fake_sync,
+ onsafe);
return r;
}
-int FakeStore::truncate(object_t oid, off_t size)
+int FakeStore::truncate(object_t oid, off_t size, Context *onsafe)
{
dout(20) << "truncate " << oid << " size " << size << endl;
string fn;
get_oname(oid,fn);
- return ::truncate(fn.c_str(), size);
+ int r = ::truncate(fn.c_str(), size);
+ if (onsafe)
+ g_timer.add_event_after((float)g_conf.fakestore_fake_sync,
+ onsafe);
+ return r;
}
int FakeStore::read(object_t oid,
// objects
bool exists(object_t oid);
int stat(object_t oid, struct stat *st);
- int remove(object_t oid);
- int truncate(object_t oid, off_t size);
+ int remove(object_t oid, Context *onsafe);
+ int truncate(object_t oid, off_t size, Context *onsafe);
int read(object_t oid,
size_t len, off_t offset,
bufferlist& bl);