-
由 Eric Blake 提交于
We are calling fstat() at least twice per storage volume in a directory storage pool; this is rather wasteful. Refactoring this is also a step towards making code reusable for gluster, where gluster can provide struct stat but cannot use fstat(). * src/storage/storage_backend.h (virStorageBackendVolOpenCheckMode) (virStorageBackendUpdateVolTargetInfoFD): Update signature. * src/storage/storage_backend.c (virStorageBackendVolOpenCheckMode): Pass stat results back. (virStorageBackendUpdateVolTargetInfoFD): Use existing stats. (virStorageBackendVolOpen, virStorageBackendUpdateVolTargetInfo): Update callers. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Likewise. * src/storage/storage_backend_scsi.c (virStorageBackendSCSIUpdateVolTargetInfo): Likewise. * src/storage/storage_backend_mpath.c (virStorageBackendMpathUpdateVolTargetInfo): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
9cac8639