struct list_head d_ci_conflict_list;
/* The parent of this directory entry. */
- struct wim_dentry *parent;
+ struct wim_dentry *d_parent;
/* Linked list node that places this dentry in the list of aliases for
* its inode (d_inode) */
static inline bool
dentry_is_root(const struct wim_dentry *dentry)
{
- return dentry->parent == dentry;
+ return dentry->d_parent == dentry;
}
static inline bool
do {
ulen += d->file_name_nbytes / sizeof(utf16lechar);
ulen++;
- d = d->parent; /* assumes d == d->parent for root */
+ d = d->d_parent; /* assumes d == d->d_parent for root */
} while (!dentry_is_root(d));
utf16lechar ubuf[ulen];
p -= d->file_name_nbytes / sizeof(utf16lechar);
memcpy(p, d->file_name, d->file_name_nbytes);
*--p = cpu_to_le16(WIM_PATH_SEPARATOR);
- d = d->parent; /* assumes d == d->parent for root */
+ d = d->d_parent; /* assumes d == d->d_parent for root */
} while (!dentry_is_root(d));
wimlib_assert(p == ubuf);
return ret;
}
}
- dentry->parent = dentry;
+ dentry->d_parent = dentry;
*dentry_ret = dentry;
return 0;
}
} else {
INIT_LIST_HEAD(&child->d_ci_conflict_list);
}
- child->parent = parent;
+ child->d_parent = parent;
return NULL;
}
if (dentry_is_root(dentry))
return;
- dir = dentry->parent->d_inode;
+ dir = dentry->d_parent->d_inode;
dir_unindex_child(dir, dentry);
/* Check for cyclic directory structure, which would cause infinite
* recursion if not handled. */
- for (struct wim_dentry *d = dir->parent;
- !dentry_is_root(d); d = d->parent)
+ for (struct wim_dentry *d = dir->d_parent;
+ !dentry_is_root(d); d = d->d_parent)
{
if (unlikely(d->subdir_offset == cur_offset)) {
ERROR("Cyclic directory structure detected: children "
for (i = 0; i < num_trees; i++) {
struct wim_dentry *d = trees[i];
while (!dentry_is_root(d)) {
- d = d->parent;
+ d = d->d_parent;
if (d->tmp_flag)
goto tree_contained;
}
place_after = dentry_list;
ancestor = dentry;
do {
- ancestor = ancestor->parent;
+ ancestor = ancestor->d_parent;
if (will_extract_dentry(ancestor)) {
place_after = &ancestor->d_extraction_list_node;
break;
ancestor = dentry;
do {
- ancestor = ancestor->parent;
+ ancestor = ancestor->d_parent;
if (will_extract_dentry(ancestor))
break;
list_add(&ancestor->d_extraction_list_node, place_after);
return ret;
wdentry->full_path = dentry->_full_path;
- for (struct wim_dentry *d = dentry; !dentry_is_root(d); d = d->parent)
+ for (struct wim_dentry *d = dentry; !dentry_is_root(d); d = d->d_parent)
wdentry->depth++;
if (inode->i_security_id >= 0) {
static void
touch_parent(struct wim_dentry *dentry)
{
- touch_inode(dentry->parent->d_inode);
+ touch_inode(dentry->d_parent->d_inode);
}
/*
goto out_close;
if (!dir_ni)
- dir_ni = ntfs_inode_open(vol, dentry->parent->d_inode->i_mft_no);
+ dir_ni = ntfs_inode_open(vol, dentry->d_parent->d_inode->i_mft_no);
if (!ni)
ni = ntfs_inode_open(vol, dentry->d_inode->i_mft_no);
if (dir_ni && ni) {
/* Unlike most other NTFS-3g functions, ntfs_set_ntfs_dos_name()
* changes the directory's last modification timestamp...
* Change it back. */
- return ntfs_3g_restore_timestamps(vol, dentry->parent->d_inode);
+ return ntfs_3g_restore_timestamps(vol, dentry->d_parent->d_inode);
out_close:
/* ntfs_inode_close() can take a NULL argument, but it's probably best
int res;
/* Open the inode of the parent directory. */
- dir_ni = ntfs_inode_open(ni->vol, dentry->parent->d_inode->i_mft_no);
+ dir_ni = ntfs_inode_open(ni->vol, dentry->d_parent->d_inode->i_mft_no);
if (!dir_ni)
goto fail;
/* Create first link. */
- dir_ni = ntfs_inode_open(ctx->vol, first_dentry->parent->d_inode->i_mft_no);
+ dir_ni = ntfs_inode_open(ctx->vol, first_dentry->d_parent->d_inode->i_mft_no);
if (!dir_ni) {
ERROR_WITH_ERRNO("Can't open \"%s\" in NTFS volume",
- dentry_full_path(first_dentry->parent));
+ dentry_full_path(first_dentry->d_parent));
return WIMLIB_ERR_NTFS_3G;
}
/* Close the directory in which the first link was created. */
if (ntfs_inode_close(dir_ni)) {
ERROR_WITH_ERRNO("Failed to close \"%s\" in NTFS volume",
- dentry_full_path(first_dentry->parent));
+ dentry_full_path(first_dentry->d_parent));
ret = WIMLIB_ERR_NTFS_3G;
goto out_close_ni;
}
d = dentry;
do {
len += d->d_extraction_name_nchars + 1;
- d = d->parent;
+ d = d->d_parent;
} while (!dentry_is_root(d) && will_extract_dentry(d));
return len;
p -= d->d_extraction_name_nchars;
memcpy(p, d->d_extraction_name, d->d_extraction_name_nchars);
*--p = '/';
- d = d->parent;
+ d = d->d_parent;
} while (!dentry_is_root(d) && will_extract_dentry(d));
return pathbuf;
{
if (parent) {
/* Unlink @subject from its @parent. */
- wimlib_assert(subject->parent == parent);
+ wimlib_assert(subject->d_parent == parent);
unlink_dentry(subject);
} else {
/* Unset @subject as the root of the image. */
*root_p = NULL;
}
- subject->parent = subject;
+ subject->d_parent = subject;
}
static void
if (dentry_is_root(subject))
parent = NULL;
else
- parent = subject->parent;
+ parent = subject->d_parent;
prim.type = UNLINK_DENTRY;
prim.link.subject = subject;
struct wim_dentry *parent;
int ret;
- parent = existing->parent;
+ parent = existing->d_parent;
ret = calculate_dentry_full_path(existing);
if (ret)
return true;
if (dentry_is_root(d2))
return false;
- d2 = d2->parent;
+ d2 = d2->d_parent;
}
}
if (dentry_has_children(dst))
return -ENOTEMPTY;
}
- parent_of_dst = dst->parent;
+ parent_of_dst = dst->d_parent;
} else {
/* Destination does not exist */
parent_of_dst = get_parent_dentry(wim, to, case_type);
d = dentry;
do {
len += d->d_extraction_name_nchars + 1;
- d = d->parent;
+ d = d->d_parent;
} while (!dentry_is_root(d) && will_extract_dentry(d));
return --len; /* No leading slash */
ctx->pathbuf.Length = len * sizeof(wchar_t);
p = ctx->pathbuf.Buffer + len;
for (d = dentry;
- !dentry_is_root(d->parent) && will_extract_dentry(d->parent);
- d = d->parent)
+ !dentry_is_root(d->d_parent) && will_extract_dentry(d->d_parent);
+ d = d->d_parent)
{
p -= d->d_extraction_name_nchars;
wmemcpy(p, d->d_extraction_name, d->d_extraction_name_nchars);