aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2010-05-25 15:06:06 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2010-05-25 15:06:06 +0200
commitb5dd328537edeb4c1d2e71e344b6c443e0874d90 (patch)
treed4f4ec21ce2cd4bdeb596776dc28552789b65845 /fs/fuse
parentfuse: use get_user_pages_fast() (diff)
downloadlinux-dev-b5dd328537edeb4c1d2e71e344b6c443e0874d90.tar.xz
linux-dev-b5dd328537edeb4c1d2e71e344b6c443e0874d90.zip
fuse: get page reference for readpages
Acquire a page ref on pages in ->readpages() and release them when the read has finished. Not acquiring a reference didn't seem to cause any trouble since the page is locked and will not be kicked out of the page cache during the read. However the following patches will want to remove the page from the cache so a separate ref is needed. Making the reference in req->pages explicit also makes the code easier to understand. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 29bda0564e69..9ca68edcbdbe 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -536,6 +536,7 @@ static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req)
else
SetPageError(page);
unlock_page(page);
+ page_cache_release(page);
}
if (req->ff)
fuse_file_put(req->ff);
@@ -589,6 +590,7 @@ static int fuse_readpages_fill(void *_data, struct page *page)
return PTR_ERR(req);
}
}
+ page_cache_get(page);
req->pages[req->num_pages] = page;
req->num_pages++;
return 0;