From 4887f9ae53c4898ae6dfbd30a93778c792d6d62a Mon Sep 17 00:00:00 2001 From: sage Date: Sat, 6 May 2006 02:03:15 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@758 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/osd/FakeStore.cc | 13 ++++++++++--- ceph/osd/FakeStore.h | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ceph/osd/FakeStore.cc b/ceph/osd/FakeStore.cc index 7aa7dff62b3fc..ae4aeaa6bd411 100644 --- a/ceph/osd/FakeStore.cc +++ b/ceph/osd/FakeStore.cc @@ -259,22 +259,29 @@ int FakeStore::stat(object_t oid, -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, diff --git a/ceph/osd/FakeStore.h b/ceph/osd/FakeStore.h index bb128dbef3821..cc4a7bfff1d7c 100644 --- a/ceph/osd/FakeStore.h +++ b/ceph/osd/FakeStore.h @@ -74,8 +74,8 @@ class FakeStore : public ObjectStore, // 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); -- 2.39.5