fs: add fs_get_type() for current filesystem type

This function is a variant of fs_get_type_name() and returns a filesystem
type with which the current device is associated.
We don't want to export fs_type variable directly because we have to take
care of it consistently within fs.c.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
AKASHI Takahiro 2019-10-07 14:59:37 +09:00 committed by Heinrich Schuchardt
parent 185aed7855
commit b7cd95627b
2 changed files with 23 additions and 0 deletions

13
fs/fs.c
View File

@ -307,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
*

View File

@ -49,6 +49,16 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
*/
void fs_close(void);
/**
* 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);
/**
* fs_get_type_name() - Get type of current filesystem
*