summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/dev.c4
-rw-r--r--fs/ext4/ext4_common.c2
-rw-r--r--fs/ext4/ext4_common.h7
3 files changed, 9 insertions, 4 deletions
diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index fb62f241e44..9e85228edac 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -62,7 +62,7 @@ int ext4fs_set_blk_dev(block_dev_desc_t *rbdd, int part)
int ext4fs_devread(int sector, int byte_offset, int byte_len, char *buf)
{
- char sec_buf[SECTOR_SIZE];
+ ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, SECTOR_SIZE);
unsigned block_len;
/* Check partition boundaries */
@@ -107,7 +107,7 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, char *buf)
block_len = byte_len & ~(SECTOR_SIZE - 1);
if (block_len == 0) {
- u8 p[SECTOR_SIZE];
+ ALLOC_CACHE_ALIGN_BUFFER(u8, p, SECTOR_SIZE);
block_len = SECTOR_SIZE;
ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc->dev,
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 083e45eed59..3deffd523e0 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -71,7 +71,7 @@ void put_ext4(uint64_t off, void *buf, uint32_t size)
uint64_t startblock;
uint64_t remainder;
unsigned char *temp_ptr = NULL;
- unsigned char sec_buf[SECTOR_SIZE];
+ ALLOC_CACHE_ALIGN_BUFFER(unsigned char, sec_buf, SECTOR_SIZE);
struct ext_filesystem *fs = get_fs();
startblock = off / (uint64_t)SECTOR_SIZE;
diff --git a/fs/ext4/ext4_common.h b/fs/ext4/ext4_common.h
index 801b8b848ad..0af625db2ba 100644
--- a/fs/ext4/ext4_common.h
+++ b/fs/ext4/ext4_common.h
@@ -55,7 +55,12 @@
#define SUPERBLOCK_SIZE 1024
#define F_FILE 1
-#define zalloc(size) calloc(1, size)
+static inline void *zalloc(size_t size)
+{
+ void *p = memalign(ARCH_DMA_MINALIGN, size);
+ memset(p, 0, size);
+ return p;
+}
extern unsigned long part_offset;
int ext4fs_read_inode(struct ext2_data *data, int ino,