struct inode *inode;
struct hlist_node *cur;
u64 cur_ino = 1;
- struct dentry *dentry;
hlist_for_each_entry(inode, cur, inode_list, hlist) {
inode->ino = cur_ino;
cur_ino++;
u64 last_atime = 0;
bool found_short_name = false;
- list_for_each_entry(dentry, &inode->dentry_list, inode_dentry_list) {
+ inode_for_each_dentry(dentry, inode) {
if (!ref_dentry || ref_dentry->inode->num_ads == 0)
ref_dentry = dentry;
if (dentry->short_name_len) {
ref_inode = ref_dentry->inode;
ref_inode->link_count = 1;
- list_for_each_entry(dentry, &inode->dentry_list, inode_dentry_list) {
+ inode_for_each_dentry(dentry, inode) {
if (dentry != ref_dentry) {
if (!inodes_consistent(ref_inode, dentry->inode)) {
inconsistent_inode(dentry->inode);
/* Create a list of dentries in the nominal inode that have at
* least one data stream with a non-zero hash, and another list that
* contains the dentries that have a zero hash for all data streams. */
- list_for_each_entry(dentry, &inode->dentry_list, inode_dentry_list) {
+ inode_for_each_dentry(dentry, inode) {
for (unsigned i = 0; i <= dentry->inode->num_ads; i++) {
const u8 *hash;
hash = inode_stream_hash(dentry->inode, i);
* these dentries for consistency with the others to form a set of true
* inodes. */
num_true_inodes = 0;
- list_for_each_entry(dentry, &dentries_with_data_streams, tmp_list)
- {
+ list_for_each_entry(dentry, &dentries_with_data_streams, tmp_list) {
/* Look for a true inode that is consistent with
* this dentry and add this dentry to it. Or, if none
* of the true inodes are consistent with this
inode = container_of(true_inodes.first,
struct inode,
hlist);
- /* Assign the streamless dentries to the one and only true link
+ /* Assign the streamless dentries to the one and only true
* inode. */
list_for_each_entry(dentry, &dentries_with_no_data_streams, tmp_list)
list_add(&dentry->inode_dentry_list, &inode->dentry_list);
if (num_true_inodes != 1) {
#ifdef ENABLE_DEBUG
{
+ inode = container_of(true_inodes.first,
+ struct inode,
+ hlist);
+
printf("Split nominal inode 0x%"PRIx64" into %zu "
"inodes:\n",
inode->ino, num_true_inodes);
* dentries. */
u32 out_refcnt;
- union {
- /* When a WIM file is written, @output_resource_entry is filled
- * in with the resource entry for the output WIM. This will not
- * necessarily be the same as the @resource_entry since:
- * - The stream may have a different offset in the new WIM
- * - The stream may have a different compressed size in the
- * new WIM if the compression type changed
- */
- struct resource_entry output_resource_entry;
-
- /* This field is used for the special hardlink or symlink image
- * application mode. In these mode, all identical files are
- * linked together, and @extracted_file will be set to the
- * filename of the first extracted file containing this stream.
- * */
- char *extracted_file;
- };
+ /* When a WIM file is written, @output_resource_entry is filled
+ * in with the resource entry for the output WIM. This will not
+ * necessarily be the same as the @resource_entry since:
+ * - The stream may have a different offset in the new WIM
+ * - The stream may have a different compressed size in the
+ * new WIM if the compression type changed
+ */
+ struct resource_entry output_resource_entry;
+
+ /* This field is used for the special hardlink or symlink image
+ * application mode. In these mode, all identical files are
+ * linked together, and @extracted_file will be set to the
+ * filename of the first extracted file containing this stream.
+ * */
+ char *extracted_file;
/* Circular linked list of streams that share the same lookup table
* entry.