summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2019-10-07 14:59:37 +0900
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-10-17 19:19:56 +0200
commitb7cd95627baac05b7023b014c802be309be636a0 (patch)
tree1414d192e1f496404e1d04d6c7496af48f66fa3b /fs
parent185aed7855573214794b13f20e597d36c6dc5760 (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index b17b76a46a..0c66d60477 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -308,6 +308,19 @@ static struct fstype_info *fs_get_info(int fstype)
}
/**
+ * 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
*
* Return: Pointer to filesystem name