diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-02-20 13:16:05 +0100 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-02-20 13:16:05 +0100 |
commit | 3e11350255d9c5d4bd03c2a65769da84c05d3294 (patch) | |
tree | 2ebc3d0fa0592479020d2d9dc7228b4d15ed2eaa /fs/fat/fat.c | |
parent | e7538fee991308c16f76f7eca2517089f2a30ff4 (diff) | |
parent | 0a8e823ad0c5a602c93c2e8a54caf622ade6d3fb (diff) | |
download | u-boot-imx-3e11350255d9c5d4bd03c2a65769da84c05d3294.zip u-boot-imx-3e11350255d9c5d4bd03c2a65769da84c05d3294.tar.gz u-boot-imx-3e11350255d9c5d4bd03c2a65769da84c05d3294.tar.bz2 |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts:
Makefile
drivers/net/npe/Makefile
These two conflicts arise from commit 0b2d3f20
("ARM: NET: Remove the IXP NPE ethernet driver") and are
resolved by deleting the drivers/net/npe/Makefile file
and removing the CONFIG_IXP4XX_NPE line from Makefile.
Diffstat (limited to 'fs/fat/fat.c')
-rw-r--r-- | fs/fat/fat.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index b41d62e..54f42ea 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -808,7 +808,7 @@ __u8 do_fat_read_at_block[MAX_CLUSTSIZE] long do_fat_read_at(const char *filename, unsigned long pos, void *buffer, - unsigned long maxsize, int dols) + unsigned long maxsize, int dols, int dogetsize) { char fnamecopy[2048]; boot_sector bs; @@ -1152,7 +1152,10 @@ rootdir_done: subname = nextname; } - ret = get_contents(mydata, dentptr, pos, buffer, maxsize); + if (dogetsize) + ret = FAT2CPU32(dentptr->size); + else + ret = get_contents(mydata, dentptr, pos, buffer, maxsize); debug("Size: %d, got: %ld\n", FAT2CPU32(dentptr->size), ret); exit: @@ -1163,7 +1166,7 @@ exit: long do_fat_read(const char *filename, void *buffer, unsigned long maxsize, int dols) { - return do_fat_read_at(filename, 0, buffer, maxsize, dols); + return do_fat_read_at(filename, 0, buffer, maxsize, dols, 0); } int file_fat_detectfs(void) @@ -1233,11 +1236,18 @@ int file_fat_ls(const char *dir) return do_fat_read(dir, NULL, 0, LS_YES); } +int fat_exists(const char *filename) +{ + int sz; + sz = do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1); + return sz >= 0; +} + long file_fat_read_at(const char *filename, unsigned long pos, void *buffer, unsigned long maxsize) { printf("reading %s\n", filename); - return do_fat_read_at(filename, pos, buffer, maxsize, LS_NO); + return do_fat_read_at(filename, pos, buffer, maxsize, LS_NO, 0); } long file_fat_read(const char *filename, void *buffer, unsigned long maxsize) |