summaryrefslogtreecommitdiff
path: root/fs/btrfs/struct-funcs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2020-09-15 15:58:42 +0300
committerDavid Sterba <dsterba@suse.com>2020-10-07 13:13:23 +0300
commite97659cefe1e9dc0bb4284195ba4ab380d0cf1fe (patch)
tree6201008f28868eb1ad4a661e330d0a4d4023bce9 /fs/btrfs/struct-funcs.c
parent6994ca367ce5160dea2718e0993542d148fa68f8 (diff)
downloadlinux-e97659cefe1e9dc0bb4284195ba4ab380d0cf1fe.tar.xz
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>
Diffstat (limited to 'fs/btrfs/struct-funcs.c')
-rw-r--r--fs/btrfs/struct-funcs.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/fs/btrfs/struct-funcs.c b/fs/btrfs/struct-funcs.c
index 079b059818e9..c46be27be700 100644
--- a/fs/btrfs/struct-funcs.c
+++ b/fs/btrfs/struct-funcs.c
@@ -7,16 +7,6 @@
#include "ctree.h"
-static inline u8 get_unaligned_le8(const void *p)
-{
- return *(u8 *)p;
-}
-
-static inline void put_unaligned_le8(u8 val, void *p)
-{
- *(u8 *)p = val;
-}
-
static bool check_setget_bounds(const struct extent_buffer *eb,
const void *ptr, unsigned off, int size)
{