[patch-2.4.0-test5-pre3] struct inode shortened

From: Tigran Aivazian (tigran@veritas.com)
Date: Thu Jul 20 2000 - 06:22:09 EST


Hi Linus,

Why aren't inode->i_pipe and inode->i_bdev in a union? Surely one
cannot find an inode that is a pipe and a block device at the same time...

That will save the precious 4 bytes from struct inode. (or 8 on 64bit
arch). And on a system with 1000000 incore inodes that is a lot of bits :)

Regards,
Tigran

--- linux/include/linux/fs.h Wed Jul 19 11:11:46 2000
+++ work/include/linux/fs.h Thu Jul 20 12:12:20 2000
@@ -407,8 +407,12 @@
         struct address_space *i_mapping;
         struct address_space i_data;
         struct dquot *i_dquot[MAXQUOTAS];
- struct pipe_inode_info *i_pipe;
- struct block_device *i_bdev;
+ union {
+ struct pipe_inode_info *u_pipe;
+ struct block_device *u_bdev;
+ } u1;
+#define i_pipe u1.u_pipe
+#define i_bdev u1.u_bdev
 
         unsigned long i_state;
 

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



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:13 EST