free critical sections with DeleteCriticalSection

This commit is contained in:
Olga Kornievskaia 2011-11-02 12:05:33 -04:00
parent 572c69e3d0
commit 0694415a95
4 changed files with 6 additions and 2 deletions

View file

@ -88,6 +88,7 @@ static void root_free(
/* free clients */ /* free clients */
list_for_each_tmp(entry, tmp, &root->clients) list_for_each_tmp(entry, tmp, &root->clients)
nfs41_client_free(client_entry(entry)); nfs41_client_free(client_entry(entry));
DeleteCriticalSection(&root->lock);
free(root); free(root);
dprintf(NSLVL, "<-- nfs41_root_free()\n"); dprintf(NSLVL, "<-- nfs41_root_free()\n");

View file

@ -337,6 +337,8 @@ void nfs41_client_free(
nfs41_rpc_clnt_free(client->rpc); nfs41_rpc_clnt_free(client->rpc);
if (client->layouts) pnfs_layout_list_free(client->layouts); if (client->layouts) pnfs_layout_list_free(client->layouts);
if (client->devices) pnfs_file_device_list_free(client->devices); if (client->devices) pnfs_file_device_list_free(client->devices);
DeleteCriticalSection(&client->state.lock);
DeleteCriticalSection(&client->recovery.lock);
free(client); free(client);
} }

View file

@ -72,6 +72,7 @@ static void file_device_free(
{ {
free(device->servers.arr); free(device->servers.arr);
free(device->stripes.arr); free(device->stripes.arr);
DeleteCriticalSection(&device->device.lock);
free(device); free(device);
} }
@ -156,7 +157,7 @@ void pnfs_file_device_list_free(
file_device_free(device_entry(entry)); file_device_free(device_entry(entry));
LeaveCriticalSection(&devices->lock); LeaveCriticalSection(&devices->lock);
DeleteCriticalSection(&devices->lock);
free(devices); free(devices);
} }

View file

@ -129,7 +129,7 @@ void pnfs_layout_list_free(
layout_state_free(state_entry(entry)); layout_state_free(state_entry(entry));
LeaveCriticalSection(&layouts->lock); LeaveCriticalSection(&layouts->lock);
DeleteCriticalSection(&layouts->lock);
free(layouts); free(layouts);
} }