Re: [PATCH 0/2] cramfs: Add mount option "swapendian"

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Drebes <lists-receive@...>
Cc: <linux-fsdevel@...>, Christoph Hellwig <hch@...>, Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>
Date: Thursday, November 15, 2007 - 5:03 pm

On Thu, 15 November 2007 21:35:16 +0100, Andi Drebes wrote:

Codingstyle: extra space after "if", keep brace on the same line.
Same goes for most of this patch.

Unlikely not likely to be a good idea.  It clutters up the code for a
minimal gain on host-endian filesystems (and I doubt you can measure
that even in micro-benchmarks) and forcibly mispredicts every branch for
cross-endian filesystems.

The name "endian" could be replaces with something more descriptive.
"host_endian" or "swap_endian" with reversed logic or something.


You could remove most of this by removing the mount option and simply
deciding endianness based on super.magic.  So why the extra work?


The two conditional can be combined into one.


You're using Xe32_to_cpu on host-endian numbers?  Sparse won't be happy.
Better just use swab32 directly.


Better make it a static inline function for type safety.  Possibly even
an out-of-line function.


dito.

Jörn

-- 
The rabbit runs faster than the fox, because the rabbit is rinning for
his life while the fox is only running for his dinner.
-- Aesop
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] cramfs: support for other endianness, Andi Drebes, (Thu Nov 15, 4:29 pm)
Re: [PATCH 0/2] cramfs: support for other endianness, Andi Drebes, (Thu Nov 15, 4:43 pm)
[PATCH 0/2] cramfs: update README file, Andi Drebes, (Thu Nov 15, 4:37 pm)
[PATCH 0/2] cramfs: Add mount option "swapendian", Andi Drebes, (Thu Nov 15, 4:35 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Jörn, (Thu Nov 15, 5:03 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Linus Torvalds, (Thu Nov 15, 4:45 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Andi Drebes, (Thu Nov 15, 5:15 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Linus Torvalds, (Thu Nov 15, 5:37 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Phillip Lougher, (Thu Nov 15, 6:48 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Andi Drebes, (Fri Nov 16, 6:28 am)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Linus Torvalds, (Fri Nov 16, 11:44 am)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Christoph Hellwig, (Thu Nov 15, 4:49 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Linus Torvalds, (Thu Nov 15, 4:57 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Linus Torvalds, (Thu Nov 15, 4:46 pm)
Re: [PATCH 0/2] cramfs: Add mount option "swapendian", Christoph Hellwig, (Thu Nov 15, 4:51 pm)