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

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

 



Hello Darrick,

On 1/28/20 8:58 PM, Darrick J. Wong wrote:
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.

Sorry, I should have mentioned about this too in the cover letter.
So current patchset is mainly only converting bmap & fiemap to use iomap APIs. Even the original implementation does not have external ACL block
implemented for xattr_fiemap.

Let me spend some time to implement it. But I would still like to keep
that as a separate patch.

But thanks for looking into it. There's this point 2.a & 2.b mentioned in the cover letter where I could really use your help in understanding
if all of that is a known behavior from iomap_fiemap side
(whenever you have some time of course :) )

-ritesh




[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