diff options
author | Simon Glass <sjg@chromium.org> | 2011-12-21 10:01:27 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-01-05 17:12:11 +0100 |
commit | 26784f1ecb5002aa309f2aefcb1157a9282a2007 (patch) | |
tree | 055b904a1458e16883effcbcc9c954ab3c0c60d2 | |
parent | aa701b94336b358798d676eef12a7b90bdac23f5 (diff) | |
download | u-boot-imx-26784f1ecb5002aa309f2aefcb1157a9282a2007.zip u-boot-imx-26784f1ecb5002aa309f2aefcb1157a9282a2007.tar.gz u-boot-imx-26784f1ecb5002aa309f2aefcb1157a9282a2007.tar.bz2 |
ext2: Cache line align indirection buffers
Make ext2 use cache line aligned buffers for reading from the filesystem.
This is needed when caches are enabled because unaligned cache invalidates
are not safe.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | fs/ext2/ext2fs.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index e119e13..f621741 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -265,7 +265,8 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { /* Indirect. */ else if (fileblock < (INDIRECT_BLOCKS + (blksz / 4))) { if (indir1_block == NULL) { - indir1_block = (uint32_t *) malloc (blksz); + indir1_block = (uint32_t *) memalign(ARCH_DMA_MINALIGN, + blksz); if (indir1_block == NULL) { printf ("** ext2fs read block (indir 1) malloc failed. **\n"); return (-1); @@ -278,7 +279,8 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { indir1_block = NULL; indir1_size = 0; indir1_blkno = -1; - indir1_block = (uint32_t *) malloc (blksz); + indir1_block = (uint32_t *) memalign(ARCH_DMA_MINALIGN, + blksz); if (indir1_block == NULL) { printf ("** ext2fs read block (indir 1) malloc failed. **\n"); return (-1); @@ -309,7 +311,8 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { + blksz / 4); if (indir1_block == NULL) { - indir1_block = (uint32_t *) malloc (blksz); + indir1_block = (uint32_t *) memalign(ARCH_DMA_MINALIGN, + blksz); if (indir1_block == NULL) { printf ("** ext2fs read block (indir 2 1) malloc failed. **\n"); return (-1); @@ -322,7 +325,8 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { indir1_block = NULL; indir1_size = 0; indir1_blkno = -1; - indir1_block = (uint32_t *) malloc (blksz); + indir1_block = (uint32_t *) memalign(ARCH_DMA_MINALIGN, + blksz); if (indir1_block == NULL) { printf ("** ext2fs read block (indir 2 1) malloc failed. **\n"); return (-1); @@ -343,7 +347,8 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { } if (indir2_block == NULL) { - indir2_block = (uint32_t *) malloc (blksz); + indir2_block = (uint32_t *) memalign(ARCH_DMA_MINALIGN, + blksz); if (indir2_block == NULL) { printf ("** ext2fs read block (indir 2 2) malloc failed. **\n"); return (-1); @@ -356,7 +361,8 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { indir2_block = NULL; indir2_size = 0; indir2_blkno = -1; - indir2_block = (uint32_t *) malloc (blksz); + indir2_block = (uint32_t *) memalign(ARCH_DMA_MINALIGN, + blksz); if (indir2_block == NULL) { printf ("** ext2fs read block (indir 2 2) malloc failed. **\n"); return (-1); |