/*
* Calculate the full path to @dentry within the WIM image, if not already done.
*
- * The full name will be saved in the cached value 'dentry->_full_path'.
+ * The full name will be saved in the cached value 'dentry->d_full_path'.
*
* Whenever possible, use dentry_full_path() instead of calling this and
- * accessing _full_path directly.
+ * accessing d_full_path directly.
*
* Returns 0 or an error code resulting from a failed string conversion.
*/
size_t dummy;
const struct wim_dentry *d;
- if (dentry->_full_path)
+ if (dentry->d_full_path)
return 0;
ulen = 0;
wimlib_assert(p == ubuf);
return utf16le_to_tstr(ubuf, ulen * sizeof(utf16lechar),
- &dentry->_full_path, &dummy);
+ &dentry->d_full_path, &dummy);
}
/*
dentry_full_path(struct wim_dentry *dentry)
{
calculate_dentry_full_path(dentry);
- return dentry->_full_path;
+ return dentry->d_full_path;
}
static int
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)
/* 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;
}
get_dentry_child_with_utf16le_name(const struct wim_dentry *dentry,
const utf16lechar *name,
size_t name_nbytes,
- CASE_SENSITIVITY_TYPE case_ctype)
+ CASE_SENSITIVITY_TYPE case_type)
{
const struct wim_inode *dir = dentry->d_inode;
- bool ignore_case = will_ignore_case(case_ctype);
+ bool ignore_case = will_ignore_case(case_type);
struct wim_dentry dummy;
struct wim_dentry *child;
return 0;
}
-static int
-dentry_clear_inode_visited(struct wim_dentry *dentry, void *_ignore)
-{
- dentry->d_inode->i_visited = 0;
- return 0;
-}
-
-void
-dentry_tree_clear_inode_visited(struct wim_dentry *root)
-{
- for_dentry_in_tree(root, dentry_clear_inode_visited, NULL);
-}
-
/*
* Free a WIM dentry.
*
d_disassociate(dentry);
FREE(dentry->d_name);
FREE(dentry->d_short_name);
- FREE(dentry->_full_path);
+ FREE(dentry->d_full_path);
FREE(dentry);
}
}
/* 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);
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));
/* 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,
int ret;
struct wim_dentry *root;
- DEBUG("Reading dentry tree (root_offset=%"PRIu64")", root_offset);
-
ret = read_dentry(buf, buf_len, &root_offset, &root);
if (ret)
return ret;
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;
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);
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;
u8 *
write_dentry_tree(struct wim_dentry *root, u8 *p)
{
- DEBUG("Writing dentry tree.");
-
- wimlib_assert(root != NULL);
-
/* write root dentry and end-of-directory entry following it */
p = write_dentry(root, p);
*(u64*)p = 0;