aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-09 13:37:43 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-09 15:17:28 -0400
commitd1182b33ed9b62470cb6ab892a8a301542120086 (patch)
treebb300d0801aeb873ae6d74fcf93deafdc993305a /fs/nfs
parent3aff4ebb95b20ad8db2c1447e8c52097d89af5a7 (diff)
NFS: nfs_set_page_writeback no longer needs to reference the page
We now hold a reference to the nfs_page across the calls to nfs_set_page_writeback and nfs_end_page_writeback, and that means we already have a reference to the struct page. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/write.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index fd36b31ee72e..83823294ffd2 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -230,7 +230,6 @@ static int nfs_set_page_writeback(struct page *page)
230 struct inode *inode = page->mapping->host; 230 struct inode *inode = page->mapping->host;
231 struct nfs_server *nfss = NFS_SERVER(inode); 231 struct nfs_server *nfss = NFS_SERVER(inode);
232 232
233 page_cache_get(page);
234 if (atomic_long_inc_return(&nfss->writeback) > 233 if (atomic_long_inc_return(&nfss->writeback) >
235 NFS_CONGESTION_ON_THRESH) { 234 NFS_CONGESTION_ON_THRESH) {
236 set_bdi_congested(&nfss->backing_dev_info, 235 set_bdi_congested(&nfss->backing_dev_info,
@@ -246,7 +245,6 @@ static void nfs_end_page_writeback(struct page *page)
246 struct nfs_server *nfss = NFS_SERVER(inode); 245 struct nfs_server *nfss = NFS_SERVER(inode);
247 246
248 end_page_writeback(page); 247 end_page_writeback(page);
249 page_cache_release(page);
250 if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) 248 if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH)
251 clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC); 249 clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC);
252} 250}
@@ -607,13 +605,12 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
607 nfs_init_cinfo_from_inode(&cinfo, hdr->inode); 605 nfs_init_cinfo_from_inode(&cinfo, hdr->inode);
608 while (!list_empty(&hdr->pages)) { 606 while (!list_empty(&hdr->pages)) {
609 struct nfs_page *req = nfs_list_entry(hdr->pages.next); 607 struct nfs_page *req = nfs_list_entry(hdr->pages.next);
610 struct page *page = req->wb_page;
611 608
612 bytes += req->wb_bytes; 609 bytes += req->wb_bytes;
613 nfs_list_remove_request(req); 610 nfs_list_remove_request(req);
614 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && 611 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&
615 (hdr->good_bytes < bytes)) { 612 (hdr->good_bytes < bytes)) {
616 nfs_set_pageerror(page); 613 nfs_set_pageerror(req->wb_page);
617 nfs_context_set_write_error(req->wb_context, hdr->error); 614 nfs_context_set_write_error(req->wb_context, hdr->error);
618 goto remove_req; 615 goto remove_req;
619 } 616 }
@@ -629,7 +626,7 @@ remove_req:
629 nfs_inode_remove_request(req); 626 nfs_inode_remove_request(req);
630next: 627next:
631 nfs_unlock_request_dont_release(req); 628 nfs_unlock_request_dont_release(req);
632 nfs_end_page_writeback(page); 629 nfs_end_page_writeback(req->wb_page);
633 nfs_release_request(req); 630 nfs_release_request(req);
634 } 631 }
635out: 632out:
@@ -1040,11 +1037,9 @@ static int nfs_do_multiple_writes(struct list_head *head,
1040 */ 1037 */
1041static void nfs_redirty_request(struct nfs_page *req) 1038static void nfs_redirty_request(struct nfs_page *req)
1042{ 1039{
1043 struct page *page = req->wb_page;
1044
1045 nfs_mark_request_dirty(req); 1040 nfs_mark_request_dirty(req);
1046 nfs_unlock_request_dont_release(req); 1041 nfs_unlock_request_dont_release(req);
1047 nfs_end_page_writeback(page); 1042 nfs_end_page_writeback(req->wb_page);
1048 nfs_release_request(req); 1043 nfs_release_request(req);
1049} 1044}
1050 1045