summaryrefslogtreecommitdiff
path: root/payload_generator/graph_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'payload_generator/graph_utils.cc')
-rw-r--r--payload_generator/graph_utils.cc34
1 files changed, 1 insertions, 33 deletions
diff --git a/payload_generator/graph_utils.cc b/payload_generator/graph_utils.cc
index 3f9b28ff..7b03236d 100644
--- a/payload_generator/graph_utils.cc
+++ b/payload_generator/graph_utils.cc
@@ -13,6 +13,7 @@
#include "update_engine/payload_constants.h"
#include "update_engine/payload_generator/annotated_operation.h"
+#include "update_engine/payload_generator/extent_utils.h"
using std::make_pair;
using std::pair;
@@ -20,7 +21,6 @@ using std::string;
using std::vector;
namespace chromeos_update_engine {
-
namespace graph_utils {
uint64_t EdgeWeight(const Graph& graph, const Edge& edge) {
@@ -35,24 +35,6 @@ uint64_t EdgeWeight(const Graph& graph, const Edge& edge) {
return weight;
}
-void AppendBlockToExtents(vector<Extent>* extents, uint64_t block) {
- // First try to extend the last extent in |extents|, if any.
- if (!extents->empty()) {
- Extent& extent = extents->back();
- uint64_t next_block = extent.start_block() == kSparseHole ?
- kSparseHole : extent.start_block() + extent.num_blocks();
- if (next_block == block) {
- extent.set_num_blocks(extent.num_blocks() + 1);
- return;
- }
- }
- // If unable to extend the last extent, append a new single-block extent.
- Extent new_extent;
- new_extent.set_start_block(block);
- new_extent.set_num_blocks(1);
- extents->push_back(new_extent);
-}
-
void AddReadBeforeDep(Vertex* src,
Vertex::Index dst,
uint64_t block) {
@@ -106,15 +88,6 @@ void DropIncomingEdgesTo(Graph* graph, Vertex::Index index) {
}
}
-Extent GetElement(const vector<Extent>& collection, size_t index) {
- return collection[index];
-}
-Extent GetElement(
- const google::protobuf::RepeatedPtrField<Extent>& collection,
- size_t index) {
- return collection.Get(index);
-}
-
namespace {
template<typename T>
void DumpExtents(const T& field, int prepend_space_count) {
@@ -154,9 +127,4 @@ void DumpGraph(const Graph& graph) {
}
} // namespace graph_utils
-
-bool operator==(const Extent& a, const Extent& b) {
- return a.start_block() == b.start_block() && a.num_blocks() == b.num_blocks();
-}
-
} // namespace chromeos_update_engine