From 84f48499a3213f425f3d96e45cf7a80071f3022c Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Fri, 11 Mar 2011 14:56:56 +0000 Subject: Add new free_pv_fid fn and use it throughout to free all attached fids. Since format instances will use own memory pool, it's necessary to properly deallocate it. For now, only fid is deallocated. The PV structure itself still uses cmd mempool mostly, but anytime we'd like to add a mempool in the struct physical_volume, we can just rename this fn to free_pv and add the code (like we have free_vg fn for VGs). --- tools/pvscan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/pvscan.c') diff --git a/tools/pvscan.c b/tools/pvscan.c index b24b7ab5..b40be6db 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -183,8 +183,10 @@ int pvscan(struct cmd_context *cmd, int argc __attribute__((unused)), pv_max_name_len += 2; vg_max_name_len += 2; - dm_list_iterate_items(pvl, pvslist) + dm_list_iterate_items(pvl, pvslist) { _pvscan_display_single(cmd, pvl->pv, NULL); + free_pv_fid(pvl->pv); + } if (!pvs_found) { log_print("No matching physical volumes found"); -- cgit