]> wimlib.net Git - wimlib/blobdiff - include/wimlib/lookup_table.h
Variable chunk size support (currently XPRESS only)
[wimlib] / include / wimlib / lookup_table.h
index 48ee9fc51196701f123697366476644c11a7ebfe..d1b980dafe240f4ae18c33c05443ed9f09c98b9f 100644 (file)
@@ -298,16 +298,26 @@ wim_resource_size(const struct wim_lookup_table_entry *lte)
        return lte->resource_entry.original_size;
 }
 
+static inline u32
+wim_resource_chunk_size(const struct wim_lookup_table_entry * lte)
+{
+       if (lte->resource_location == RESOURCE_IN_WIM &&
+           lte->compression_type != WIMLIB_COMPRESSION_TYPE_NONE)
+               return lte->wim->chunk_size;
+       else
+               return 32768;
+}
+
+
 static inline u64
 wim_resource_chunks(const struct wim_lookup_table_entry *lte)
 {
-       return DIV_ROUND_UP(wim_resource_size(lte), WIM_CHUNK_SIZE);
+       return DIV_ROUND_UP(wim_resource_size(lte), wim_resource_chunk_size(lte));
 }
 
 static inline int
 wim_resource_compression_type(const struct wim_lookup_table_entry *lte)
 {
-       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_NONE != 0);
        return lte->compression_type;
 }
 
@@ -504,6 +514,9 @@ inode_stream_name_nbytes(const struct wim_inode *inode, unsigned stream_idx)
                return inode->i_ads_entries[stream_idx - 1].stream_name_nbytes;
 }
 
+extern struct wim_lookup_table_entry *
+inode_unnamed_stream_resolved(const struct wim_inode *inode, u16 *stream_idx_ret);
+
 extern struct wim_lookup_table_entry *
 inode_unnamed_lte_resolved(const struct wim_inode *inode);