diff mbox

[3/3] iomap: add inline data support to iomap_readpage_actor

Message ID 20180702145458.22330-4-hch@lst.de (mailing list archive)
State Accepted
Headers show

Commit Message

Christoph Hellwig July 2, 2018, 2:54 p.m. UTC
From: Andreas Gruenbacher <agruenba@redhat.com>

Just copy the inline data into the page using the existing helper.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/iomap.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Darrick J. Wong July 3, 2018, 4:06 p.m. UTC | #1
On Mon, Jul 02, 2018 at 08:54:58AM -0600, Christoph Hellwig wrote:
> From: Andreas Gruenbacher <agruenba@redhat.com>
> 
> Just copy the inline data into the page using the existing helper.
> 
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/iomap.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/fs/iomap.c b/fs/iomap.c
> index 98a1fdd5c091..13cdcf33e6c0 100644
> --- a/fs/iomap.c
> +++ b/fs/iomap.c
> @@ -155,6 +155,12 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
>  	bool is_contig = false;
>  	sector_t sector;
>  
> +	if (iomap->type == IOMAP_INLINE) {
> +		WARN_ON_ONCE(poff);
> +		iomap_read_inline_data(inode, page, iomap);
> +		return PAGE_SIZE;
> +	}
> +
>  	/* we don't support blocksize < PAGE_SIZE quite yet. */
>  	WARN_ON_ONCE(pos != page_offset(page));
>  	WARN_ON_ONCE(plen != PAGE_SIZE);
> -- 
> 2.18.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/iomap.c b/fs/iomap.c
index 98a1fdd5c091..13cdcf33e6c0 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -155,6 +155,12 @@  iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
 	bool is_contig = false;
 	sector_t sector;
 
+	if (iomap->type == IOMAP_INLINE) {
+		WARN_ON_ONCE(poff);
+		iomap_read_inline_data(inode, page, iomap);
+		return PAGE_SIZE;
+	}
+
 	/* we don't support blocksize < PAGE_SIZE quite yet. */
 	WARN_ON_ONCE(pos != page_offset(page));
 	WARN_ON_ONCE(plen != PAGE_SIZE);