iomap: move iomap_read_inline_data around
PATCH 1/1 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 <[email protected]>
--- fs/iomap.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
fs/iomap.c +20 -20
@@ -240,26 +240,6 @@ iomap_read_page_end_io(struct bio_vec *bvec, int error)iomap_read_finish (iop, page); } -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) {
@@ -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)
Signature · 1 line
2.20.1
Quoted 5 lines · Christoph Hellwig
iomap_read_inline_dataended 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 <[email protected]>
Makes sense.
Reviewed-by Dave Chinner <[email protected]>
Signature · 2 lines
Dave Chinner [email protected]
Quoted 5 lines · Christoph Hellwig
iomap_read_inline_dataended 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 <[email protected]>
Looks ok,
Reviewed-by Darrick J. Wong <[email protected]>
--D
Quoted 65 lines
--- fs/iomap.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)fs/iomap.c +20
-20@@ -240,26 +240,6 @@ iomap_read_page_end_io(struct bio_vec *bvec, int error)iomap_read_finish (iop, page); } -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) {@@ -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)Signature · 1 line
2.20.1