[U-Boot] [PATCH v3 12/13] fs: Add fs_get_type_name to return current filesystem name

Alex Kiernan alex.kiernan at gmail.com
Mon May 14 09:09:07 UTC 2018


Add fs_get_type_name so we can get the current filesystem type.

Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---

Changes in v3:
- new

Changes in v2: None

 fs/fs.c      | 5 +++++
 include/fs.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/fs/fs.c b/fs/fs.c
index 94cdc37..1c095a3 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -265,6 +265,11 @@ static struct fstype_info *fs_get_info(int fstype)
 	return info;
 }
 
+const char *fs_get_type_name(void)
+{
+	return fs_get_info(fs_type)->name;
+}
+
 int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
 {
 	struct fstype_info *info;
diff --git a/include/fs.h b/include/fs.h
index d703ed5..47dc51c 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -38,6 +38,11 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
 int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
 
 /*
+ * fs_get_type_name - Get type of current filesystem
+ */
+const char *fs_get_type_name(void);
+
+/*
  * Print the list of files on the partition previously set by fs_set_blk_dev(),
  * in directory "dirname".
  *
-- 
2.7.4



More information about the U-Boot mailing list