btrfs-progs: fix unaligned accesses v2
authorBen Peddell <klightspeed@killerwolves.net>
Sun, 27 Jan 2013 05:45:43 +0000 (15:45 +1000)
committerDavid Sterba <dsterba@suse.cz>
Mon, 28 Jan 2013 17:06:43 +0000 (18:06 +0100)
commit7b668965f0cf3fb8632c505a7a011189ee1a5a8e
treeed4755aba4bd2c26a232545dc2d636ac83835251
parent272c04915252c497c64fd4036b601b82c3368bbd
btrfs-progs: fix unaligned accesses v2

gcc optimizes out the memcpy calls at -O2 and -Os.

Replacing memcpy with memmove does't work - gcc treats memmove
the same way it treats memcpy.

This patch brings in {get|put}_unaligned_le{16|32|64} (using the
packed struct method), and uses them in the failing get/set calls.

On architectures where unaligned accesses are cheap, these unaligned
macros should be optimized out by the compiler.

Signed-off-by: Ben Peddell <klightspeed@killerwolves.net>
ctree.h
kerncompat.h