Skip to content

Commit 3069083

Browse files
namjaejeontorvalds
authored andcommitted
isofs: add readpages support
Use mpage_readpages() instead of multiple calls to isofs_readpage() to reduce the CPU utilization and make performance higher. Signed-off-by: Namjae Jeon <linkinjeon@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b6eb48d commit 3069083

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎fs/isofs/inode.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/statfs.h>
2121
#include <linux/cdrom.h>
2222
#include <linux/parser.h>
23+
#include <linux/mpage.h>
2324

2425
#include "isofs.h"
2526
#include "zisofs.h"
@@ -1148,7 +1149,13 @@ struct buffer_head *isofs_bread(struct inode *inode, sector_t block)
11481149

11491150
static int isofs_readpage(struct file *file, struct page *page)
11501151
{
1151-
return block_read_full_page(page,isofs_get_block);
1152+
return mpage_readpage(page, isofs_get_block);
1153+
}
1154+
1155+
static int isofs_readpages(struct file *file, struct address_space *mapping,
1156+
struct list_head *pages, unsigned nr_pages)
1157+
{
1158+
return mpage_readpages(mapping, pages, nr_pages, isofs_get_block);
11521159
}
11531160

11541161
static sector_t _isofs_bmap(struct address_space *mapping, sector_t block)
@@ -1158,6 +1165,7 @@ static sector_t _isofs_bmap(struct address_space *mapping, sector_t block)
11581165

11591166
static const struct address_space_operations isofs_aops = {
11601167
.readpage = isofs_readpage,
1168+
.readpages = isofs_readpages,
11611169
.bmap = _isofs_bmap
11621170
};
11631171

0 commit comments

Comments
 (0)