summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2014-02-03 13:21:09 -0700
committerTom Rini <trini@ti.com>2014-02-19 09:47:34 -0500
commit55af5c9313607f3b6acba2fd915b263ef6a61dd4 (patch)
tree95dd692ed9c7c22357c77e2315cb92cd235f8dc3 /fs/ext4
parent89ba42d18303d06d49ca14de2d46c82bbdcad06c (diff)
downloadu-boot-55af5c9313607f3b6acba2fd915b263ef6a61dd4.tar.gz
u-boot-55af5c9313607f3b6acba2fd915b263ef6a61dd4.tar.xz
u-boot-55af5c9313607f3b6acba2fd915b263ef6a61dd4.zip
ext4: implement exists() for ext4fs
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the ext4 filesystem. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/ext4fs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index 735b256417..417ce7b63b 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -174,6 +174,14 @@ int ext4fs_ls(const char *dirname)
return 0;
}
+int ext4fs_exists(const char *filename)
+{
+ int file_len;
+
+ file_len = ext4fs_open(filename);
+ return file_len >= 0;
+}
+
int ext4fs_read(char *buf, unsigned len)
{
if (ext4fs_root == NULL || ext4fs_file == NULL)