aboutsummaryrefslogtreecommitdiff
path: root/include/fs.h
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2018-09-11 15:59:13 +0900
committerAlexander Graf <agraf@suse.de>2018-09-23 21:55:30 +0200
commite2519daf5cef63c19ed16ead74e3525f951c24e0 (patch)
treec02e9b77cf75ffb9c3c3a00eb28f45e3d21844f4 /include/fs.h
parent5bc84a13032fb729bd9f5769cca8f587672caa26 (diff)
downloadu-boot-e2519daf5cef63c19ed16ead74e3525f951c24e0.zip
u-boot-e2519daf5cef63c19ed16ead74e3525f951c24e0.tar.gz
u-boot-e2519daf5cef63c19ed16ead74e3525f951c24e0.tar.bz2
fs: add unlink interface
"unlink" interface is added to file operations. This is a preparatory change as unlink support for FAT file system will be added in next patch. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/fs.h')
-rw-r--r--include/fs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/fs.h b/include/fs.h
index fbaee15..aa3604d 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -156,6 +156,16 @@ struct fs_dirent *fs_readdir(struct fs_dir_stream *dirs);
void fs_closedir(struct fs_dir_stream *dirs);
/*
+ * fs_unlink - delete a file or directory
+ *
+ * If a given name is a directory, it will be deleted only if it's empty
+ *
+ * @filename: Name of file or directory to delete
+ * @return 0 on success, -1 on error conditions
+ */
+int fs_unlink(const char *filename);
+
+/*
* fs_mkdir - Create a directory
*
* @filename: Name of directory to create
@@ -177,6 +187,8 @@ int file_exists(const char *dev_type, const char *dev_part, const char *file,
int fstype);
int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
int fstype);
+int do_rm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype);
int do_mkdir(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
int fstype);