+#define WIM_DENTRY_DISK_SIZE 102
+
+#define WIM_ADS_ENTRY_DISK_SIZE 38
+
+/*
+ * Reparse tags documented at
+ * http://msdn.microsoft.com/en-us/library/dd541667(v=prot.10).aspx
+ */
+#define WIM_IO_REPARSE_TAG_RESERVED_ZERO 0x00000000
+#define WIM_IO_REPARSE_TAG_RESERVED_ONE 0x00000001
+#define WIM_IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
+#define WIM_IO_REPARSE_TAG_HSM 0xC0000004
+#define WIM_IO_REPARSE_TAG_HSM2 0x80000006
+#define WIM_IO_REPARSE_TAG_DRIVER_EXTENDER 0x80000005
+#define WIM_IO_REPARSE_TAG_SIS 0x80000007
+#define WIM_IO_REPARSE_TAG_DFS 0x8000000A
+#define WIM_IO_REPARSE_TAG_DFSR 0x80000012
+#define WIM_IO_REPARSE_TAG_FILTER_MANAGER 0x8000000B
+#define WIM_IO_REPARSE_TAG_SYMLINK 0xA000000C
+
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#define FILE_ATTRIBUTE_HIDDEN 0x00000002
+#define FILE_ATTRIBUTE_SYSTEM 0x00000004
+#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
+#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
+#define FILE_ATTRIBUTE_DEVICE 0x00000040
+#define FILE_ATTRIBUTE_NORMAL 0x00000080
+#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
+#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
+#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
+#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
+#define FILE_ATTRIBUTE_OFFLINE 0x00001000
+#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
+#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
+#define FILE_ATTRIBUTE_VIRTUAL 0x00010000
+
+struct lookup_table_entry;
+
+/* Alternate data stream entry */
+struct ads_entry {
+ union {
+ /* SHA-1 message digest of stream contents */
+ u8 hash[SHA1_HASH_SIZE];
+
+ /* The corresponding lookup table entry (only for resolved
+ * streams) */
+ struct lookup_table_entry *lte;
+ };
+
+ /* Length of stream name (UTF-16) */
+ u16 stream_name_len;
+
+ /* Length of stream name (UTF-8) */
+ u16 stream_name_utf8_len;
+
+ /* Stream name (UTF-16) */
+ char *stream_name;
+
+ /* Stream name (UTF-8) */
+ char *stream_name_utf8;
+
+ /* Doubly linked list of streams that share the same lookup table entry */
+ struct stream_list_head lte_group_list;
+};
+
+static inline u64 ads_entry_length(const struct ads_entry *entry)
+{
+ u64 len = WIM_ADS_ENTRY_DISK_SIZE + entry->stream_name_len + 2;
+ return (len + 7) & ~7;
+}