Message ID | a4764c91c08c16d4d4a4b36defb2a08625b0e9b3.1582880246.git.riteshh@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ext4: bmap & fiemap conversion to use iomap | expand |
On Fri, Feb 28, 2020 at 02:56:54PM +0530, Ritesh Harjani wrote: > IOMAP_F_MERGED needs to be set in case of non-extent based mapping. > This is needed in later patches for conversion of ext4_fiemap to use iomap. > > Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> > Reviewed-by: Jan Kara <jack@suse.cz> Seems reasonable, Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> --D > --- > fs/ext4/inode.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index d035acab5b2a..6cf3b969dc86 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3335,6 +3335,10 @@ static void ext4_set_iomap(struct inode *inode, struct iomap *iomap, > iomap->offset = (u64) map->m_lblk << blkbits; > iomap->length = (u64) map->m_len << blkbits; > > + if ((map->m_flags & EXT4_MAP_MAPPED) && > + !ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) > + iomap->flags |= IOMAP_F_MERGED; > + > /* > * Flags passed to ext4_map_blocks() for direct I/O writes can result > * in m_flags having both EXT4_MAP_MAPPED and EXT4_MAP_UNWRITTEN bits > -- > 2.21.0 >
On Fri, Feb 28, 2020 at 02:56:54PM +0530, Ritesh Harjani wrote: > IOMAP_F_MERGED needs to be set in case of non-extent based mapping. > This is needed in later patches for conversion of ext4_fiemap to use iomap. > > Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> > Reviewed-by: Jan Kara <jack@suse.cz> Thanks, applied. - Ted
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index d035acab5b2a..6cf3b969dc86 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3335,6 +3335,10 @@ static void ext4_set_iomap(struct inode *inode, struct iomap *iomap, iomap->offset = (u64) map->m_lblk << blkbits; iomap->length = (u64) map->m_len << blkbits; + if ((map->m_flags & EXT4_MAP_MAPPED) && + !ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) + iomap->flags |= IOMAP_F_MERGED; + /* * Flags passed to ext4_map_blocks() for direct I/O writes can result * in m_flags having both EXT4_MAP_MAPPED and EXT4_MAP_UNWRITTEN bits