Re: [PATCH 1/2] block: file-posix: Extract preallocate helpers

2020-09-01 Thread Nir Soffer
On Tue, Sep 1, 2020 at 1:27 PM Alberto Garcia wrote: > > On Mon 31 Aug 2020 04:01:26 PM CEST, Nir Soffer wrote: > > +static int preallocate_falloc(int fd, int64_t current_length, int64_t > > offset, > > + Error **errp) > > +{ > > +#ifdef CONFIG_POSIX_FALLOCATE > > +

Re: [PATCH 1/2] block: file-posix: Extract preallocate helpers

2020-09-01 Thread Alberto Garcia
On Mon 31 Aug 2020 04:01:26 PM CEST, Nir Soffer wrote: > +static int preallocate_falloc(int fd, int64_t current_length, int64_t offset, > + Error **errp) > +{ > +#ifdef CONFIG_POSIX_FALLOCATE > +int result; > + > +if (offset == current_length) > +return

Re: [PATCH 1/2] block: file-posix: Extract preallocate helpers

2020-09-01 Thread Alberto Garcia
On Mon 31 Aug 2020 04:01:26 PM CEST, Nir Soffer wrote: > handle_aiocb_truncate() was too big and complex, implementing 3 > different preallocation modes. In a future patch I want to introduce a > fallback from "falloc" to "full"; it will be too messy and error prone > with the current code. > >

[PATCH 1/2] block: file-posix: Extract preallocate helpers

2020-08-31 Thread Nir Soffer
handle_aiocb_truncate() was too big and complex, implementing 3 different preallocation modes. In a future patch I want to introduce a fallback from "falloc" to "full"; it will be too messy and error prone with the current code. Extract a helper for each of the preallocation modes (falloc, full,