diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2017-12-06 09:17:08 -0600 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2017-12-06 09:17:08 -0600 |
commit | ce1abf95b49120035a077107b39f23d15d82fa7b (patch) | |
tree | 4f8260e3d173a055d931500becd94ab4bba1355b | |
parent | bd987fe368a6856cdbeace2e7ba15049e85c31af (diff) | |
download | xfsprogs-dev-ce1abf95b49120035a077107b39f23d15d82fa7b.tar.gz |
libfrog: add missing function fs_table_destroy
Add a function to tear down the fs_table when we're done
messing with paths.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | libfrog/paths.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libfrog/paths.c b/libfrog/paths.c index b767e9dcee..62b4eda6a0 100644 --- a/libfrog/paths.c +++ b/libfrog/paths.c @@ -206,6 +206,26 @@ out_nodev: return error; } +/* Remove all the cached entries in the fs table. */ +void +fs_table_destroy(void) +{ + int i; + struct fs_path *fsp; + + for (i = 0, fsp = fs_table; i < fs_count; i++, fsp++) { + free(fsp->fs_name); + free(fsp->fs_dir); + free(fsp->fs_log); + free(fsp->fs_rt); + } + + fs_count = 0; + xfs_fs_count = 0; + free(fs_table); + fs_table = NULL; +} + /* * Table iteration (cursor-based) interfaces */ |