From ab43e30bba0ebdce335ba55562d75dcbcdf0a3df Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 31 May 2015 10:06:11 -0500 Subject: [PATCH] Rename subdir_offset => d_subdir_offset --- include/wimlib/dentry.h | 4 ++-- src/dentry.c | 20 ++++++++++---------- src/metadata_resource.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/wimlib/dentry.h b/include/wimlib/dentry.h index 4adc5fed..e92b374f 100644 --- a/include/wimlib/dentry.h +++ b/include/wimlib/dentry.h @@ -86,10 +86,10 @@ struct wim_dentry { u8 d_is_orphan : 1; union { - /* 'subdir_offset' is only used while reading and writing this + /* The subdir offset is only used while reading and writing this * dentry. See the corresponding field in `struct * wim_dentry_on_disk' for explanation. */ - u64 subdir_offset; + u64 d_subdir_offset; /* Temporary list field */ struct list_head d_tmp_list; diff --git a/src/dentry.c b/src/dentry.c index cb1b4df2..a1a312db 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -536,7 +536,7 @@ dentry_calculate_subdir_offset(struct wim_dentry *dentry, void *_subdir_offset_p struct wim_dentry *child; /* Set offset of directory's child dentries */ - dentry->subdir_offset = *subdir_offset_p; + dentry->d_subdir_offset = *subdir_offset_p; /* Account for child dentries */ for_dentry_child(child, dentry) @@ -545,8 +545,8 @@ dentry_calculate_subdir_offset(struct wim_dentry *dentry, void *_subdir_offset_p /* Account for end-of-directory entry */ *subdir_offset_p += 8; } else { - /* Not a directory; set subdir_offset to 0 */ - dentry->subdir_offset = 0; + /* Not a directory; set the subdir offset to 0 */ + dentry->d_subdir_offset = 0; } return 0; } @@ -1437,7 +1437,7 @@ read_dentry(const u8 * restrict buf, size_t buf_len, /* Read more fields: some into the dentry, and some into the inode. */ inode->i_attributes = le32_to_cpu(disk_dentry->attributes); inode->i_security_id = le32_to_cpu(disk_dentry->security_id); - dentry->subdir_offset = le64_to_cpu(disk_dentry->subdir_offset); + dentry->d_subdir_offset = le64_to_cpu(disk_dentry->subdir_offset); inode->i_creation_time = le64_to_cpu(disk_dentry->creation_time); inode->i_last_access_time = le64_to_cpu(disk_dentry->last_access_time); inode->i_last_write_time = le64_to_cpu(disk_dentry->last_write_time); @@ -1549,14 +1549,14 @@ static int read_dentry_tree_recursive(const u8 * restrict buf, size_t buf_len, struct wim_dentry * restrict dir) { - u64 cur_offset = dir->subdir_offset; + u64 cur_offset = dir->d_subdir_offset; /* Check for cyclic directory structure, which would cause infinite * recursion if not handled. */ for (struct wim_dentry *d = dir->d_parent; !dentry_is_root(d); d = d->d_parent) { - if (unlikely(d->subdir_offset == cur_offset)) { + if (unlikely(d->d_subdir_offset == cur_offset)) { ERROR("Cyclic directory structure detected: children " "of \"%"TS"\" coincide with children of \"%"TS"\"", dentry_full_path(dir), dentry_full_path(d)); @@ -1610,7 +1610,7 @@ read_dentry_tree_recursive(const u8 * restrict buf, size_t buf_len, /* If this child is a directory that itself has children, call * this procedure recursively. */ - if (child->subdir_offset != 0) { + if (child->d_subdir_offset != 0) { if (likely(dentry_is_directory(child))) { ret = read_dentry_tree_recursive(buf, buf_len, @@ -1676,7 +1676,7 @@ read_dentry_tree(const u8 *buf, size_t buf_len, goto err_free_dentry_tree; } - if (likely(root->subdir_offset != 0)) { + if (likely(root->d_subdir_offset != 0)) { ret = read_dentry_tree_recursive(buf, buf_len, root); if (ret) goto err_free_dentry_tree; @@ -1748,7 +1748,7 @@ write_dentry(const struct wim_dentry * restrict dentry, u8 * restrict p) disk_dentry->attributes = cpu_to_le32(inode->i_attributes); disk_dentry->security_id = cpu_to_le32(inode->i_security_id); - disk_dentry->subdir_offset = cpu_to_le64(dentry->subdir_offset); + disk_dentry->subdir_offset = cpu_to_le64(dentry->d_subdir_offset); disk_dentry->unused_1 = cpu_to_le64(0); disk_dentry->unused_2 = cpu_to_le64(0); @@ -1869,7 +1869,7 @@ write_dentry(const struct wim_dentry * restrict dentry, u8 * restrict p) static int write_dir_dentries(struct wim_dentry *dir, void *_pp) { - if (dir->subdir_offset != 0) { + if (dir->d_subdir_offset != 0) { u8 **pp = _pp; u8 *p = *pp; struct wim_dentry *child; diff --git a/src/metadata_resource.c b/src/metadata_resource.c index 014d16b9..2a327949 100644 --- a/src/metadata_resource.c +++ b/src/metadata_resource.c @@ -102,7 +102,7 @@ read_metadata_resource(struct wim_image_metadata *imd) * * Notes: The metadata resource consists of the security data, followed * by the directory entry for the root directory, followed by all the - * other directory entries in the filesystem. The subdir_offset field + * other directory entries in the filesystem. The subdir offset field * of each directory entry gives the start of its child entries from the * beginning of the metadata resource. An end-of-directory is signaled * by a directory entry of length '0', really of length 8, because -- 2.43.0