[PATCH 1/5] fs: i_flags and i_state in struct inode only need to be unsigned short

From: Theodore Ts'o
Date: Thu May 21 2009 - 16:01:52 EST


Currently i_flags and i_state do not need to be an unsigned int and an
unsigned long, respectively. (We currently use 9 i_flags bits, and 8
i_state bits.) Changing them to be an unsigned short saves 4 bytes
per inode on an x86 platform, and 8 bytes on an x86_64 platform.

Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
Cc: linux-fsdevel@xxxxxxxxxxxxxxx
---
include/linux/fs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3b534e5..9b20f13 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -765,10 +765,10 @@ struct inode {
struct mutex inotify_mutex; /* protects the watches list */
#endif

- unsigned long i_state;
unsigned long dirtied_when; /* jiffies of first dirtying */

- unsigned int i_flags;
+ unsigned short i_state;
+ unsigned short i_flags;

atomic_t i_writecount;
#ifdef CONFIG_SECURITY
--
1.6.3.1.1.g75fc.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/