* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-04-07 5:09 ` [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate Davide Italiano
@ 2015-04-20 20:49 ` Davide Italiano
2015-06-25 17:55 ` Davide Italiano
2015-06-26 3:35 ` Liu Bo
2015-06-26 14:08 ` David Sterba
2 siblings, 1 reply; 9+ messages in thread
From: Davide Italiano @ 2015-04-20 20:49 UTC (permalink / raw)
To: linux-btrfs; +Cc: Davide Italiano
On Mon, Apr 6, 2015 at 10:09 PM, Davide Italiano <dccitaliano@gmail.com> wrote:
> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
> - As an optimisation we can skip the call if (off + len)
> isn't greater than the current size of the file. This operation
> is called under the lock so the less work we do, the better.
> - If we call inode_size_ok() pass to it the correct value rather
> than a more conservative estimation.
>
> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
> ---
> fs/btrfs/file.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index 30982bb..f649bfc 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -2586,9 +2586,13 @@ static long btrfs_fallocate(struct file *file, int mode,
> }
>
> mutex_lock(&inode->i_mutex);
> - ret = inode_newsize_ok(inode, alloc_end);
> - if (ret)
> - goto out;
> +
> + if (!(mode & FALLOC_FL_KEEP_SIZE) &&
> + offset + len > inode->i_size) {
> + ret = inode_newsize_ok(inode, offset + len);
> + if (ret)
> + goto out;
> + }
>
> if (alloc_start > inode->i_size) {
> ret = btrfs_cont_expand(inode, i_size_read(inode),
> --
> 2.3.4
>
Any comment on this?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-04-20 20:49 ` Davide Italiano
@ 2015-06-25 17:55 ` Davide Italiano
0 siblings, 0 replies; 9+ messages in thread
From: Davide Italiano @ 2015-06-25 17:55 UTC (permalink / raw)
To: linux-btrfs; +Cc: Davide Italiano
On Mon, Apr 20, 2015 at 1:49 PM, Davide Italiano <dccitaliano@gmail.com> wrote:
> On Mon, Apr 6, 2015 at 10:09 PM, Davide Italiano <dccitaliano@gmail.com> wrote:
>> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
>> - As an optimisation we can skip the call if (off + len)
>> isn't greater than the current size of the file. This operation
>> is called under the lock so the less work we do, the better.
>> - If we call inode_size_ok() pass to it the correct value rather
>> than a more conservative estimation.
>>
>> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
>> ---
>> fs/btrfs/file.c | 10 +++++++---
>> 1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
>> index 30982bb..f649bfc 100644
>> --- a/fs/btrfs/file.c
>> +++ b/fs/btrfs/file.c
>> @@ -2586,9 +2586,13 @@ static long btrfs_fallocate(struct file *file, int mode,
>> }
>>
>> mutex_lock(&inode->i_mutex);
>> - ret = inode_newsize_ok(inode, alloc_end);
>> - if (ret)
>> - goto out;
>> +
>> + if (!(mode & FALLOC_FL_KEEP_SIZE) &&
>> + offset + len > inode->i_size) {
>> + ret = inode_newsize_ok(inode, offset + len);
>> + if (ret)
>> + goto out;
>> + }
>>
>> if (alloc_start > inode->i_size) {
>> ret = btrfs_cont_expand(inode, i_size_read(inode),
>> --
>> 2.3.4
>>
>
> Any comment on this?
Very gentle ping after couple of months.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-04-07 5:09 ` [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate Davide Italiano
2015-04-20 20:49 ` Davide Italiano
@ 2015-06-26 3:35 ` Liu Bo
2015-06-26 14:08 ` David Sterba
2 siblings, 0 replies; 9+ messages in thread
From: Liu Bo @ 2015-06-26 3:35 UTC (permalink / raw)
To: Davide Italiano; +Cc: linux-btrfs
On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote:
> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
> - As an optimisation we can skip the call if (off + len)
> isn't greater than the current size of the file. This operation
> is called under the lock so the less work we do, the better.
> - If we call inode_size_ok() pass to it the correct value rather
> than a more conservative estimation.
Looks good.
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
>
> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
> ---
> fs/btrfs/file.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index 30982bb..f649bfc 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -2586,9 +2586,13 @@ static long btrfs_fallocate(struct file *file, int mode,
> }
>
> mutex_lock(&inode->i_mutex);
> - ret = inode_newsize_ok(inode, alloc_end);
> - if (ret)
> - goto out;
> +
> + if (!(mode & FALLOC_FL_KEEP_SIZE) &&
> + offset + len > inode->i_size) {
> + ret = inode_newsize_ok(inode, offset + len);
> + if (ret)
> + goto out;
> + }
>
> if (alloc_start > inode->i_size) {
> ret = btrfs_cont_expand(inode, i_size_read(inode),
> --
> 2.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-04-07 5:09 ` [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate Davide Italiano
2015-04-20 20:49 ` Davide Italiano
2015-06-26 3:35 ` Liu Bo
@ 2015-06-26 14:08 ` David Sterba
2015-07-22 17:45 ` Davide Italiano
2 siblings, 1 reply; 9+ messages in thread
From: David Sterba @ 2015-06-26 14:08 UTC (permalink / raw)
To: Davide Italiano; +Cc: linux-btrfs
On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote:
> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
> - As an optimisation we can skip the call if (off + len)
> isn't greater than the current size of the file. This operation
> is called under the lock so the less work we do, the better.
> - If we call inode_size_ok() pass to it the correct value rather
> than a more conservative estimation.
>
> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-06-26 14:08 ` David Sterba
@ 2015-07-22 17:45 ` Davide Italiano
2015-10-21 17:16 ` Davide Italiano
0 siblings, 1 reply; 9+ messages in thread
From: Davide Italiano @ 2015-07-22 17:45 UTC (permalink / raw)
To: Davide Italiano, linux-btrfs, clm
On Fri, Jun 26, 2015 at 7:08 AM, David Sterba <dsterba@suse.cz> wrote:
> On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote:
>> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
>> - As an optimisation we can skip the call if (off + len)
>> isn't greater than the current size of the file. This operation
>> is called under the lock so the less work we do, the better.
>> - If we call inode_size_ok() pass to it the correct value rather
>> than a more conservative estimation.
>>
>> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
>
> Reviewed-by: David Sterba <dsterba@suse.cz>
Hi Chris, this has been around for a while and it's been reviewed by
multiple people. Any chances you can pull in your branch?
Thanks,
--
Davide
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-07-22 17:45 ` Davide Italiano
@ 2015-10-21 17:16 ` Davide Italiano
2016-03-17 14:29 ` David Sterba
0 siblings, 1 reply; 9+ messages in thread
From: Davide Italiano @ 2015-10-21 17:16 UTC (permalink / raw)
To: Davide Italiano, linux-btrfs, Chris Mason, dsterba, bo.li.liu
On Wed, Jul 22, 2015 at 10:45 AM, Davide Italiano <dccitaliano@gmail.com> wrote:
> On Fri, Jun 26, 2015 at 7:08 AM, David Sterba <dsterba@suse.cz> wrote:
>> On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote:
>>> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
>>> - As an optimisation we can skip the call if (off + len)
>>> isn't greater than the current size of the file. This operation
>>> is called under the lock so the less work we do, the better.
>>> - If we call inode_size_ok() pass to it the correct value rather
>>> than a more conservative estimation.
>>>
>>> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
>>
>> Reviewed-by: David Sterba <dsterba@suse.cz>
>
> Hi Chris, this has been around for a while and it's been reviewed by
> multiple people. Any chances you can pull in your branch?
>
> Thanks,
>
> --
> Davide
Any chance to get this in?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Btrfs: Improve FL_KEEP_SIZE handling in fallocate.
2015-10-21 17:16 ` Davide Italiano
@ 2016-03-17 14:29 ` David Sterba
0 siblings, 0 replies; 9+ messages in thread
From: David Sterba @ 2016-03-17 14:29 UTC (permalink / raw)
To: Davide Italiano; +Cc: linux-btrfs, Chris Mason, dsterba, bo.li.liu
On Wed, Oct 21, 2015 at 10:16:46AM -0700, Davide Italiano wrote:
> On Wed, Jul 22, 2015 at 10:45 AM, Davide Italiano <dccitaliano@gmail.com> wrote:
> > On Fri, Jun 26, 2015 at 7:08 AM, David Sterba <dsterba@suse.cz> wrote:
> >> On Mon, Apr 06, 2015 at 10:09:15PM -0700, Davide Italiano wrote:
> >>> - We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
> >>> - As an optimisation we can skip the call if (off + len)
> >>> isn't greater than the current size of the file. This operation
> >>> is called under the lock so the less work we do, the better.
> >>> - If we call inode_size_ok() pass to it the correct value rather
> >>> than a more conservative estimation.
> >>>
> >>> Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
> >>
> >> Reviewed-by: David Sterba <dsterba@suse.cz>
> >
> > Hi Chris, this has been around for a while and it's been reviewed by
> > multiple people. Any chances you can pull in your branch?
I'm adding this patch to my for-next, sorry for late response.
^ permalink raw reply [flat|nested] 9+ messages in thread