mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-07 06:52:23 +00:00
fs: Add fs_get_type_name to return current filesystem name
Add fs_get_type_name so we can get the current filesystem type. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
413b90777f
commit
0d488e8f50
2 changed files with 23 additions and 0 deletions
13
fs/fs.c
13
fs/fs.c
|
@ -265,6 +265,19 @@ static struct fstype_info *fs_get_info(int fstype)
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fs_get_type_name() - Get type of current filesystem
|
||||||
|
*
|
||||||
|
* Return: Pointer to filesystem name
|
||||||
|
*
|
||||||
|
* Returns a string describing the current filesystem, or the sentinel
|
||||||
|
* "unsupported" for any unrecognised filesystem.
|
||||||
|
*/
|
||||||
|
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)
|
int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
|
||||||
{
|
{
|
||||||
struct fstype_info *info;
|
struct fstype_info *info;
|
||||||
|
|
10
include/fs.h
10
include/fs.h
|
@ -37,6 +37,16 @@ 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);
|
int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fs_get_type_name() - Get type of current filesystem
|
||||||
|
*
|
||||||
|
* Return: Pointer to filesystem name
|
||||||
|
*
|
||||||
|
* Returns a string describing the current filesystem, or the sentinel
|
||||||
|
* "unsupported" for any unrecognised filesystem.
|
||||||
|
*/
|
||||||
|
const char *fs_get_type_name(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print the list of files on the partition previously set by fs_set_blk_dev(),
|
* Print the list of files on the partition previously set by fs_set_blk_dev(),
|
||||||
* in directory "dirname".
|
* in directory "dirname".
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue