1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

fs: btrfs: Fix cache alignment bugs

The btrfs implementation passes cache-unaligned buffers into the
block layer, which triggers cache alignment problems down in the
block device drivers. Align the buffers to prevent this.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Behun <marek.behun@nic.cz>
This commit is contained in:
Marek Vasut
2018-09-22 04:13:35 +02:00
committed by Tom Rini
parent 30b3241368
commit c9795396ed
3 changed files with 17 additions and 13 deletions

View 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;