Re: buffer_head.b_bsize type

From: viro (viro@parcelfarce.linux.theplanet.co.uk)
Date: Thu May 29 2003 - 06:19:28 EST


On Thu, May 29, 2003 at 03:35:03AM -0700, William Lee Irwin III wrote:
> On Thu, May 29, 2003 at 08:29:40PM +1000, Stewart Smith wrote:
> > The buffer_head structure (include/linux/buffer_head.h) uses a u32 type
> > while everywhere else (e.g. bread) the size parameter is of type int.
> > Currently on all architectures u32 is defined as unsigned int. We
> > should probably not be doing unsigned and signed swaps. And you should
> > never really have a negative size of a buffer.
> > So, there are two solutions: either change the buffer_head struct to be
> > int so it matches everywhere else, or change everywhere else.
> > The attached patch does the change in one place. Although perhaps
> > changing everywhere else would be better. Thoughts? I'm happy to make
> > up the patch if needed.
> > Applies cleanly to 2.5.69 and 2.5.70 and has been tested on i386
> > without causing any further problems (that I can see at least).
>
> Could we go the other way and make all users of b_size use unsigned?

Who the hell cares? Size of buffer does not exceed the page size.
Unless you can show a platform with 2Gb pages...
-
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/