summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
aa31f1f)
Don't truncate files if we don't need to extend them.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
+ if (!new_layout)
+ goto done;
+
if (ftruncate(f->fd, f->real_file_size) == -1) {
td_verror(td, errno, "ftruncate");
goto err;
}
if (ftruncate(f->fd, f->real_file_size) == -1) {
td_verror(td, errno, "ftruncate");
goto err;
}
- if (!new_layout)
- goto done;
-
if (posix_fallocate(f->fd, 0, f->real_file_size) < 0) {
td_verror(td, errno, "posix_fallocate");
goto err;
if (posix_fallocate(f->fd, 0, f->real_file_size) < 0) {
td_verror(td, errno, "posix_fallocate");
goto err;