Re: Patch to improve fs/ext2/truncate.c

Linus Torvalds (torvalds@transmeta.com)
Fri, 11 Jul 1997 22:24:22 -0700 (PDT)


On Sat, 12 Jul 1997, Theodore Y. Ts'o wrote:
>
> The "ininode" boolean could probably be removed by just _not_ ever
> changing the block numbers in the inode to the CPU byte order: that way
> all block numbers (whether they are in the inode or in a indirect block)
> would always be in little-endian order. Then it wouldn't need any extra
> code at all..
>
> Agreed. It would also mean that we don't needly byte swap block numbers
> when the inode is only being read-in to satisfy a stat call. It's
> probably also worthwhile to not byte swap the other internal
> ext2-specific inode fields (especially since a number of them aren't
> currently being used anyway).

Looking at the code, I found another amusing cause to _not_ do the byte
swap when reading in the inode: short symbolic links. Right now they are a
very strange special case indeed ;)

Somebody? I agree with Ted that the person should probably have access to
both a big-endian and a little-endian machine to make sure it all works
correctly, but it actually looks fairly trivial (you can just grep for
i_data to see where the block numbers are being used).

Linus