p2p: Skip some tests if xattr support is not available.

This is needed because some builders still lack xattr / fallocate
support despite being updated to Precise. Also gracefully handle lack
of fallocate(2) support since this feature is not always available
either.

BUG=chromium:298397
TEST=Remounted the filesystem holding my chroot with nouser_xattr
  (e.g. 'mount -oremount,nouser_xattr /ssd') and unit tests pass with
  the newly added warning.

Change-Id: I0fe53d762fad778a3d68162ddcd8bc74557fba6b
Reviewed-on: https://chromium-review.googlesource.com/170782
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/utils.h b/utils.h
index 2dd8095..6f6539f 100644
--- a/utils.h
+++ b/utils.h
@@ -12,6 +12,7 @@
 #include <unistd.h>
 #include <vector>
 
+#include <base/file_path.h>
 #include <base/posix/eintr_wrapper.h>
 #include <base/time.h>
 #include <ext2fs/ext2fs.h>
@@ -341,6 +342,11 @@
 // http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format
 bool GetInstallDev(const std::string& boot_dev, std::string* install_dev);
 
+// Checks if xattr is supported in the directory specified by
+// |dir_path| which must be writable. Returns true if the feature is
+// supported, false if not or if an error occured.
+bool IsXAttrSupported(const base::FilePath& dir_path);
+
 }  // namespace utils