file_name => d_name
file_name_nbytes => d_name_nbytes
short_name => d_short_name
short_name_nbytes => d_short_name_nbytes
14 files changed:
*
* 'd_extraction_name' and 'd_extraction_name_nchars' of each dentry
* will be set to indicate the actual name with which the dentry should
*
* 'd_extraction_name' and 'd_extraction_name_nchars' of each dentry
* will be set to indicate the actual name with which the dentry should
- * be extracted. This may or may not be the same as 'file_name'.
- * TODO: really, the extraction backends should be responsible for
- * generating 'd_extraction_name'.
+ * be extracted. This may or may not be the same as 'd_name'. TODO:
+ * really, the extraction backends should be responsible for generating
+ * 'd_extraction_name'.
*
* Each dentry will refer to a valid inode in 'd_inode'. Each inode
* will contain a list of dentries of that inode being extracted; this
*
* Each dentry will refer to a valid inode in 'd_inode'. Each inode
* will contain a list of dentries of that inode being extracted; this
/* Pointer to the UTF-16LE short filename (malloc()ed buffer), or NULL
* if this dentry has no short name. */
/* Pointer to the UTF-16LE short filename (malloc()ed buffer), or NULL
* if this dentry has no short name. */
- utf16lechar *short_name;
+ utf16lechar *d_short_name;
/* Pointer to the UTF-16LE filename (malloc()ed buffer), or NULL if this
* dentry has no filename. */
/* Pointer to the UTF-16LE filename (malloc()ed buffer), or NULL if this
* dentry has no filename. */
- utf16lechar *file_name;
/* Length of UTF-16LE encoded short filename, in bytes, not including
* the terminating zero wide-character. */
/* Length of UTF-16LE encoded short filename, in bytes, not including
* the terminating zero wide-character. */
+ u16 d_short_name_nbytes;
/* Length of UTF-16LE encoded "long" file name, in bytes, not including
* the terminating null character. */
/* Length of UTF-16LE encoded "long" file name, in bytes, not including
* the terminating null character. */
/* When capturing from an NTFS volume using NTFS-3g, this flag is set on
* dentries that were created from a filename in the WIN32 or WIN32+DOS
/* When capturing from an NTFS volume using NTFS-3g, this flag is set on
* dentries that were created from a filename in the WIN32 or WIN32+DOS
/* (Extraction only) Actual name to extract this dentry as. This may be
* either in 'tchars' or in 'utf16lechars', depending on what encoding
/* (Extraction only) Actual name to extract this dentry as. This may be
* either in 'tchars' or in 'utf16lechars', depending on what encoding
- * the extraction backend needs. This may alias 'file_name'. If it
+ * the extraction backend needs. This may alias 'd_name'. If it
* doesn't, it is an allocated buffer which must be freed. */
void *d_extraction_name;
* doesn't, it is an allocated buffer which must be freed. */
void *d_extraction_name;
static inline bool
dentry_has_short_name(const struct wim_dentry *dentry)
{
static inline bool
dentry_has_short_name(const struct wim_dentry *dentry)
{
- return dentry->short_name_nbytes != 0;
+ return dentry->d_short_name_nbytes != 0;
}
static inline bool
dentry_has_long_name(const struct wim_dentry *dentry)
{
}
static inline bool
dentry_has_long_name(const struct wim_dentry *dentry)
{
- return dentry->file_name_nbytes != 0;
+ return dentry->d_name_nbytes != 0;
}
#endif /* _WIMLIB_DENTRY_H */
}
#endif /* _WIMLIB_DENTRY_H */
u32 i_attributes;
/* Root of a balanced binary search tree storing the child directory
u32 i_attributes;
/* Root of a balanced binary search tree storing the child directory
- * entries of this inode, if any. Keyed by wim_dentry->file_name, case
+ * entries of this inode, if any. Keyed by wim_dentry->d_name, case
* sensitively. If this inode is not a directory or if it has no
* children then this will be an empty tree (NULL). */
struct avl_tree_node *i_children;
/* Root of a balanced binary search tree storing the child directory
* sensitively. If this inode is not a directory or if it has no
* children then this will be an empty tree (NULL). */
struct avl_tree_node *i_children;
/* Root of a balanced binary search tree storing the child directory
- * entries of this inode, if any. Keyed by wim_dentry->file_name, case
+ * entries of this inode, if any. Keyed by wim_dentry->d_name, case
* insensitively. If this inode is not a directory or if it has no
* children then this will be an empty tree (NULL). */
struct avl_tree_node *i_children_ci;
* insensitively. If this inode is not a directory or if it has no
* children then this will be an empty tree (NULL). */
struct avl_tree_node *i_children_ci;
* encoded "long" name, excluding the null terminator. If zero, then
* this file has no long name. The root dentry should not have a long
* name, but all other dentries in the image should have long names. */
* encoded "long" name, excluding the null terminator. If zero, then
* this file has no long name. The root dentry should not have a long
* name, but all other dentries in the image should have long names. */
/* Beginning of optional, variable-length fields */
/* Beginning of optional, variable-length fields */
- /* If file_name_nbytes != 0, the next field will be the UTF-16LE encoded
- * long file name. This will be null-terminated, so the size of this
- * field will really be file_name_nbytes + 2. */
- /*utf16lechar file_name[];*/
+ /* If name_nbytes != 0, the next field will be the UTF-16LE encoded long
+ * name. This will be null-terminated, so the size of this field will
+ * really be name_nbytes + 2. */
+ /*utf16lechar name[];*/
/* If short_name_nbytes != 0, the next field will be the UTF-16LE
* encoded short name. This will be null-terminated, so the size of
/* If short_name_nbytes != 0, the next field will be the UTF-16LE
* encoded short name. This will be null-terminated, so the size of
} _packed_attribute;
static void
} _packed_attribute;
static void
-do_dentry_set_name(struct wim_dentry *dentry, utf16lechar *file_name,
- size_t file_name_nbytes)
+do_dentry_set_name(struct wim_dentry *dentry, utf16lechar *name,
+ size_t name_nbytes)
- FREE(dentry->file_name);
- dentry->file_name = file_name;
- dentry->file_name_nbytes = file_name_nbytes;
+ FREE(dentry->d_name);
+ dentry->d_name = name;
+ dentry->d_name_nbytes = name_nbytes;
if (dentry_has_short_name(dentry)) {
if (dentry_has_short_name(dentry)) {
- FREE(dentry->short_name);
- dentry->short_name = NULL;
- dentry->short_name_nbytes = 0;
+ FREE(dentry->d_short_name);
+ dentry->d_short_name = NULL;
+ dentry->d_short_name_nbytes = 0;
* tagged metadata items as well as any extra stream entries that may need to
* follow the dentry. */
static size_t
* tagged metadata items as well as any extra stream entries that may need to
* follow the dentry. */
static size_t
-dentry_min_len_with_names(u16 file_name_nbytes, u16 short_name_nbytes)
+dentry_min_len_with_names(u16 name_nbytes, u16 short_name_nbytes)
{
size_t length = sizeof(struct wim_dentry_on_disk);
{
size_t length = sizeof(struct wim_dentry_on_disk);
- if (file_name_nbytes)
- length += (u32)file_name_nbytes + 2;
+ if (name_nbytes)
+ length += (u32)name_nbytes + 2;
if (short_name_nbytes)
length += (u32)short_name_nbytes + 2;
return length;
if (short_name_nbytes)
length += (u32)short_name_nbytes + 2;
return length;
const struct wim_inode *inode = dentry->d_inode;
size_t len;
const struct wim_inode *inode = dentry->d_inode;
size_t len;
- len = dentry_min_len_with_names(dentry->file_name_nbytes,
- dentry->short_name_nbytes);
+ len = dentry_min_len_with_names(dentry->d_name_nbytes,
+ dentry->d_short_name_nbytes);
len = ALIGN(len, 8);
len += ALIGN(inode->i_extra_size, 8);
len = ALIGN(len, 8);
len += ALIGN(inode->i_extra_size, 8);
ulen = 0;
d = dentry;
do {
ulen = 0;
d = dentry;
do {
- ulen += d->file_name_nbytes / sizeof(utf16lechar);
+ ulen += d->d_name_nbytes / sizeof(utf16lechar);
ulen++;
d = d->d_parent; /* assumes d == d->d_parent for root */
} while (!dentry_is_root(d));
ulen++;
d = d->d_parent; /* assumes d == d->d_parent for root */
} while (!dentry_is_root(d));
- p -= d->file_name_nbytes / sizeof(utf16lechar);
- memcpy(p, d->file_name, d->file_name_nbytes);
+ p -= d->d_name_nbytes / sizeof(utf16lechar);
+ memcpy(p, d->d_name, d->d_name_nbytes);
*--p = cpu_to_le16(WIM_PATH_SEPARATOR);
d = d->d_parent; /* assumes d == d->d_parent for root */
} while (!dentry_is_root(d));
*--p = cpu_to_le16(WIM_PATH_SEPARATOR);
d = d->d_parent; /* assumes d == d->d_parent for root */
} while (!dentry_is_root(d));
dentry_compare_names_case_insensitive(const struct wim_dentry *d1,
const struct wim_dentry *d2)
{
dentry_compare_names_case_insensitive(const struct wim_dentry *d1,
const struct wim_dentry *d2)
{
- return cmp_utf16le_strings(d1->file_name,
- d1->file_name_nbytes / 2,
- d2->file_name,
- d2->file_name_nbytes / 2,
+ return cmp_utf16le_strings(d1->d_name,
+ d1->d_name_nbytes / 2,
+ d2->d_name,
+ d2->d_name_nbytes / 2,
dentry_compare_names_case_sensitive(const struct wim_dentry *d1,
const struct wim_dentry *d2)
{
dentry_compare_names_case_sensitive(const struct wim_dentry *d1,
const struct wim_dentry *d2)
{
- return cmp_utf16le_strings(d1->file_name,
- d1->file_name_nbytes / 2,
- d2->file_name,
- d2->file_name_nbytes / 2,
+ return cmp_utf16le_strings(d1->d_name,
+ d1->d_name_nbytes / 2,
+ d2->d_name,
+ d2->d_name_nbytes / 2,
-/* Case-sensitive dentry lookup. Only @file_name and @file_name_nbytes of
- * @dummy must be valid. */
+/* Case-sensitive dentry lookup. Only @d_name and @d_name_nbytes of @dummy must
+ * be valid. */
static struct wim_dentry *
dir_lookup(const struct wim_inode *dir, const struct wim_dentry *dummy)
{
static struct wim_dentry *
dir_lookup(const struct wim_inode *dir, const struct wim_dentry *dummy)
{
return avl_tree_entry(node, struct wim_dentry, d_index_node);
}
return avl_tree_entry(node, struct wim_dentry, d_index_node);
}
-/* Case-insensitive dentry lookup. Only @file_name and @file_name_nbytes of
- * @dummy must be valid. */
+/* Case-insensitive dentry lookup. Only @d_name and @d_name_nbytes of @dummy
+ * must be valid. */
static struct wim_dentry *
dir_lookup_ci(const struct wim_inode *dir, const struct wim_dentry *dummy)
{
static struct wim_dentry *
dir_lookup_ci(const struct wim_inode *dir, const struct wim_dentry *dummy)
{
struct wim_dentry dummy;
struct wim_dentry *child;
struct wim_dentry dummy;
struct wim_dentry *child;
- dummy.file_name = (utf16lechar*)name;
- dummy.file_name_nbytes = name_nbytes;
+ dummy.d_name = (utf16lechar*)name;
+ dummy.d_name_nbytes = name_nbytes;
if (!ignore_case)
/* Case-sensitive lookup. */
if (!ignore_case)
/* Case-sensitive lookup. */
{
if (dentry) {
d_disassociate(dentry);
{
if (dentry) {
d_disassociate(dentry);
- FREE(dentry->file_name);
- FREE(dentry->short_name);
+ FREE(dentry->d_name);
+ FREE(dentry->d_short_name);
FREE(dentry->_full_path);
FREE(dentry);
}
FREE(dentry->_full_path);
FREE(dentry);
}
struct wim_dentry *dentry;
struct wim_inode *inode;
u16 short_name_nbytes;
struct wim_dentry *dentry;
struct wim_inode *inode;
u16 short_name_nbytes;
u64 calculated_size;
int ret;
u64 calculated_size;
int ret;
* name, and the short name. */
short_name_nbytes = le16_to_cpu(disk_dentry->short_name_nbytes);
* name, and the short name. */
short_name_nbytes = le16_to_cpu(disk_dentry->short_name_nbytes);
- file_name_nbytes = le16_to_cpu(disk_dentry->file_name_nbytes);
+ name_nbytes = le16_to_cpu(disk_dentry->name_nbytes);
- if (unlikely((short_name_nbytes & 1) | (file_name_nbytes & 1))) {
+ if (unlikely((short_name_nbytes & 1) | (name_nbytes & 1))) {
ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;
goto err_free_dentry;
}
/* We now know the length of the file name and short name. Make sure
* the length of the dentry is large enough to actually hold them. */
ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;
goto err_free_dentry;
}
/* We now know the length of the file name and short name. Make sure
* the length of the dentry is large enough to actually hold them. */
- calculated_size = dentry_min_len_with_names(file_name_nbytes,
+ calculated_size = dentry_min_len_with_names(name_nbytes,
short_name_nbytes);
if (unlikely(length < calculated_size)) {
short_name_nbytes);
if (unlikely(length < calculated_size)) {
/* Read the filename if present. Note: if the filename is empty, there
* is no null terminator following it. */
/* Read the filename if present. Note: if the filename is empty, there
* is no null terminator following it. */
- if (file_name_nbytes) {
- dentry->file_name = utf16le_dupz(p, file_name_nbytes);
- if (dentry->file_name == NULL) {
+ if (name_nbytes) {
+ dentry->d_name = utf16le_dupz(p, name_nbytes);
+ if (unlikely(!dentry->d_name)) {
ret = WIMLIB_ERR_NOMEM;
goto err_free_dentry;
}
ret = WIMLIB_ERR_NOMEM;
goto err_free_dentry;
}
- dentry->file_name_nbytes = file_name_nbytes;
- p += (u32)file_name_nbytes + 2;
+ dentry->d_name_nbytes = name_nbytes;
+ p += (u32)name_nbytes + 2;
}
/* Read the short filename if present. Note: if there is no short
* filename, there is no null terminator following it. */
if (short_name_nbytes) {
}
/* Read the short filename if present. Note: if there is no short
* filename, there is no null terminator following it. */
if (short_name_nbytes) {
- dentry->short_name = utf16le_dupz(p, short_name_nbytes);
- if (dentry->short_name == NULL) {
+ dentry->d_short_name = utf16le_dupz(p, short_name_nbytes);
+ if (unlikely(!dentry->d_short_name)) {
ret = WIMLIB_ERR_NOMEM;
goto err_free_dentry;
}
ret = WIMLIB_ERR_NOMEM;
goto err_free_dentry;
}
- dentry->short_name_nbytes = short_name_nbytes;
+ dentry->d_short_name_nbytes = short_name_nbytes;
p += (u32)short_name_nbytes + 2;
}
p += (u32)short_name_nbytes + 2;
}
static bool
dentry_is_dot_or_dotdot(const struct wim_dentry *dentry)
{
static bool
dentry_is_dot_or_dotdot(const struct wim_dentry *dentry)
{
- if (dentry->file_name_nbytes <= 4) {
- if (dentry->file_name_nbytes == 4) {
- if (dentry->file_name[0] == cpu_to_le16('.') &&
- dentry->file_name[1] == cpu_to_le16('.'))
+ if (dentry->d_name_nbytes <= 4) {
+ if (dentry->d_name_nbytes == 4) {
+ if (dentry->d_name[0] == cpu_to_le16('.') &&
+ dentry->d_name[1] == cpu_to_le16('.'))
- } else if (dentry->file_name_nbytes == 2) {
- if (dentry->file_name[0] == cpu_to_le16('.'))
+ } else if (dentry->d_name_nbytes == 2) {
+ if (dentry->d_name[0] == cpu_to_le16('.'))
cpu_to_le64((inode->i_nlink == 1) ? 0 : inode->i_ino);
}
cpu_to_le64((inode->i_nlink == 1) ? 0 : inode->i_ino);
}
- disk_dentry->short_name_nbytes = cpu_to_le16(dentry->short_name_nbytes);
- disk_dentry->file_name_nbytes = cpu_to_le16(dentry->file_name_nbytes);
+ disk_dentry->short_name_nbytes = cpu_to_le16(dentry->d_short_name_nbytes);
+ disk_dentry->name_nbytes = cpu_to_le16(dentry->d_name_nbytes);
p += sizeof(struct wim_dentry_on_disk);
wimlib_assert(dentry_is_root(dentry) != dentry_has_long_name(dentry));
if (dentry_has_long_name(dentry))
p += sizeof(struct wim_dentry_on_disk);
wimlib_assert(dentry_is_root(dentry) != dentry_has_long_name(dentry));
if (dentry_has_long_name(dentry))
- p = mempcpy(p, dentry->file_name, (u32)dentry->file_name_nbytes + 2);
+ p = mempcpy(p, dentry->d_name, (u32)dentry->d_name_nbytes + 2);
if (dentry_has_short_name(dentry))
if (dentry_has_short_name(dentry))
- p = mempcpy(p, dentry->short_name, (u32)dentry->short_name_nbytes + 2);
+ p = mempcpy(p, dentry->d_short_name, (u32)dentry->d_short_name_nbytes + 2);
/* Align to 8-byte boundary */
while ((uintptr_t)p & 7)
/* Align to 8-byte boundary */
while ((uintptr_t)p & 7)
dentry_reset_extraction_list_node(dentry);
inode->i_visited = 0;
inode->i_can_externally_back = 0;
dentry_reset_extraction_list_node(dentry);
inode->i_visited = 0;
inode->i_can_externally_back = 0;
- if ((void *)dentry->d_extraction_name != (void *)dentry->file_name)
+ if ((void *)dentry->d_extraction_name != (void *)dentry->d_name)
FREE(dentry->d_extraction_name);
dentry->d_extraction_name = NULL;
dentry->d_extraction_name_nchars = 0;
FREE(dentry->d_extraction_name);
dentry->d_extraction_name = NULL;
dentry->d_extraction_name_nchars = 0;
#ifdef WITH_NTFS_3G
if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {
#ifdef WITH_NTFS_3G
if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {
- dentry->d_extraction_name = dentry->file_name;
- dentry->d_extraction_name_nchars = dentry->file_name_nbytes /
+ dentry->d_extraction_name = dentry->d_name;
+ dentry->d_extraction_name_nchars = dentry->d_name_nbytes /
sizeof(utf16lechar);
return 0;
}
sizeof(utf16lechar);
return 0;
}
- if (file_name_valid(dentry->file_name, dentry->file_name_nbytes / 2, false)) {
- ret = utf16le_get_tstr(dentry->file_name,
- dentry->file_name_nbytes,
+ if (file_name_valid(dentry->d_name, dentry->d_name_nbytes / 2, false)) {
+ ret = utf16le_get_tstr(dentry->d_name,
+ dentry->d_name_nbytes,
(const tchar **)&dentry->d_extraction_name,
&dentry->d_extraction_name_nchars);
dentry->d_extraction_name_nchars /= sizeof(tchar);
(const tchar **)&dentry->d_extraction_name,
&dentry->d_extraction_name_nchars);
dentry->d_extraction_name_nchars /= sizeof(tchar);
- utf16lechar utf16_name_copy[dentry->file_name_nbytes / 2];
+ utf16lechar utf16_name_copy[dentry->d_name_nbytes / 2];
- memcpy(utf16_name_copy, dentry->file_name, dentry->file_name_nbytes);
- file_name_valid(utf16_name_copy, dentry->file_name_nbytes / 2, true);
+ memcpy(utf16_name_copy, dentry->d_name, dentry->d_name_nbytes);
+ file_name_valid(utf16_name_copy, dentry->d_name_nbytes / 2, true);
const tchar *tchar_name;
size_t tchar_nchars;
ret = utf16le_get_tstr(utf16_name_copy,
const tchar *tchar_name;
size_t tchar_nchars;
ret = utf16le_get_tstr(utf16_name_copy,
- dentry->file_name_nbytes,
&tchar_name, &tchar_nchars);
if (ret)
return ret;
&tchar_name, &tchar_nchars);
if (ret)
return ret;
const struct wim_inode_stream *strm;
struct wimlib_unix_data unix_data;
const struct wim_inode_stream *strm;
struct wimlib_unix_data unix_data;
- ret = utf16le_get_tstr(dentry->file_name, dentry->file_name_nbytes,
+ ret = utf16le_get_tstr(dentry->d_name, dentry->d_name_nbytes,
&wdentry->filename, &dummy);
if (ret)
return ret;
&wdentry->filename, &dummy);
if (ret)
return ret;
- ret = utf16le_get_tstr(dentry->short_name, dentry->short_name_nbytes,
+ ret = utf16le_get_tstr(dentry->d_short_name, dentry->d_short_name_nbytes,
&wdentry->dos_name, &dummy);
if (ret)
return ret;
&wdentry->dos_name, &dummy);
if (ret)
return ret;
return ret;
for_inode_child(child, inode) {
return ret;
for_inode_child(child, inode) {
- char *file_name_mbs;
- size_t file_name_mbs_nbytes;
+ char *name;
+ size_t name_nbytes;
- ret = utf16le_to_tstr(child->file_name,
- child->file_name_nbytes,
- &file_name_mbs,
- &file_name_mbs_nbytes);
- if (ret)
+ if (utf16le_to_tstr(child->d_name, child->d_name_nbytes,
+ &name, &name_nbytes))
- ret = filler(buf, file_name_mbs, NULL, 0);
- FREE(file_name_mbs);
+ ret = filler(buf, name, NULL, 0);
+ FREE(name);
* UTF-16LE internally... which is annoying because we currently have
* the UTF-16LE string but not the multibyte string. */
* UTF-16LE internally... which is annoying because we currently have
* the UTF-16LE string but not the multibyte string. */
- ret = utf16le_get_tstr(dentry->short_name, dentry->short_name_nbytes,
+ ret = utf16le_get_tstr(dentry->d_short_name, dentry->d_short_name_nbytes,
&dos_name, &dos_name_nbytes);
if (ret)
goto out_close;
&dos_name, &dos_name_nbytes);
if (ret)
goto out_close;
if (dentry->is_win32_name) {
node = lookup_dos_name(map, dentry->d_inode->i_ino);
if (node) {
if (dentry->is_win32_name) {
node = lookup_dos_name(map, dentry->d_inode->i_ino);
if (node) {
- dentry->short_name = utf16le_dupz(node->dos_name,
- node->name_nbytes);
- if (!dentry->short_name)
+ dentry->d_short_name = utf16le_dupz(node->dos_name,
+ node->name_nbytes);
+ if (!dentry->d_short_name)
- dentry->short_name_nbytes = node->name_nbytes;
+ dentry->d_short_name_nbytes = node->name_nbytes;
} else {
WARNING("NTFS inode %"PRIu64" has Win32 name with no "
"corresponding DOS name",
} else {
WARNING("NTFS inode %"PRIu64" has Win32 name with no "
"corresponding DOS name",
/* If this file has multiple names, choose the shortest one. */
inode_for_each_dentry(dentry, inode) {
/* If this file has multiple names, choose the shortest one. */
inode_for_each_dentry(dentry, inode) {
- if (dentry->file_name_nbytes < best_name_nbytes) {
- best_name = dentry->file_name;
- best_name_nbytes = dentry->file_name_nbytes;
+ if (dentry->d_name_nbytes < best_name_nbytes) {
+ best_name = dentry->d_name;
+ best_name_nbytes = dentry->d_name_nbytes;
}
}
blob->solid_sort_name = utf16le_dupz(best_name, best_name_nbytes);
}
}
blob->solid_sort_name = utf16le_dupz(best_name, best_name_nbytes);
break;
case CHANGE_FILE_NAME:
rollback_name_change(prim->name.old_name,
break;
case CHANGE_FILE_NAME:
rollback_name_change(prim->name.old_name,
- &prim->name.subject->file_name,
- &prim->name.subject->file_name_nbytes);
+ &prim->name.subject->d_name,
+ &prim->name.subject->d_name_nbytes);
break;
case CHANGE_SHORT_NAME:
rollback_name_change(prim->name.old_name,
break;
case CHANGE_SHORT_NAME:
rollback_name_change(prim->name.old_name,
- &prim->name.subject->short_name,
- &prim->name.subject->short_name_nbytes);
+ &prim->name.subject->d_short_name,
+ &prim->name.subject->d_short_name_nbytes);
prim.type = CHANGE_FILE_NAME;
prim.name.subject = dentry;
prim.type = CHANGE_FILE_NAME;
prim.name.subject = dentry;
- prim.name.old_name = dentry->file_name;
+ prim.name.old_name = dentry->d_name;
ret = record_update_primitive(j, prim);
if (ret) {
FREE(new_name);
return ret;
}
ret = record_update_primitive(j, prim);
if (ret) {
FREE(new_name);
return ret;
}
- dentry->file_name = new_name;
- dentry->file_name_nbytes = new_name_nbytes;
+ dentry->d_name = new_name;
+ dentry->d_name_nbytes = new_name_nbytes;
/* Clear the short name. */
prim.type = CHANGE_SHORT_NAME;
prim.name.subject = dentry;
/* Clear the short name. */
prim.type = CHANGE_SHORT_NAME;
prim.name.subject = dentry;
- prim.name.old_name = dentry->short_name;
+ prim.name.old_name = dentry->d_short_name;
ret = record_update_primitive(j, prim);
if (ret)
return ret;
ret = record_update_primitive(j, prim);
if (ret)
return ret;
- dentry->short_name = NULL;
- dentry->short_name_nbytes = 0;
+ dentry->d_short_name = NULL;
+ dentry->d_short_name_nbytes = 0;
existing_child =
get_dentry_child_with_utf16le_name(existing,
existing_child =
get_dentry_child_with_utf16le_name(existing,
- new_child->file_name,
- new_child->file_name_nbytes,
+ new_child->d_name,
+ new_child->d_name_nbytes,
WIMLIB_CASE_PLATFORM_DEFAULT);
unlink_dentry(new_child);
if (existing_child) {
WIMLIB_CASE_PLATFORM_DEFAULT);
unlink_dentry(new_child);
if (existing_child) {
size_t name_nchars;
int ret;
size_t name_nchars;
int ret;
- if (cur_dentry->file_name_nbytes == 0)
+ if (cur_dentry->d_name_nbytes == 0)
- ret = utf16le_get_tstr(cur_dentry->file_name,
- cur_dentry->file_name_nbytes,
+ ret = utf16le_get_tstr(cur_dentry->d_name,
+ cur_dentry->d_name_nbytes,
&name, &name_nchars);
if (ret)
return ret;
&name, &name_nchars);
if (ret)
return ret;
name = &ctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)];
while (name != ctx->pathbuf.Buffer && *(name - 1) != L'\\')
name--;
name = &ctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)];
while (name != ctx->pathbuf.Buffer && *(name - 1) != L'\\')
name--;
- end = mempcpy(name, dentry->short_name, dentry->short_name_nbytes);
+ end = mempcpy(name, dentry->d_short_name, dentry->d_short_name_nbytes);
ctx->pathbuf.Length = ((u8 *)end - (u8 *)ctx->pathbuf.Buffer);
/* Open the conflicting file (by short name). */
ctx->pathbuf.Length = ((u8 *)end - (u8 *)ctx->pathbuf.Buffer);
/* Open the conflicting file (by short name). */
*/
size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +
*/
size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +
- max(dentry->short_name_nbytes, sizeof(wchar_t)) +
+ max(dentry->d_short_name_nbytes, sizeof(wchar_t)) +
sizeof(wchar_t);
u8 buf[bufsize] _aligned_attribute(8);
FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;
sizeof(wchar_t);
u8 buf[bufsize] _aligned_attribute(8);
FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;
- info->FileNameLength = dentry->short_name_nbytes;
- memcpy(info->FileName, dentry->short_name, dentry->short_name_nbytes);
+ info->FileNameLength = dentry->d_short_name_nbytes;
+ memcpy(info->FileName, dentry->d_short_name, dentry->d_short_name_nbytes);
retry:
status = (*func_NtSetInformationFile)(h, &ctx->iosb, info, bufsize,
retry:
status = (*func_NtSetInformationFile)(h, &ctx->iosb, info, bufsize,
return 0;
if (status == STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME) {
return 0;
if (status == STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME) {
- if (dentry->short_name_nbytes == 0)
+ if (dentry->d_short_name_nbytes == 0)
return 0;
if (!ctx->tried_to_enable_short_names) {
wchar_t volume[7];
return 0;
if (!ctx->tried_to_enable_short_names) {
wchar_t volume[7];
* from files.
*/
if (unlikely(status == STATUS_OBJECT_NAME_COLLISION) &&
* from files.
*/
if (unlikely(status == STATUS_OBJECT_NAME_COLLISION) &&
- dentry->short_name_nbytes && !tried_to_remove_existing)
+ dentry->d_short_name_nbytes && !tried_to_remove_existing)
{
tried_to_remove_existing = true;
status = remove_conflicting_short_name(dentry, ctx);
{
tried_to_remove_existing = true;
status = remove_conflicting_short_name(dentry, ctx);
/* By default, failure to set short names is not an error (since short
* names aren't too important anymore...). */
if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES)) {
/* By default, failure to set short names is not an error (since short
* names aren't too important anymore...). */
if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES)) {
- if (dentry->short_name_nbytes)
+ if (dentry->d_short_name_nbytes)
ctx->num_set_short_name_failures++;
else
ctx->num_remove_short_name_failures++;
ctx->num_set_short_name_failures++;
else
ctx->num_remove_short_name_failures++;
FileAlternateNameInformation);
info = (const FILE_NAME_INFORMATION *)buf;
if (NT_SUCCESS(status) && info->FileNameLength != 0) {
FileAlternateNameInformation);
info = (const FILE_NAME_INFORMATION *)buf;
if (NT_SUCCESS(status) && info->FileNameLength != 0) {
- dentry->short_name = utf16le_dupz(info->FileName,
- info->FileNameLength);
- if (!dentry->short_name)
+ dentry->d_short_name = utf16le_dupz(info->FileName,
+ info->FileNameLength);
+ if (!dentry->d_short_name)
- dentry->short_name_nbytes = info->FileNameLength;
+ dentry->d_short_name_nbytes = info->FileNameLength;