+static void
+unix_count_dentries(const struct list_head *dentry_list,
+ u64 *dir_count_ret, u64 *empty_file_count_ret)
+{
+ const struct wim_dentry *dentry;
+ u64 dir_count = 0;
+ u64 empty_file_count = 0;
+
+ list_for_each_entry(dentry, dentry_list, d_extraction_list_node) {
+
+ const struct wim_inode *inode = dentry->d_inode;
+
+ if (inode_is_directory(inode))
+ dir_count++;
+ else if ((dentry == inode_first_extraction_dentry(inode)) &&
+ !inode_is_symlink(inode) &&
+ !inode_get_blob_for_unnamed_data_stream_resolved(inode))
+ empty_file_count++;
+ }
+
+ *dir_count_ret = dir_count;
+ *empty_file_count_ret = empty_file_count;
+}
+