Re: [PATCH 1/2] Make cramfs little endian only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 6 Dec 2007, Jörn Engel wrote:
> 
> How about shifting and masking _before_ converting to host endianness?
> 
> 	static inline u32 cramfs_offset(struct cramfs_inode *inode)
> 	{
> 		return le32_to_cpu(node->namelen_offset >> CRAMFS_NAMELEN_WIDTH);
> 	}

Stop this idiocy. The code I sent out was correct. You're just making it 
worse.

"le32_to_cpu()" is a no-op on little-endian machines. So your change won't 
make any difference there. But the point is, that if we want the disk 
layout to be the *same* for both big-endian and little-endian, we need to 
switch the word as it is loaded from memory, and not do *any* operations 
on it before we've done that equalization.

This is not something unusual. It's bog-standard procedure for a lot of 
filesystems. And sparse will help you (and would have complained about 
your code that tries to shift a little-endian entity before changing it 
into a CPU-endian one).

			Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux