Commit bc112323 authored by Namjae Jeon's avatar Namjae Jeon Committed by Jan Kara

udf: Add readpages support for udf.

Use mpage_readpages() instead of multiple calls to udf_readpage() to reduce the
CPU utilization and make performance higher.
Signed-off-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 3ee77f20
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/crc-itu-t.h> #include <linux/crc-itu-t.h>
#include <linux/mpage.h>
#include "udf_i.h" #include "udf_i.h"
#include "udf_sb.h" #include "udf_sb.h"
...@@ -104,7 +105,13 @@ static int udf_writepage(struct page *page, struct writeback_control *wbc) ...@@ -104,7 +105,13 @@ static int udf_writepage(struct page *page, struct writeback_control *wbc)
static int udf_readpage(struct file *file, struct page *page) static int udf_readpage(struct file *file, struct page *page)
{ {
return block_read_full_page(page, udf_get_block); return mpage_readpage(page, udf_get_block);
}
static int udf_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
return mpage_readpages(mapping, pages, nr_pages, udf_get_block);
} }
static int udf_write_begin(struct file *file, struct address_space *mapping, static int udf_write_begin(struct file *file, struct address_space *mapping,
...@@ -139,6 +146,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block) ...@@ -139,6 +146,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block)
const struct address_space_operations udf_aops = { const struct address_space_operations udf_aops = {
.readpage = udf_readpage, .readpage = udf_readpage,
.readpages = udf_readpages,
.writepage = udf_writepage, .writepage = udf_writepage,
.write_begin = udf_write_begin, .write_begin = udf_write_begin,
.write_end = generic_write_end, .write_end = generic_write_end,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment