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>
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
*/