diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2010-10-27 18:34:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-27 21:03:17 -0400 |
commit | 0be8557bcd34887d5a42c01c5659cab5ecf99f13 (patch) | |
tree | 80d211221be1583303818cf201d6e40cc0674608 | |
parent | d57af9b2142f31a39dcfdeb30776baadfc802827 (diff) |
fuse: use release_pages()
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@linux-foundation.org>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/fuse/dev.c | 7 | ||||
-rw-r--r-- | mm/swap.c | 1 |
2 files changed, 2 insertions, 6 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index b98664275f02..6e07696308dc 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -1334,12 +1334,7 @@ out_finish: | |||
1334 | 1334 | ||
1335 | static void fuse_retrieve_end(struct fuse_conn *fc, struct fuse_req *req) | 1335 | static void fuse_retrieve_end(struct fuse_conn *fc, struct fuse_req *req) |
1336 | { | 1336 | { |
1337 | int i; | 1337 | release_pages(req->pages, req->num_pages, 0); |
1338 | |||
1339 | for (i = 0; i < req->num_pages; i++) { | ||
1340 | struct page *page = req->pages[i]; | ||
1341 | page_cache_release(page); | ||
1342 | } | ||
1343 | } | 1338 | } |
1344 | 1339 | ||
1345 | static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, | 1340 | static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, |
@@ -378,6 +378,7 @@ void release_pages(struct page **pages, int nr, int cold) | |||
378 | 378 | ||
379 | pagevec_free(&pages_to_free); | 379 | pagevec_free(&pages_to_free); |
380 | } | 380 | } |
381 | EXPORT_SYMBOL(release_pages); | ||
381 | 382 | ||
382 | /* | 383 | /* |
383 | * The pages which we're about to release may be in the deferred lru-addition | 384 | * The pages which we're about to release may be in the deferred lru-addition |