Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: graph_types.h

Issue 3596007: AU: More graph utilities (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: fixes for review and merge origin/master Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | graph_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: graph_types.h
diff --git a/graph_types.h b/graph_types.h
index e7867f6f4067638c41093008fe40caa7d36d189d..e3220c0e603660dcdc3d698cc6f11f298629b97e 100644
--- a/graph_types.h
+++ b/graph_types.h
@@ -18,12 +18,28 @@
namespace chromeos_update_engine {
+bool operator==(const Extent& a, const Extent& b);
+
struct EdgeProperties {
- std::vector<Extent> extents; // filesystem extents represented
+ // Read-before extents. I.e., blocks in |extents| must be read by the
+ // node pointed to before the pointing node runs (presumably b/c it
+ // overwrites these blocks).
+ std::vector<Extent> extents;
+
+ // Write before extents. I.e., blocks in |write_extents| must be written
+ // by the node pointed to before the pointing node runs (presumably
+ // b/c it reads the data written by the other node).
+ std::vector<Extent> write_extents;
+
+ bool operator==(const EdgeProperties& that) const {
+ return extents == that.extents && write_extents == that.write_extents;
+ }
};
struct Vertex {
- Vertex() : index(-1), lowlink(-1) {}
+ Vertex() : valid(true), index(-1), lowlink(-1) {}
+ bool valid;
+
typedef std::map<std::vector<Vertex>::size_type, EdgeProperties> EdgeMap;
EdgeMap out_edges;
@@ -51,6 +67,8 @@ typedef std::vector<Vertex> Graph;
typedef std::pair<Vertex::Index, Vertex::Index> Edge;
const uint64_t kSparseHole = kuint64max;
+const uint64_t kTempBlockStart = 1ULL << 60;
+COMPILE_ASSERT(kTempBlockStart != 0, kTempBlockStart_invalid);
} // namespace chromeos_update_engine
« no previous file with comments | « no previous file | graph_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698