1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

activate: cache driver_version result

This commit is contained in:
Zdenek Kabelac 2021-12-08 10:25:02 +01:00
parent 26e6580dfb
commit 47ac2659d5

View File

@ -486,12 +486,20 @@ int library_version(char *version, size_t size)
int driver_version(char *version, size_t size)
{
static char _vsn[80] = { 0 };
if (!activation())
return 0;
log_very_verbose("Getting driver version");
return dm_driver_version(version, size);
if (!_vsn[0] &&
!dm_driver_version(_vsn, sizeof(_vsn)))
return_0;
(void) dm_strncpy(version, _vsn, size);
return 1;
}
int target_version(const char *target_name, uint32_t *maj,