diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2011-03-11 14:56:56 +0000 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2011-03-11 14:56:56 +0000 |
commit | 84f48499a3213f425f3d96e45cf7a80071f3022c (patch) | |
tree | 1a806f2b77d921cf7509fb032cb9b99cd9a3213f /tools/pvscan.c | |
parent | 1307ddf4cfefd68b2fea4a3b6551777f1d2b9b25 (diff) | |
download | lvm2-84f48499a3213f425f3d96e45cf7a80071f3022c.tar.gz lvm2-84f48499a3213f425f3d96e45cf7a80071f3022c.tar.xz lvm2-84f48499a3213f425f3d96e45cf7a80071f3022c.zip |
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).
Diffstat (limited to 'tools/pvscan.c')
-rw-r--r-- | tools/pvscan.c | 4 |
1 files changed, 3 insertions, 1 deletions
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"); |