Re: Fwd: struct inode size reduction.

From: J.A. Magallon (jamagallon@able.es)
Date: Sun Mar 09 2003 - 17:45:52 EST


On 03.09, Dave Jones wrote:
> Third retry, perhaps it'll make it through to the list
> now that vger is sending mail again...
>

If you do not need gcc-2.95 support, you can use anonymous unions:

+ union {
+ struct pipe_inode_info *i_pipe;
+ struct block_device *i_bdev;
+ struct char_device *i_cdev;
+ };

so you don't even have to change the accesses. Zero cost optimization patch.

I have tested on gcc-3.0, 3.2.2, RH gcc-2.96-98, and 2.95.2. Only 2.95.2
fails.

I do not know the compiler requirements for 2.5, or if there is any agreement
in kernel developement for not doing this. If this is the case, sorry for
the noise.

-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.1 (Cooker) for i586
Linux 2.4.21-pre5-jam0 (gcc 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Mar 15 2003 - 22:00:19 EST