提交 e136b327 编写于 作者: C Cole Robinson

storage: Rename UpdateVolInfoFlags to UpdateVolInfo

And drop the original UpdateVolInfo. Makes it a bit easier to follow
the function usage.

And change the int parameter to an explicit bool.

(cherry picked from commit 16d75d19)

Conflicts:
	src/storage/storage_backend.h
上级 edce4431
...@@ -1239,8 +1239,8 @@ virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target, ...@@ -1239,8 +1239,8 @@ virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target,
} }
int int
virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol, virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
int withCapacity, bool withCapacity,
unsigned int openflags) unsigned int openflags)
{ {
int ret; int ret;
...@@ -1260,13 +1260,6 @@ virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol, ...@@ -1260,13 +1260,6 @@ virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol,
return 0; return 0;
} }
int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
int withCapacity)
{
return virStorageBackendUpdateVolInfoFlags(vol, withCapacity,
VIR_STORAGE_VOL_OPEN_DEFAULT);
}
/* /*
* virStorageBackendUpdateVolTargetInfoFD: * virStorageBackendUpdateVolTargetInfoFD:
* @conn: connection to report errors on * @conn: connection to report errors on
......
...@@ -115,10 +115,7 @@ int virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb, ...@@ -115,10 +115,7 @@ int virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol, int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
int withCapacity); bool withCapacity,
int virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol,
int withCapacity,
unsigned int openflags); unsigned int openflags);
int virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target, int virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target,
unsigned long long *allocation, unsigned long long *allocation,
......
...@@ -115,7 +115,8 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool, ...@@ -115,7 +115,8 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
} }
/* Refresh allocation/capacity/perms */ /* Refresh allocation/capacity/perms */
if (virStorageBackendUpdateVolInfo(vol, 1) < 0) if (virStorageBackendUpdateVolInfo(vol, true,
VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
return -1; return -1;
/* set partition type */ /* set partition type */
......
...@@ -1164,7 +1164,7 @@ virStorageBackendFileSystemVolRefresh(virConnectPtr conn, ...@@ -1164,7 +1164,7 @@ virStorageBackendFileSystemVolRefresh(virConnectPtr conn,
int ret; int ret;
/* Refresh allocation / permissions info in case its changed */ /* Refresh allocation / permissions info in case its changed */
ret = virStorageBackendUpdateVolInfoFlags(vol, 0, ret = virStorageBackendUpdateVolInfo(vol, false,
VIR_STORAGE_VOL_FS_OPEN_FLAGS); VIR_STORAGE_VOL_FS_OPEN_FLAGS);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -136,7 +136,8 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool, ...@@ -136,7 +136,8 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
if (!vol->key && VIR_STRDUP(vol->key, groups[2]) < 0) if (!vol->key && VIR_STRDUP(vol->key, groups[2]) < 0)
goto cleanup; goto cleanup;
if (virStorageBackendUpdateVolInfo(vol, 1) < 0) if (virStorageBackendUpdateVolInfo(vol, true,
VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
goto cleanup; goto cleanup;
nextents = 1; nextents = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册