extern u64
wim_info_get_total_bytes(const struct wim_info *info);
+extern u64
+wim_info_get_image_hard_link_bytes(const struct wim_info *info, int image);
+
extern u64
wim_info_get_image_total_bytes(const struct wim_info *info, int image);
* However, we can get a reasonably accurate estimate by taking
* <TOTALBYTES> from the corresponding <IMAGE> in the WIM XML
* data. This does assume that a full image is being extracted,
- * but currently there is no API for doing otherwise. */
+ * but currently there is no API for doing otherwise. (Also,
+ * subtract <HARDLINKBYTES> from this if hard links are
+ * supported by the extraction mode.) */
ctx.progress.extract.total_bytes =
wim_info_get_image_total_bytes(wim->wim_info,
wim->current_image);
+ if (ctx.supported_features.hard_links) {
+ ctx.progress.extract.total_bytes -=
+ wim_info_get_image_hard_link_bytes(wim->wim_info,
+ wim->current_image);
+ }
}
/* Handle the special case of extracting a file to standard
return info->total_bytes;
}
+u64
+wim_info_get_image_hard_link_bytes(const struct wim_info *info, int image)
+{
+ return info->images[image - 1].hard_link_bytes;
+}
+
u64
wim_info_get_image_total_bytes(const struct wim_info *info, int image)
{