Thread (14 messages) 14 messages, 4 authors, 2017-09-14

Re: [PATCH 3/4] ext4: Add iomap support for inline data

From: Jan Kara <jack@suse.cz>
Date: 2017-08-30 13:03:33
Also in: linux-fsdevel, linux-xfs

On Tue 29-08-17 16:29:41, Andreas Gruenbacher wrote:
Report inline data as an IOMAP_F_DATA_INLINE mapping.  This allows to
switch to iomap_seek_hole and iomap_seek_data in ext4_llseek, and will
make switching to iomap_fiemap in ext4_fiemap easier as well.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
...
quoted hunk ↗ jump to hunk
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 429f0afde9f2..ab6ab835255e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3411,8 +3411,14 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 	struct ext4_map_blocks map;
 	int ret;
 
-	if (WARN_ON_ONCE(ext4_has_inline_data(inode)))
-		return -ERANGE;
+	if ((flags & IOMAP_REPORT) && ext4_has_inline_data(inode)) {
+		ret = ext4_inline_data_iomap(inode, iomap);
+		if (ret != -ENOENT) {
+			if (ret == 0 && offset >= iomap->length)
+				ret = -ENOENT;
+			return ret;
+		}
+	}
One more thing: Please keep that WARN_ON and bail out for !IOMAP_REPORT
cases. Thanks!

								Honza

-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help