bool pre_allocate = flags & VIR_STORAGE_VOL_RESIZE_ALLOCATE;
if (vol->target.format == VIR_STORAGE_FILE_RAW) {
- return virStorageFileResize(vol->target.path, capacity,
- vol->target.allocation, pre_allocate);
+ return virStorageFileResize(vol->target.path, capacity, pre_allocate);
} else if (vol->target.format == VIR_STORAGE_FILE_PLOOP) {
return storagePloopResize(vol, capacity);
} else {
int
virStorageFileResize(const char *path,
unsigned long long capacity,
- unsigned long long orig_capacity,
bool pre_allocate)
{
int fd = -1;
int ret = -1;
int rc;
- off_t offset ATTRIBUTE_UNUSED;
- off_t len ATTRIBUTE_UNUSED;
-
- offset = orig_capacity;
- len = capacity - orig_capacity;
if ((fd = open(path, O_RDWR)) < 0) {
virReportSystemError(errno, _("Unable to open '%s'"), path);
}
if (pre_allocate) {
- if ((rc = virFileAllocate(fd, offset, len)) != 0) {
+ if ((rc = virFileAllocate(fd, 0, capacity)) != 0) {
if (rc == -2) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("preallocate is not supported on this platform"));
int virStorageFileResize(const char *path,
unsigned long long capacity,
- unsigned long long orig_capacity,
bool pre_allocate);
int virStorageFileIsClusterFS(const char *path);