Set license using %license
[platform/upstream/btrfs-progs.git] / image / sanitize.h
index b979f81..fc07a8a 100644 (file)
@@ -27,4 +27,22 @@ struct name {
        u32 len;
 };
 
+/*
+ * Filenames and xattrs can be obfuscated so they don't appear in the image
+ * dump. In basic mode (NAMES) a random string will be generated but such names
+ * do not match the direntry hashes. The advanced mode (COLLISIONS) tries to
+ * generate names that appear random but also match the hashes. This however
+ * may take significantly more time than the basic mode. And may not even
+ * succeed.
+ */
+enum sanitize_mode {
+       SANITIZE_NONE,
+       SANITIZE_NAMES,
+       SANITIZE_COLLISIONS
+};
+
+void sanitize_name(enum sanitize_mode sanitize, struct rb_root *name_tree,
+               u8 *dst, struct extent_buffer *src, struct btrfs_key *key,
+               int slot);
+
 #endif