commit | 40f8298cd252157fa15d93f8eb470116a94069a0 | [log] [tgz] |
---|---|---|
author | Jens Axboe <jens.axboe@oracle.com> | Wed Oct 25 11:21:05 2006 +0200 |
committer | Jens Axboe <jens.axboe@oracle.com> | Wed Oct 25 11:21:05 2006 +0200 |
tree | 7b6bf2d576dbafcbdcdf7ca6a31cd69ce4b74d0d | |
parent | 71bfa161f13b6fca98ba215ebebbcb5c99003d24 [diff] [blame] |
[PATCH] Use posix_fallocate() to force file layout Dunno how well this works on all filesystems, but at least it's a good hint to send wrt fragmentation and layout. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/filesetup.c b/filesetup.c index 52d822a..0b95640 100644 --- a/filesetup.c +++ b/filesetup.c
@@ -44,6 +44,11 @@ goto err; } + if (posix_fallocate(f->fd, 0, f->file_size) < 0) { + td_verror(td, errno); + goto err; + } + b = malloc(td->max_bs); memset(b, 0, td->max_bs);