- if (inode_is_directory(inode))
- info->dir_count++;
- else
- info->file_count++;
-
- /*
- * Update total bytes and hard link bytes.
- *
- * Unfortunately there are some inconsistencies/bugs in the way this is
- * done.
- *
- * If there are no alternate data streams in the image, the "total
- * bytes" is the sum of the size of the un-named data stream of each
- * inode times the link count of that inode. In other words, it would
- * be the total number of bytes of regular files you would have if you
- * extracted the full image without any hard-links. The "hard link
- * bytes" is equal to the "total bytes" minus the size of the un-named
- * data stream of each inode. In other words, the "hard link bytes"
- * counts the size of the un-named data stream for all the links to each
- * inode except the first one.
- *
- * Reparse points and directories don't seem to be counted in either the
- * total bytes or the hard link bytes.
- *
- * And now we get to the most confusing part, the alternate data
- * streams. They are not counted in the "total bytes". However, if the
- * link count of an inode with alternate data streams is 2 or greater,
- * the size of all the alternate data streams is included in the "hard
- * link bytes", and this size is multiplied by the link count (NOT one
- * less than the link count).
- */
- lte = inode_unnamed_lte(inode, info->lookup_table);
- if (lte) {
- info->total_bytes += lte->size;
- if (!dentry_is_first_in_inode(dentry))
- info->hard_link_bytes += lte->size;
- }