+static u64 calculate_bytes_to_extract(struct list_head *stream_list,
+ int extract_flags)
+{
+ struct lookup_table_entry *lte;
+ struct dentry *dentry;
+ u64 total_size = 0;
+ list_for_each_entry(lte, stream_list, staging_list) {
+ u64 size = wim_resource_size(lte);
+ if (extract_flags &
+ (WIMLIB_EXTRACT_FLAG_SYMLINK | WIMLIB_EXTRACT_FLAG_HARDLINK))
+ {
+ total_size += size;
+ } else {
+ list_for_each_entry(dentry, <e->dentry_list,
+ tmp_list)
+ {
+ dentry->d_inode->found = false;
+ }
+ list_for_each_entry(dentry, <e->dentry_list,
+ tmp_list)
+ {
+ if (!dentry->d_inode->found) {
+ dentry->d_inode->found = true;
+ total_size += size;
+ }
+ }
+ }
+ }
+ return total_size;
+}
+