[block] use lseek to size a new block file rather than fallocate.

Which sadly returned operation not supported for some reason.
This commit is contained in:
Joe Thornber 2013-01-15 04:06:57 +00:00
parent cfdc233fa4
commit 0455cfbf13

View File

@ -85,9 +85,11 @@ namespace {
} }
int fd = open_file(path, O_CREAT | O_RDWR); int fd = open_file(path, O_CREAT | O_RDWR);
int r = ::fallocate(fd, 0, 0, file_size);
// fallocate didn't seem to work
int r = ::lseek(fd, file_size, SEEK_SET);
if (r < 0) if (r < 0)
syscall_failed("fallocate"); syscall_failed("lseek");
return fd; return fd;
} }