From: Chao Yu <yuchao0@huawei.com> To: <hch@infradead.org>, <darrick.wong@oracle.com> Cc: <linux-xfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>, <andreas.gruenbacher@gmail.com>, <gaoxiang25@huawei.com>, <chao@kernel.org>, Chao Yu <yuchao0@huawei.com> Subject: [RFC PATCH] iomap: generalize IOMAP_INLINE to cover tail-packing case Date: Wed, 3 Jul 2019 15:55:02 +0800 [thread overview] Message-ID: <20190703075502.79782-1-yuchao0@huawei.com> (raw) Some filesystems like erofs/reiserfs have the ability to pack tail data into metadata, e.g.: IOMAP_MAPPED [0, 8192] IOMAP_INLINE [8192, 8200] However current IOMAP_INLINE type has assumption that: - inline data should be locating at page #0. - inline size should equal to .i_size Those restriction fail to convert to use iomap IOMAP_INLINE in erofs, so this patch tries to relieve above limits to make IOMAP_INLINE more generic to cover tail-packing case. Signed-off-by: Chao Yu <yuchao0@huawei.com> --- fs/iomap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index 12654c2e78f8..d1c16b692d31 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -264,13 +264,12 @@ static void iomap_read_inline_data(struct inode *inode, struct page *page, struct iomap *iomap) { - size_t size = i_size_read(inode); + size_t size = iomap->length; void *addr; if (PageUptodate(page)) return; - BUG_ON(page->index); BUG_ON(size > PAGE_SIZE - offset_in_page(iomap->inline_data)); addr = kmap_atomic(page); @@ -293,7 +292,6 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, sector_t sector; if (iomap->type == IOMAP_INLINE) { - WARN_ON_ONCE(pos); iomap_read_inline_data(inode, page, iomap); return PAGE_SIZE; } -- 2.18.0.rc1
WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <yuchao0@huawei.com> To: hch@infradead.org, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, andreas.gruenbacher@gmail.com, gaoxiang25@huawei.com, chao@kernel.org, Chao Yu <yuchao0@huawei.com> Subject: [RFC PATCH] iomap: generalize IOMAP_INLINE to cover tail-packing case Date: Wed, 3 Jul 2019 15:55:02 +0800 [thread overview] Message-ID: <20190703075502.79782-1-yuchao0@huawei.com> (raw) Some filesystems like erofs/reiserfs have the ability to pack tail data into metadata, e.g.: IOMAP_MAPPED [0, 8192] IOMAP_INLINE [8192, 8200] However current IOMAP_INLINE type has assumption that: - inline data should be locating at page #0. - inline size should equal to .i_size Those restriction fail to convert to use iomap IOMAP_INLINE in erofs, so this patch tries to relieve above limits to make IOMAP_INLINE more generic to cover tail-packing case. Signed-off-by: Chao Yu <yuchao0@huawei.com> --- fs/iomap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index 12654c2e78f8..d1c16b692d31 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -264,13 +264,12 @@ static void iomap_read_inline_data(struct inode *inode, struct page *page, struct iomap *iomap) { - size_t size = i_size_read(inode); + size_t size = iomap->length; void *addr; if (PageUptodate(page)) return; - BUG_ON(page->index); BUG_ON(size > PAGE_SIZE - offset_in_page(iomap->inline_data)); addr = kmap_atomic(page); @@ -293,7 +292,6 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, sector_t sector; if (iomap->type == IOMAP_INLINE) { - WARN_ON_ONCE(pos); iomap_read_inline_data(inode, page, iomap); return PAGE_SIZE; } -- 2.18.0.rc1
next reply other threads:[~2019-07-03 7:55 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-03 7:55 Chao Yu [this message] 2019-07-03 7:55 ` [RFC PATCH] iomap: generalize IOMAP_INLINE to cover tail-packing case Chao Yu 2019-07-08 2:12 ` Chao Yu 2019-07-08 2:12 ` Chao Yu 2019-07-08 16:03 ` Christoph Hellwig 2019-07-09 13:52 ` Chao Yu 2019-07-09 23:32 ` Andreas Grünbacher 2019-07-10 10:30 ` Chao Yu 2019-07-10 10:30 ` Chao Yu 2019-07-10 21:50 ` Andreas Grünbacher 2019-07-10 23:42 ` Gao Xiang 2019-07-11 13:06 ` Matthew Wilcox 2019-07-11 13:54 ` Gao Xiang 2019-07-11 14:15 ` Chao Yu 2019-07-11 12:28 ` Andreas Gruenbacher 2019-07-12 9:31 ` Chao Yu 2019-07-12 9:31 ` Chao Yu 2019-07-12 11:54 ` Andreas Gruenbacher 2019-07-15 9:26 ` Chao Yu 2019-07-15 9:26 ` Chao Yu 2019-07-17 2:58 ` Chao Yu 2019-07-17 2:58 ` Chao Yu 2019-07-18 12:33 ` Christoph Hellwig 2019-07-18 12:31 ` Christoph Hellwig 2019-07-18 13:27 ` Gao Xiang 2019-07-18 13:27 ` Gao Xiang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190703075502.79782-1-yuchao0@huawei.com \ --to=yuchao0@huawei.com \ --cc=andreas.gruenbacher@gmail.com \ --cc=chao@kernel.org \ --cc=darrick.wong@oracle.com \ --cc=gaoxiang25@huawei.com \ --cc=hch@infradead.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-xfs@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.