Re: [PATCH] proc: make struct proc_dir_entry::namelen unsigned int

From: Alexey Dobriyan
Date: Wed Mar 09 2011 - 18:22:51 EST


On Wed, Mar 09, 2011 at 03:03:06PM -0800, Andrew Morton wrote:
> On Tue, 8 Mar 2011 12:54:28 +0200
> Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
>
> > Space is not really conserved, because of natural alignment for the next field.
> > sizeof(struct proc_dir_entry) remains the same.
> >
>
> What is the reason for this patch??

1. namelen is declared "unsigned short" which hints for "maybe space savings".
Indeed in 2.4 struct proc_dir_entry looked like:

struct proc_dir_entry {
unsigned short low_ino;
unsigned short namelen;

Now, low_ino is "unsigned int", all savings were gone for a long time.
"struct proc_dir_entry" is not that countless to worry about it's size,
anyway.

2. converting from unsigned short to int/unsigned int can only create
problems, we better play it safe.
--
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/