On 25.10.2017 17:59, fdman...@kernel.org wrote:
> From: Filipe Manana <fdman...@suse.com>
> 
> This implements support the zero range operation of fallocate. For now
> at least it's as simple as possible while reusing most of the existing
> fallocate and hole punching infrastructure.
> 
> Signed-off-by: Filipe Manana <fdman...@suse.com>
> ---
> 
> V2: Removed double inode unlock on error path from failure to lock range.
> 
>  fs/btrfs/file.c | 332 
> +++++++++++++++++++++++++++++++++++++++++++++++++-------
>  1 file changed, 290 insertions(+), 42 deletions(-)
> 
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index aafcc785f840..e0d15c0d1641 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -2448,7 +2448,48 @@ static int find_first_non_hole(struct inode *inode, 
> u64 *start, u64 *len)
>       return ret;
>  }
>  

<snip>

>  
> +static int btrfs_zero_range_update_isize(struct inode *inode,
> +                                      const loff_t offset,
> +                                      const loff_t len,
> +                                      const int mode)
> +{
> +     struct btrfs_root *root = BTRFS_I(inode)->root;
> +     struct btrfs_trans_handle *trans;
> +     const u64 end = offset + len;
> +     int ret;
> +
> +     if (mode & FALLOC_FL_KEEP_SIZE || end <= i_size_read(inode))
> +             return 0;
> +

Don't we also want to add inode->i_ctime = current_time(inode) similar
to what we have when updating the isize at the end of btrfs_fallocate
and __btrfs_prealloc_file_range


Also this function is very similarto the code right before the
'out_unlock' label in btrfs_fallocate. Perhaps this function could be
named btrfs_update_isize and used there as well?

<snip>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to