storage: Removing mutex locking in initialization and cleanup

These functions are only ever called in a single threaded
environment and the mutex would not have prevented concurrent
access anyway.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2022-03-04 13:58:44 +01:00
parent 3d836f828a
commit 69d793a0bc

View File

@ -274,7 +274,6 @@ storageStateInitialize(bool privileged,
VIR_FREE(driver);
return VIR_DRV_STATE_INIT_ERROR;
}
storageDriverLock();
if (!(driver->pools = virStoragePoolObjListNew()))
goto error;
@ -330,12 +329,9 @@ storageStateInitialize(bool privileged,
if (!(driver->caps = virStorageBackendGetCapabilities()))
goto error;
storageDriverUnlock();
return VIR_DRV_STATE_INIT_COMPLETE;
error:
storageDriverUnlock();
storageStateCleanup();
return VIR_DRV_STATE_INIT_ERROR;
}
@ -376,8 +372,6 @@ storageStateCleanup(void)
if (!driver)
return -1;
storageDriverLock();
virObjectUnref(driver->caps);
virObjectUnref(driver->storageEventState);
@ -391,7 +385,6 @@ storageStateCleanup(void)
VIR_FREE(driver->configDir);
VIR_FREE(driver->autostartDir);
VIR_FREE(driver->stateDir);
storageDriverUnlock();
virMutexDestroy(&driver->lock);
VIR_FREE(driver);