Skip to contentSkip to conversation

udf : add readpages support for udf.

PATCH In review Namjae Jeon 2 participants 3 messages Oct 3, 2011 – Oct 6, 2011 UDF filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 udf : add readpages support for udf.

Using mpage_readpages instead of multiple calls to udf_readpage to reduce the CPU utilization and make performance higher.

---
 fs/udf/inode.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
fs/udf/inode.c +9 -1
index 58665ce..81f9ce1 100644
@@ -37,6 +37,7 @@
 #include <linux/writeback.h>
 #include <linux/slab.h>
 #include <linux/crc-itu-t.h>
+#include <linux/mpage.h>
 
 #include "udf_i.h"
 #include "udf_sb.h"
@@ -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)
 {
-	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,
@@ -139,6 +146,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block)
 
 const struct address_space_operations udf_aops = {
 	.readpage	= udf_readpage,
+	.readpages	= udf_readpages,
 	.writepage	= udf_writepage,
 	.write_begin		= udf_write_begin,
 	.write_end		= generic_write_end,
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 1 line · Namjae Jeon

Using mpage_readpages instead of multiple calls to udf_readpage to reduce the CPU utilization and make performance higher.

Thanks. I've merged this patch.

Honza

Quoted 44 lines
---
 fs/udf/inode.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
fs/udf/inode.c +9 -1
index 58665ce..81f9ce1 100644
@@ -37,6 +37,7 @@
 #include <linux/writeback.h>
 #include <linux/slab.h>
 #include <linux/crc-itu-t.h>
+#include <linux/mpage.h>
 
 #include "udf_i.h"
 #include "udf_sb.h"
@@ -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)
 {
-	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,
@@ -139,6 +146,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block)
 
 const struct address_space_operations udf_aops = {
 	.readpage	= udf_readpage,
+	.readpages	= udf_readpages,
 	.writepage	= udf_writepage,
 	.write_begin		= udf_write_begin,
 	.write_end		= generic_write_end,
Signature · 1 line
1.7.4.4
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#2 lore raw

2011/10/6 Jan Kara <[email protected]>:

Quoted 3 lines · Namjae Jeon
Quoted 1 line

Using mpage_readpages instead of multiple calls to udf_readpage to reduce the CPU utilization and make performance higher.

 Thanks. I've merged this patch.

Hi. Jan.
this patch is created by the second from [PATCH 1/2 v3] udf : enable error print in udf_read_tagged().
So if hunk or problem happen, plz inform me it.
Thanks a lot.

Quoted 50 lines

                                                                       Honza

Quoted 42 lines

---
 fs/udf/inode.c |   10 +++++++++-

 1 files changed, 9 insertions(+), 1 deletions(-)
fs/udf/inode.c +9 -2
index 58665ce..81f9ce1 100644
@@ -37,6 +37,7 @@
  #include <linux/writeback.h>
  #include <linux/slab.h>
  #include <linux/crc-itu-t.h>
+#include <linux/mpage.h>
 
  #include "udf_i.h"
  #include "udf_sb.h"
@@ -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)
  {
-     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,
@@ -139,6 +146,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block)
 
  const struct address_space_operations udf_aops = {
       .readpage       = udf_readpage,
+     .readpages      = udf_readpages,
       .writepage      = udf_writepage,
       .write_begin            = udf_write_begin,
       .write_end              = generic_write_end,
--
Quoted 2 lines

1.7.4.4

--
Jan Kara <[email protected]>
SUSE Labs, CR