fs: add api to get the name of filesystem type
Let others to get the name of partition filesystem type which is private member in fs/fs.c Change-Id: Iae5c89c705fa65b5eedb4550963003b6e03e2820 Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
parent
de78ceae23
commit
e17ddcea32
19
fs/fs.c
19
fs/fs.c
|
|
@ -317,6 +317,25 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int fs_get_fstype(const char **fstype_name)
|
||||
{
|
||||
struct fstype_info *info;
|
||||
|
||||
if (fstype_name == NULL) {
|
||||
printf("** parameter error **\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
info = fs_get_info(fs_type);
|
||||
if (info->fstype == FS_TYPE_ANY) {
|
||||
printf("** not match any filesystem type **\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*fstype_name = info->name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void fs_close(void)
|
||||
{
|
||||
struct fstype_info *info = fs_get_info(fs_type);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,15 @@
|
|||
*/
|
||||
int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
|
||||
|
||||
/*
|
||||
* fs_get_fstype - Get filesystem type on the partition previously
|
||||
* set by fs_set_blk_dev()
|
||||
*
|
||||
* @fstype_name: The return the name of filesystem type
|
||||
* @return 0 if ok with valid *fstype_name, -1 on error conditions
|
||||
*/
|
||||
int fs_get_fstype(const char **fstype_name);
|
||||
|
||||
/*
|
||||
* fs_set_blk_dev_with_part - Set current block device + partition
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue