diff options
author | Christoph Hellwig <hch@lst.de> | 2019-05-01 20:16:40 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-05-01 20:16:40 -0700 |
commit | cbbf4c0be8a725f08153949f45a85b2adafbbbd3 (patch) | |
tree | a5d712b1c476009f75b49b0f4ebfb4d9a67b6ec3 /fs/iomap.c | |
parent | df0db3ecdb8fc942e9d812558b8e15ecd3e050b1 (diff) |
iomap: move iomap_read_inline_data around
iomap_read_inline_data ended up being placed in the middle of the bio
based read I/O completion handling, which tends to confuse the heck out
of me whenever I follow the code. Move it to a more suitable place.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/iomap.c')
-rw-r--r-- | fs/iomap.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/iomap.c b/fs/iomap.c index fbfe20b7f6f0..9ef049d61e8a 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -241,26 +241,6 @@ iomap_read_page_end_io(struct bio_vec *bvec, int error) } static void -iomap_read_inline_data(struct inode *inode, struct page *page, - struct iomap *iomap) -{ - size_t size = i_size_read(inode); - 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); - memcpy(addr, iomap->inline_data, size); - memset(addr + size, 0, PAGE_SIZE - size); - kunmap_atomic(addr); - SetPageUptodate(page); -} - -static void iomap_read_end_io(struct bio *bio) { int error = blk_status_to_errno(bio->bi_status); @@ -281,6 +261,26 @@ struct iomap_readpage_ctx { struct list_head *pages; }; +static void +iomap_read_inline_data(struct inode *inode, struct page *page, + struct iomap *iomap) +{ + size_t size = i_size_read(inode); + 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); + memcpy(addr, iomap->inline_data, size); + memset(addr + size, 0, PAGE_SIZE - size); + kunmap_atomic(addr); + SetPageUptodate(page); +} + static loff_t iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, struct iomap *iomap) |