Skip to content

Commit

Permalink
fs: export fs_close()
Browse files Browse the repository at this point in the history
fs_close() closes the connection to a file system which opened with
either fs_set_blk_dev() or fs_set_dev_with_part(). Many file system
functions implicitly call fs_close(), e.g. fs_closedir(), fs_exist(),
fs_ln(), fs_ls(), fs_mkdir(), fs_read(), fs_size(), fs_write()
and fs_unlink().
So just export it.

Signed-off-by: AKASHI Takahiro <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
  • Loading branch information
AKASHI Takahiro authored and xypron committed Oct 17, 2019
1 parent 08c51ff commit 64f49eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,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);

Expand Down
7 changes: 7 additions & 0 deletions include/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ 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);

/**
* fs_close() - Unset current block device and partition
*
* Should be paired with either fs_set_blk_dev() or fs_set_dev_with_part()
*/
void fs_close(void);

/**
* fs_get_type_name() - Get type of current filesystem
*
Expand Down

0 comments on commit 64f49eb

Please sign in to comment.