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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user