• A
    [PATCH] reiserfs endianness: sanitize reiserfs_key union · f8e08a84
    Al Viro 提交于
    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: NAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
    Cc: <reiserfs-dev@namesys.com>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    f8e08a84
reiserfs_fs.h 90.9 KB