Re: [RFCv2 4/4] ext4: Move ext4_fiemap to use iomap infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 28, 2020 at 03:48:28PM +0530, Ritesh Harjani wrote:
> Since ext4 already defines necessary iomap_ops required to move to iomap
> for fiemap, so this patch makes those changes to use existing iomap_ops
> for ext4_fiemap and thus removes all unwanted code.
> 
> Signed-off-by: Ritesh Harjani <riteshh@xxxxxxxxxxxxx>
> ---
>  fs/ext4/extents.c | 279 +++++++---------------------------------------
>  fs/ext4/inline.c  |  41 -------
>  2 files changed, 38 insertions(+), 282 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 0de548bb3c90..901caee2fcb1 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c

<snip> Just a cursory glance...

> @@ -5130,40 +4927,42 @@ static int ext4_xattr_fiemap(struct inode *inode,
>  				EXT4_I(inode)->i_extra_isize;
>  		physical += offset;
>  		length = EXT4_SB(inode->i_sb)->s_inode_size - offset;
> -		flags |= FIEMAP_EXTENT_DATA_INLINE;
>  		brelse(iloc.bh);
>  	} else { /* external block */
>  		physical = (__u64)EXT4_I(inode)->i_file_acl << blockbits;
>  		length = inode->i_sb->s_blocksize;
>  	}
>  
> -	if (physical)
> -		error = fiemap_fill_next_extent(fieinfo, 0, physical,
> -						length, flags);
> -	return (error < 0 ? error : 0);
> +	iomap->addr = physical;
> +	iomap->offset = 0;
> +	iomap->length = length;
> +	iomap->type = IOMAP_INLINE;
> +	iomap->flags = 0;

Er... external "ACL" blocks aren't IOMAP_INLINE.

--D



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux