summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal.cc')
-rw-r--r--src/journal.cc29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/journal.cc b/src/journal.cc
index b7ad9a23..2366ce30 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -126,16 +126,23 @@ bool journal_t::add_xact(xact_t * xact)
{
xact->journal = this;
- if (! xact->finalize() || ! xact_finalize_hooks.run_hooks(*xact)) {
+ if (! xact->finalize()) {
xact->journal = NULL;
return false;
}
+ extend_xact(xact);
xacts.push_back(xact);
return true;
}
+void journal_t::extend_xact(xact_base_t * xact)
+{
+ foreach (auto_xact_t * auto_xact, auto_xacts)
+ auto_xact->extend_xact(*xact);
+}
+
bool journal_t::remove_xact(xact_t * xact)
{
bool found = false;
@@ -204,6 +211,26 @@ std::size_t journal_t::read(const path& pathname,
return count;
}
+bool journal_t::has_xdata()
+{
+ foreach (xact_t * xact, xacts)
+ if (xact->has_xdata())
+ return true;
+
+ foreach (auto_xact_t * xact, auto_xacts)
+ if (xact->has_xdata())
+ return true;
+
+ foreach (period_xact_t * xact, period_xacts)
+ if (xact->has_xdata())
+ return true;
+
+ if (master->has_xdata() || master->children_with_xdata())
+ return true;
+
+ return false;
+}
+
void journal_t::clear_xdata()
{
foreach (xact_t * xact, xacts)