Skip to contentSkip to conversation

fuse: use release_pages()

PATCH New Miklos Szeredi 1 participant 1 message Sep 22, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Miklos Szeredi

author maintainer
#1 lore raw

PATCH 1/1 fuse: use release_pages()

From: Miklos Szeredi <[email protected]>

Replace iterated page_cache_release() with release_pages(), which is faster and shorter.

Needs release_pages() to be exported to modules.

---
 fs/fuse/dev.c |    7 +------
 mm/swap.c     |    1 +
 2 files changed, 2 insertions(+), 6 deletions(-)
fs/fuse/dev.c +1 -6
Index: linux-2.6/fs/fuse/dev.c
===================================================================
@@ -1336,12 +1336,7 @@ out_finish:
 
 static void fuse_retrieve_end(struct fuse_conn *fc, struct fuse_req *req)
 {
-	int i;
-
-	for (i = 0; i < req->num_pages; i++) {
-		struct page *page = req->pages[i];
-		page_cache_release(page);
-	}
+	release_pages(req->pages, req->num_pages, 0);
 }
 
 static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
mm/swap.c +1 -0
Index: linux-2.6/mm/swap.c
===================================================================
@@ -378,6 +378,7 @@ void release_pages(struct page **pages,
 
 	pagevec_free(&pages_to_free);
 }
+EXPORT_SYMBOL(release_pages);
 
 /*
  * The pages which we're about to release may be in the deferred lru-addition