[<prev] [next>] [day] [month] [year] [list]
Message-Id: <E1OyQId-0004Q4-CT@pomaz-ex.szeredi.hu>
Date: Wed, 22 Sep 2010 16:27:55 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: linux-kernel@...r.kernel.org
Subject: [PATCH] fuse: use release_pages()
From: Miklos Szeredi <mszeredi@...e.cz>
Replace iterated page_cache_release() with release_pages(), which is
faster and shorter.
Needs release_pages() to be exported to modules.
Suggested-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
---
fs/fuse/dev.c | 7 +------
mm/swap.c | 1 +
2 files changed, 2 insertions(+), 6 deletions(-)
Index: linux-2.6/fs/fuse/dev.c
===================================================================
--- linux-2.6.orig/fs/fuse/dev.c 2010-09-22 16:14:36.000000000 +0200
+++ linux-2.6/fs/fuse/dev.c 2010-09-22 16:14:49.000000000 +0200
@@ -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,
Index: linux-2.6/mm/swap.c
===================================================================
--- linux-2.6.orig/mm/swap.c 2010-08-06 13:58:19.000000000 +0200
+++ linux-2.6/mm/swap.c 2010-09-22 16:15:55.000000000 +0200
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists