btrfs: use unaligned helpers for stack and header set/get helpers
authorDavid Sterba <dsterba@suse.com>
Tue, 15 Sep 2020 12:58:42 +0000 (14:58 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:13:23 +0000 (12:13 +0200)
commite97659cefe1e9dc0bb4284195ba4ab380d0cf1fe
tree6201008f28868eb1ad4a661e330d0a4d4023bce9
parent6994ca367ce5160dea2718e0993542d148fa68f8
btrfs: use unaligned helpers for stack and header set/get helpers

In the definitions generated by BTRFS_SETGET_HEADER_FUNCS there's direct
pointer assignment but we should use the helpers for unaligned access
for clarity. It hasn't been a problem so far because of the natural
alignment.

Similarly for BTRFS_SETGET_STACK_FUNCS, that usually get a structure
from stack that has an aligned start but some members may not be aligned
due to packing. This as well hasn't caused problems so far.

Move the put/get_unaligned_le8 stubs to ctree.h so we can use them.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/struct-funcs.c