ext4 crypto: add ext4_mpage_readpages()

This takes code from fs/mpage.c and optimizes it for ext4.  Its
primary reason is to allow us to more easily add encryption to ext4's
read path in an efficient manner.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o 2015-04-08 00:00:32 -04:00
parent e12fb97222
commit f64e02fe9b
4 changed files with 271 additions and 3 deletions

View file

@ -2820,7 +2820,7 @@ static int ext4_readpage(struct file *file, struct page *page)
ret = ext4_readpage_inline(inode, page);
if (ret == -EAGAIN)
return mpage_readpage(page, ext4_get_block);
return ext4_mpage_readpages(page->mapping, NULL, page, 1);
return ret;
}
@ -2835,7 +2835,7 @@ ext4_readpages(struct file *file, struct address_space *mapping,
if (ext4_has_inline_data(inode))
return 0;
return mpage_readpages(mapping, pages, nr_pages, ext4_get_block);
return ext4_mpage_readpages(mapping, pages, NULL, nr_pages);
}
static void ext4_invalidatepage(struct page *page, unsigned int offset,