X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=fs%2Ffs.c;h=0c66d6047703c76402c3e838b9a2e625492b99d2;hb=41fd506842c2d9385d940cffe8ceeb8456c29fc5;hp=48d8f1f6dab88ada6d4debf1cd51d299300c783d;hpb=5eea874b5e989e62519824ad140aa086432d01ee;p=oweals%2Fu-boot.git diff --git a/fs/fs.c b/fs/fs.c index 48d8f1f6da..0c66d60477 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -306,6 +307,19 @@ static struct fstype_info *fs_get_info(int fstype) return info; } +/** + * 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 * @@ -388,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); @@ -412,7 +426,6 @@ int fs_ls(const char *dirname) ret = info->ls(dirname); - fs_type = FS_TYPE_ANY; fs_close(); return ret; @@ -596,7 +609,6 @@ int fs_unlink(const char *filename) ret = info->unlink(filename); - fs_type = FS_TYPE_ANY; fs_close(); return ret; @@ -610,7 +622,6 @@ int fs_mkdir(const char *dirname) ret = info->mkdir(dirname); - fs_type = FS_TYPE_ANY; fs_close(); return ret;