update_engine: Use the FilesystemInterface to generate deltas.

This patch removes the FilesystemIterator used to iterate the file data
blocks, the metadata.{cc,h} files used to iterate the metadata blocks and
the ReadUnwrittenBlocks() method used to process the rest of the blocks.
Instead, these three cases are handled by the same DeltaReadFilesystem()
method using the FilesystemInterface abstraction for ext2.

The sub-file block handling was changed from (filename, offset, size) to
just the list of blocks (or Extents) and the parsing of the filesystem
was removed from the methods that produce operations. The filename is
kept just as a label for logging purposes.

This patch implies that the filesystem doesn't need to be mounted in
order to generate the payload, as all the data is accessed as blocks
in a partition. The mountpoint was removed from all the operations
generators, but it is still required to mount the old filesystem to
detect the minor version supported by the old update_engine. Also,
since the list of blocks is never accessed using the FIGETBSZ ioctl,
no payload_generator/ test require root privileges, nor the
delta_generator binary.

BUG=chromium:305832,chromium:331965
TEST=Updated unittest to use extents.

Change-Id: Ia2ea9433190258f70e3bce09f896b18326a7abf9
Reviewed-on: https://chromium-review.googlesource.com/275804
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/test_utils.cc b/test_utils.cc
index 66db978..afc073c 100644
--- a/test_utils.cc
+++ b/test_utils.cc
@@ -5,6 +5,7 @@
 #include "update_engine/test_utils.h"
 
 #include <attr/xattr.h>
+#include <dirent.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -22,7 +23,6 @@
 #include <base/strings/string_util.h>
 
 #include "update_engine/file_writer.h"
-#include "update_engine/payload_generator/filesystem_iterator.h"
 #include "update_engine/utils.h"
 
 using base::StringPrintf;
@@ -232,51 +232,6 @@
   }
 }
 
-void VerifyAllPaths(const string& parent, set<string> expected_paths) {
-  FilesystemIterator iter(parent, set<string>());
-  ino_t test_ino = 0;
-  ino_t testlink_ino = 0;
-  while (!iter.IsEnd()) {
-    string path = iter.GetFullPath();
-    EXPECT_TRUE(expected_paths.find(path) != expected_paths.end()) << path;
-    EXPECT_EQ(1, expected_paths.erase(path));
-    if (EndsWith(path, "/hi", true) ||
-        EndsWith(path, "/hello", true) ||
-        EndsWith(path, "/test", true) ||
-        EndsWith(path, "/testlink", true)) {
-      EXPECT_TRUE(S_ISREG(iter.GetStat().st_mode));
-      if (EndsWith(path, "/test", true))
-        test_ino = iter.GetStat().st_ino;
-      else if (EndsWith(path, "/testlink", true))
-        testlink_ino = iter.GetStat().st_ino;
-    } else if (EndsWith(path, "/some_dir", true) ||
-               EndsWith(path, "/empty_dir", true) ||
-               EndsWith(path, "/mnt", true) ||
-               EndsWith(path, "/lost+found", true) ||
-               parent == path) {
-      EXPECT_TRUE(S_ISDIR(iter.GetStat().st_mode));
-    } else if (EndsWith(path, "/fifo", true)) {
-      EXPECT_TRUE(S_ISFIFO(iter.GetStat().st_mode));
-    } else if (EndsWith(path, "/cdev", true)) {
-      EXPECT_TRUE(S_ISCHR(iter.GetStat().st_mode));
-    } else if (EndsWith(path, "/sym", true)) {
-      EXPECT_TRUE(S_ISLNK(iter.GetStat().st_mode));
-    } else {
-      LOG(INFO) << "got non hardcoded path: " << path;
-    }
-    iter.Increment();
-  }
-  EXPECT_EQ(testlink_ino, test_ino);
-  EXPECT_NE(0, test_ino);
-  EXPECT_FALSE(iter.IsErr());
-  EXPECT_TRUE(expected_paths.empty());
-  if (!expected_paths.empty()) {
-    for (const string& path : expected_paths) {
-      LOG(INFO) << "extra path: " << path;
-    }
-  }
-}
-
 ScopedLoopMounter::ScopedLoopMounter(const string& file_path,
                                      string* mnt_path,
                                      unsigned long flags) {  // NOLINT - long