]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libfrog: add missing function fs_table_destroy
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 6 Dec 2017 15:17:08 +0000 (09:17 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 6 Dec 2017 15:17:08 +0000 (09:17 -0600)
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>
libfrog/paths.c

index b767e9dcee739a1817e7a7ecf5df2be2103c8039..62b4eda6a0cc41e18d9618f8606e9f6e35d62b49 100644 (file)
@@ -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
  */