summaryrefslogtreecommitdiffstats
path: root/src/osd/PGBackend.cc
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2014-01-23 02:56:30 +0100
committerSamuel Just <sam.just@inktank.com>2014-02-18 05:11:06 +0100
commit31b7937bae578d60559f41f2b225206d7fa90e0f (patch)
tree05c0a18c0155b40791052b2df9a90fe2746c9191 /src/osd/PGBackend.cc
parentPGBackend: use whoami_shard().shard in rollback*, objects* (diff)
downloadceph-31b7937bae578d60559f41f2b225206d7fa90e0f.tar.xz
ceph-31b7937bae578d60559f41f2b225206d7fa90e0f.zip
PGBackend/ReplicatedBackend: move temp handling into PGBackend
Temp handling is also the same in ReplicatedBackend as in ECBackend. Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/osd/PGBackend.cc')
-rw-r--r--src/osd/PGBackend.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc
index 1dddd928ada..99e191c45c1 100644
--- a/src/osd/PGBackend.cc
+++ b/src/osd/PGBackend.cc
@@ -73,6 +73,33 @@ void PGBackend::rollback(
}
+void PGBackend::on_change(ObjectStore::Transaction *t)
+{
+ dout(10) << __func__ << dendl;
+ // clear temp
+ for (set<hobject_t>::iterator i = temp_contents.begin();
+ i != temp_contents.end();
+ ++i) {
+ dout(10) << __func__ << ": Removing oid "
+ << *i << " from the temp collection" << dendl;
+ t->remove(
+ get_temp_coll(t),
+ ghobject_t(*i, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard));
+ }
+ temp_contents.clear();
+ _on_change(t);
+}
+
+coll_t PGBackend::get_temp_coll(ObjectStore::Transaction *t)
+{
+ if (temp_created)
+ return temp_coll;
+ if (!store->collection_exists(temp_coll))
+ t->create_collection(temp_coll);
+ temp_created = true;
+ return temp_coll;
+}
+
int PGBackend::objects_list_partial(
const hobject_t &begin,
int min,