Skip to content
Commit f8e08a84 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds
Browse files

[PATCH] reiserfs endianness: sanitize reiserfs_key union



Since we only access reiserfs_key ->u.k_offset_v2 guts in four helper
functions, we are free to sanitize those, as long as

- layout of the structure is unchanged (it's on-disk object)

- behaviour of these helpers is same as before.

Patch kills the mess with endianness-dependent bitfields and replaces them
with a single __le64.  Helpers are switched to straightforward shift/and/or.

Benefits:

- exact same definitions for little- and big-endian architectures; no ifdefs
  in sight.

- generate the same code on little-endian and improved on big-endian.

- doesn't rely on lousy bitfields handling in gcc codegenerator.

- happens to be standard C (unsigned long long is not a valid type for a
  bitfield; it's a gccism and not well-implemented one, at that).

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6b9f5829
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment