summaryrefslogtreecommitdiff
path: root/fs/fs.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-10-18 16:37:03 -0400
committerTom Rini <trini@konsulko.com>2019-10-18 16:37:03 -0400
commit4b5c4dd93a829416d159619e4a58e97e9b215206 (patch)
tree667242755939a72efebd99e815e0944c33174e4b /fs/fs.c
parent3b985bdeabd1b05abf28fe7dc6530c203750f9fc (diff)
parent5cc349bb09eefaf43e250b2c7a8fc5a61c595715 (diff)
Merge tag 'efi-2020-01-rc1-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-01-rc1 (2) Install the simple file protocol only if there is a file system on the partition. Enable CONFIG_CMD_NVEDIT_EFI on QEMU.
Diffstat (limited to 'fs/fs.c')
-rw-r--r--fs/fs.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/fs.c b/fs/fs.c
index d8a4ced4698..0c66d604770 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -308,6 +308,19 @@ static struct fstype_info *fs_get_info(int fstype)
}
/**
+ * fs_get_type() - Get type of current filesystem
+ *
+ * Return: filesystem type
+ *
+ * Returns filesystem type representing the current filesystem, or
+ * FS_TYPE_ANY for any unrecognised filesystem.
+ */
+int fs_get_type(void)
+{
+ return fs_type;
+}
+
+/**
* fs_get_type_name() - Get type of current filesystem
*
* Return: Pointer to filesystem name
@@ -389,7 +402,7 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part)
return -1;
}
-static void fs_close(void)
+void fs_close(void)
{
struct fstype_info *info = fs_get_info(fs_type);
@@ -413,7 +426,6 @@ int fs_ls(const char *dirname)
ret = info->ls(dirname);
- fs_type = FS_TYPE_ANY;
fs_close();
return ret;
@@ -597,7 +609,6 @@ int fs_unlink(const char *filename)
ret = info->unlink(filename);
- fs_type = FS_TYPE_ANY;
fs_close();
return ret;
@@ -611,7 +622,6 @@ int fs_mkdir(const char *dirname)
ret = info->mkdir(dirname);
- fs_type = FS_TYPE_ANY;
fs_close();
return ret;