summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2012-04-30 18:19:28 +0200
committerWolfgang Denk <wd@denx.de>2012-04-30 18:19:28 +0200
commit0a6deb3251a68b5be640ab1b848ca67e906b75ce (patch)
tree8bf3b48fdf66cad167186110fb6ab4f79a335a57 /fs
parente0f6a4e8b17afead8add6e528936a505367c091c (diff)
parent6777a3cf73f621892afe938983918d2aea7730b5 (diff)
downloadblackbird-obmc-uboot-0a6deb3251a68b5be640ab1b848ca67e906b75ce.tar.gz
blackbird-obmc-uboot-0a6deb3251a68b5be640ab1b848ca67e906b75ce.zip
Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
* 'agust@denx.de' of git://git.denx.de/u-boot-staging: lin_gadget: use common linux/compat.h linux/compat.h: rename from linux/mtd/compat.h lin_gadget: use common mdelay gunzip: rename z{alloc, free} to gz{alloc, free} fs/fat: align disk buffers on cache line to enable DMA and cache part_dos: align disk buffers on cache line to enable DMA and cache
Diffstat (limited to 'fs')
-rw-r--r--fs/cramfs/uncompress.c7
-rw-r--r--fs/fat/fat.c22
-rw-r--r--fs/jffs2/jffs2_1pass.c2
3 files changed, 15 insertions, 16 deletions
diff --git a/fs/cramfs/uncompress.c b/fs/cramfs/uncompress.c
index 228fe68c11..f431cc46c1 100644
--- a/fs/cramfs/uncompress.c
+++ b/fs/cramfs/uncompress.c
@@ -27,9 +27,6 @@
static z_stream stream;
-void *zalloc(void *, unsigned, unsigned);
-void zfree(void *, void *, unsigned);
-
/* Returns length of decompressed data. */
int cramfs_uncompress_block (void *dst, void *src, int srclen)
{
@@ -59,8 +56,8 @@ int cramfs_uncompress_init (void)
{
int err;
- stream.zalloc = zalloc;
- stream.zfree = zfree;
+ stream.zalloc = gzalloc;
+ stream.zfree = gzfree;
stream.next_in = 0;
stream.avail_in = 0;
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 1f95eb4caf..a3085b51d9 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -31,6 +31,8 @@
#include <fat.h>
#include <asm/byteorder.h>
#include <part.h>
+#include <malloc.h>
+#include <linux/compiler.h>
/*
* Convert a string to lowercase.
@@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
{
- unsigned char buffer[dev_desc->blksz];
+ ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
/* First close any currently found FAT filesystem */
cur_dev = NULL;
@@ -293,7 +295,7 @@ get_cluster (fsdata *mydata, __u32 clustnum, __u8 *buffer,
return -1;
}
if (size % mydata->sect_size) {
- __u8 tmpbuf[mydata->sect_size];
+ ALLOC_CACHE_ALIGN_BUFFER(__u8, tmpbuf, mydata->sect_size);
idx = size / mydata->sect_size;
ret = disk_read(startsect + idx, 1, tmpbuf);
@@ -428,8 +430,8 @@ static int slot2str (dir_slot *slotptr, char *l_name, int *idx)
* into 'retdent'
* Return 0 on success, -1 otherwise.
*/
-__attribute__ ((__aligned__ (__alignof__ (dir_entry))))
-__u8 get_vfatname_block[MAX_CLUSTSIZE];
+__u8 get_vfatname_block[MAX_CLUSTSIZE]
+ __aligned(ARCH_DMA_MINALIGN);
static int
get_vfatname (fsdata *mydata, int curclust, __u8 *cluster,
@@ -533,8 +535,8 @@ static __u8 mkcksum (const char *str)
* Get the directory entry associated with 'filename' from the directory
* starting at 'startsect'
*/
-__attribute__ ((__aligned__ (__alignof__ (dir_entry))))
-__u8 get_dentfromdir_block[MAX_CLUSTSIZE];
+__u8 get_dentfromdir_block[MAX_CLUSTSIZE]
+ __aligned(ARCH_DMA_MINALIGN);
static dir_entry *get_dentfromdir (fsdata *mydata, int startsect,
char *filename, dir_entry *retdent,
@@ -709,7 +711,7 @@ read_bootsectandvi (boot_sector *bs, volume_info *volinfo, int *fatsize)
return -1;
}
- block = malloc(cur_dev->blksz);
+ block = memalign(ARCH_DMA_MINALIGN, cur_dev->blksz);
if (block == NULL) {
debug("Error: allocating block\n");
return -1;
@@ -765,8 +767,8 @@ exit:
return ret;
}
-__attribute__ ((__aligned__ (__alignof__ (dir_entry))))
-__u8 do_fat_read_block[MAX_CLUSTSIZE];
+__u8 do_fat_read_block[MAX_CLUSTSIZE]
+ __aligned(ARCH_DMA_MINALIGN);
long
do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
@@ -828,7 +830,7 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
}
mydata->fatbufnum = -1;
- mydata->fatbuf = malloc(FATBUFSIZE);
+ mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
if (mydata->fatbuf == NULL) {
debug("Error: allocating memory\n");
return -1;
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index a0b02e4dda..c856983ef4 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -119,7 +119,7 @@
#include <watchdog.h>
#include <jffs2/jffs2.h>
#include <jffs2/jffs2_1pass.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <asm/errno.h>
#include "jffs2_private.h"
OpenPOWER on IntegriCloud