summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2012-11-19 09:27:18 -0700
committerTom Rini <trini@ti.com>2012-11-19 09:27:18 -0700
commitbb367b95f9204115bd6eac82e839b5590e6da4eb (patch)
treea64a8fb6c7a86d79e9a4a0c32d48c033236815fb /fs
parentdb71964235c1dfa13ec398da483b0bdbbf31d5b7 (diff)
parent59ddead140a7cfda78bc36e22aadc48f3b962e59 (diff)
downloadu-boot-imx-bb367b95f9204115bd6eac82e839b5590e6da4eb.zip
u-boot-imx-bb367b95f9204115bd6eac82e839b5590e6da4eb.tar.gz
u-boot-imx-bb367b95f9204115bd6eac82e839b5590e6da4eb.tar.bz2
Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c11
-rw-r--r--fs/zfs/zfs.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/fs/fs.c b/fs/fs.c
index ff360af..023e7ef 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -257,6 +257,7 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
unsigned long pos;
int len_read;
char buf[12];
+ unsigned long time;
if (argc < 2)
return CMD_RET_USAGE;
@@ -293,11 +294,19 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
else
pos = 0;
+ time = get_timer(0);
len_read = fs_read(filename, addr, pos, bytes);
+ time = get_timer(time);
if (len_read <= 0)
return 1;
- printf("%d bytes read\n", len_read);
+ printf("%d bytes read in %lu ms", len_read, time);
+ if (time > 0) {
+ puts(" (");
+ print_size(len_read / time * 1000, "/s");
+ puts(")");
+ }
+ puts("\n");
sprintf(buf, "0x%x", len_read);
setenv("filesize", buf);
diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
index 2db45b1..1b73244 100644
--- a/fs/zfs/zfs.c
+++ b/fs/zfs/zfs.c
@@ -30,6 +30,7 @@
#include <linux/ctype.h>
#include <asm/byteorder.h>
#include "zfs_common.h"
+#include "div64.h"
block_dev_desc_t *zfs_dev_desc;
@@ -2115,7 +2116,8 @@ zfs_read(zfs_file_t file, char *buf, uint64_t len)
/*
* Find requested blkid and the offset within that block.
*/
- uint64_t blkid = (file->offset + red) / blksz;
+ uint64_t blkid = file->offset + red;
+ blkid = do_div(blkid, blksz);
free(data->file_buf);
data->file_buf = 0;