From 9c088d75ecfd3c2c65a6e7e1b54eb65c7f1cab14 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 18 Jan 2014 00:30:45 -0600 Subject: [PATCH] Don't hold d_unused fields in memory It's not really worth wasting 16 bytes per dentry on them when they're not even used for anything. --- include/wimlib/dentry.h | 6 ------ src/dentry.c | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/wimlib/dentry.h b/include/wimlib/dentry.h index 90127d43..91406931 100644 --- a/include/wimlib/dentry.h +++ b/include/wimlib/dentry.h @@ -112,12 +112,6 @@ struct wim_dentry { u64 length; u64 subdir_offset; - /* These correspond to the two unused fields in the on-disk WIM dentry; - * we read them into memory so we can write them unchanged. These - * fields are set to 0 on new dentries. */ - u64 d_unused_1; - u64 d_unused_2; - /* Pointer to the UTF-16LE short filename (malloc()ed buffer), or NULL * if this dentry has no short name. */ utf16lechar *short_name; diff --git a/src/dentry.c b/src/dentry.c index 19e4199f..3783434c 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -1357,8 +1357,6 @@ read_dentry(const u8 * restrict buf, size_t buf_len, 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_unused_1 = le64_to_cpu(disk_dentry->unused_1); - dentry->d_unused_2 = le64_to_cpu(disk_dentry->unused_2); 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); @@ -1728,8 +1726,8 @@ 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->unused_1 = cpu_to_le64(dentry->d_unused_1); - disk_dentry->unused_2 = cpu_to_le64(dentry->d_unused_2); + disk_dentry->unused_1 = cpu_to_le64(0); + disk_dentry->unused_2 = cpu_to_le64(0); disk_dentry->creation_time = cpu_to_le64(inode->i_creation_time); disk_dentry->last_access_time = cpu_to_le64(inode->i_last_access_time); disk_dentry->last_write_time = cpu_to_le64(inode->i_last_write_time); -- 2.43.0