[PATCH] Use posix_fallocate instead of ftruncate.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 11:45:21 PDT 2016


On Tue, Jul 19, 2016 at 11:31 AM, Rafael EspĂ­ndola
<llvm-commits at lists.llvm.org> wrote:
> On 19 July 2016 at 13:11, Rui Ueyama <ruiu at google.com> wrote:
>> I have a concern about this change when it is used on a filesystem that
>> doesn't support file pre-allocation. The function should work on a
>> filesystem that doesn't support an underlying fallocate(-ish) system call,
>> but in that case I believe it tries to actually write data to force
>> allocation. In that case it'd be slow.
>
> It still seems better than crashing, no?
>

I definitely agree. LGTM. I'll also be surprised if the impact of this
switch will be significant.

> Which filesystems do you have in mind? I have a spare partition, so I
> should be able to test pretty much anything that linux supports. I
> will give HFS+ a try on OS X too.
>

NFS doesn't do preallocation, IIRC.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list