aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@gmail.com>2011-10-03 01:02:59 -0400
committerJan Kara <jack@suse.cz>2011-10-05 18:13:48 -0400
commitbc1123239ab950798779ca4e23228afb5443eb5d (patch)
treedff5797bd23ba770621d6f5a358dc7142c4ab1b0 /fs/udf
parent3ee77f2091c229a72c64d9aeef1ee4a7624e5795 (diff)
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: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/inode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 1d1358ed80c1..f94d6f9febf5 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -37,6 +37,7 @@
37#include <linux/writeback.h> 37#include <linux/writeback.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/crc-itu-t.h> 39#include <linux/crc-itu-t.h>
40#include <linux/mpage.h>
40 41
41#include "udf_i.h" 42#include "udf_i.h"
42#include "udf_sb.h" 43#include "udf_sb.h"
@@ -104,7 +105,13 @@ static int udf_writepage(struct page *page, struct writeback_control *wbc)
104 105
105static int udf_readpage(struct file *file, struct page *page) 106static int udf_readpage(struct file *file, struct page *page)
106{ 107{
107 return block_read_full_page(page, udf_get_block); 108 return mpage_readpage(page, udf_get_block);
109}
110
111static int udf_readpages(struct file *file, struct address_space *mapping,
112 struct list_head *pages, unsigned nr_pages)
113{
114 return mpage_readpages(mapping, pages, nr_pages, udf_get_block);
108} 115}
109 116
110static int udf_write_begin(struct file *file, struct address_space *mapping, 117static 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 146
140const struct address_space_operations udf_aops = { 147const struct address_space_operations udf_aops = {
141 .readpage = udf_readpage, 148 .readpage = udf_readpage,
149 .readpages = udf_readpages,
142 .writepage = udf_writepage, 150 .writepage = udf_writepage,
143 .write_begin = udf_write_begin, 151 .write_begin = udf_write_begin,
144 .write_end = generic_write_end, 152 .write_end = generic_write_end,