[PATCH 10/12] libfrog: add missing function fs_table_destroy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Add a function to tear down the fs_table when we're done messing with paths.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 libfrog/paths.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)


diff --git a/libfrog/paths.c b/libfrog/paths.c
index b767e9d..62b4eda 100644
--- a/libfrog/paths.c
+++ b/libfrog/paths.c
@@ -206,6 +206,26 @@ fs_table_insert(
 	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
  */

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux