struct wim_dentry: Rename 'parent' to 'd_parent'
authorEric Biggers <ebiggers3@gmail.com>
Mon, 26 May 2014 03:13:39 +0000 (22:13 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 26 May 2014 03:49:42 +0000 (22:49 -0500)
include/wimlib/dentry.h
src/dentry.c
src/extract.c
src/iterate_dir.c
src/mount_image.c
src/ntfs-3g_apply.c
src/unix_apply.c
src/update_image.c
src/win32_apply.c

index df1b3ed..2dd98fb 100644 (file)
@@ -65,7 +65,7 @@ struct wim_dentry {
        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) */
@@ -285,7 +285,7 @@ write_dentry_tree(struct wim_dentry *root, u8 *p);
 static inline bool
 dentry_is_root(const struct wim_dentry *dentry)
 {
-       return dentry->parent == dentry;
+       return dentry->d_parent == dentry;
 }
 
 static inline bool
index 763198d..71d70bb 100644 (file)
@@ -419,7 +419,7 @@ calculate_dentry_full_path(struct wim_dentry *dentry)
        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];
@@ -430,7 +430,7 @@ calculate_dentry_full_path(struct wim_dentry *dentry)
                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);
@@ -880,7 +880,7 @@ new_dentry(const tchar *name, struct wim_dentry **dentry_ret)
                        return ret;
                }
        }
-       dentry->parent = dentry;
+       dentry->d_parent = dentry;
        *dentry_ret = dentry;
        return 0;
 }
@@ -1102,7 +1102,7 @@ dentry_add_child(struct wim_dentry *parent, struct wim_dentry *child)
        } else {
                INIT_LIST_HEAD(&child->d_ci_conflict_list);
        }
-       child->parent = parent;
+       child->d_parent = parent;
        return NULL;
 }
 
@@ -1115,7 +1115,7 @@ unlink_dentry(struct wim_dentry *dentry)
        if (dentry_is_root(dentry))
                return;
 
-       dir = dentry->parent->d_inode;
+       dir = dentry->d_parent->d_inode;
 
        dir_unindex_child(dir, dentry);
 
@@ -1369,8 +1369,8 @@ read_dentry_tree_recursive(const u8 * restrict buf, size_t buf_len,
 
        /* 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 "
index a6b8d9e..24c3e75 100644 (file)
@@ -442,7 +442,7 @@ remove_contained_trees(struct wim_dentry **trees, size_t num_trees)
        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;
                }
@@ -509,7 +509,7 @@ build_dentry_list(struct list_head *dentry_list, struct wim_dentry **trees,
                        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;
@@ -518,7 +518,7 @@ build_dentry_list(struct list_head *dentry_list, struct wim_dentry **trees,
 
                        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);
index 4e286b1..d031135 100644 (file)
@@ -66,7 +66,7 @@ init_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry,
                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) {
index 507330e..81796cb 100644 (file)
@@ -540,7 +540,7 @@ touch_inode(struct wim_inode *inode)
 static void
 touch_parent(struct wim_dentry *dentry)
 {
-       touch_inode(dentry->parent->d_inode);
+       touch_inode(dentry->d_parent->d_inode);
 }
 
 /*
index c61a888..ff145a6 100644 (file)
@@ -285,7 +285,7 @@ ntfs_3g_restore_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni,
                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) {
@@ -307,7 +307,7 @@ ntfs_3g_restore_dos_name(ntfs_inode *ni, ntfs_inode *dir_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
@@ -543,7 +543,7 @@ ntfs_3g_add_link(ntfs_inode *ni, struct wim_dentry *dentry)
        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;
 
@@ -578,10 +578,10 @@ ntfs_3g_create_nondirectory(struct wim_inode *inode,
 
        /* 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;
        }
 
@@ -619,7 +619,7 @@ ntfs_3g_create_nondirectory(struct wim_inode *inode,
                /* 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;
                }
index 8b8d9bf..25b28f9 100644 (file)
@@ -113,7 +113,7 @@ unix_dentry_path_length(const struct wim_dentry *dentry)
        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;
@@ -161,7 +161,7 @@ unix_build_extraction_path(const struct wim_dentry *dentry,
                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;
index 1e2ca6e..27f921d 100644 (file)
@@ -212,13 +212,13 @@ do_unlink(struct wim_dentry *subject, struct wim_dentry *parent,
 {
        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
@@ -362,7 +362,7 @@ journaled_unlink(struct update_command_journal *j, struct wim_dentry *subject)
        if (dentry_is_root(subject))
                parent = NULL;
        else
-               parent = subject->parent;
+               parent = subject->d_parent;
 
        prim.type = UNLINK_DENTRY;
        prim.link.subject = subject;
@@ -521,7 +521,7 @@ handle_conflict(struct wim_dentry *branch, struct wim_dentry *existing,
                struct wim_dentry *parent;
                int ret;
 
-               parent = existing->parent;
+               parent = existing->d_parent;
 
                ret = calculate_dentry_full_path(existing);
                if (ret)
@@ -936,7 +936,7 @@ is_ancestor(const struct wim_dentry *d1, const struct wim_dentry *d2)
                        return true;
                if (dentry_is_root(d2))
                        return false;
-               d2 = d2->parent;
+               d2 = d2->d_parent;
        }
 }
 
@@ -983,7 +983,7 @@ rename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to,
                        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);
index ecd7183..0cd67af 100644 (file)
@@ -357,7 +357,7 @@ dentry_extraction_path_length(const struct wim_dentry *dentry)
        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  */
@@ -426,8 +426,8 @@ build_extraction_path(const struct wim_dentry *dentry,
        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);