fs: btrfs: Fix cache alignment bugs
[oweals/u-boot.git] / fs / btrfs / extent-io.c
index 7263f41644e483eba9401a0f2f0700878a622a1b..66d0e1c7d65faf5a91da5ca985fdbdaace2825df 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "btrfs.h"
 #include <malloc.h>
+#include <memalign.h>
 
 u64 btrfs_read_extent_inline(struct btrfs_path *path,
                             struct btrfs_file_extent_item *extent, u64 offset,
@@ -89,7 +90,7 @@ u64 btrfs_read_extent_reg(struct btrfs_path *path,
                return size;
        }
 
-       cbuf = malloc(dlen > size ? clen + dlen : clen);
+       cbuf = malloc_cache_aligned(dlen > size ? clen + dlen : clen);
        if (!cbuf)
                return -1ULL;