NFS: avoid some stat gathering for direct io
authorFred Isaman <iisaman@netapp.com>
Fri, 20 Apr 2012 18:47:56 +0000 (14:47 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 27 Apr 2012 18:10:39 +0000 (14:10 -0400)
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/write.c

index 44a93d8c7b52dd6470d907464d256736f21b8e1d..56db9e7fa47a1c2ce55aca97e1f1405f6251878a 100644 (file)
@@ -472,9 +472,13 @@ nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst,
        nfs_list_add_request(req, dst);
        cinfo->mds->ncommit++;
        spin_unlock(cinfo->lock);
-       inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
-       inc_bdi_stat(req->wb_page->mapping->backing_dev_info, BDI_RECLAIMABLE);
-       __mark_inode_dirty(req->wb_context->dentry->d_inode, I_DIRTY_DATASYNC);
+       if (!cinfo->dreq) {
+               inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
+               inc_bdi_stat(req->wb_page->mapping->backing_dev_info,
+                            BDI_RECLAIMABLE);
+               __mark_inode_dirty(req->wb_context->dentry->d_inode,
+                                  I_DIRTY_DATASYNC);
+       }
 }
 EXPORT_SYMBOL_GPL(nfs_request_add_commit_list);
 
@@ -1455,9 +1459,11 @@ void nfs_retry_commit(struct list_head *page_list,
                req = nfs_list_entry(page_list->next);
                nfs_list_remove_request(req);
                nfs_mark_request_commit(req, lseg, cinfo);
-               dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
-               dec_bdi_stat(req->wb_page->mapping->backing_dev_info,
-                            BDI_RECLAIMABLE);
+               if (!cinfo->dreq) {
+                       dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
+                       dec_bdi_stat(req->wb_page->mapping->backing_dev_info,
+                                    BDI_RECLAIMABLE);
+               }
                nfs_unlock_request(req);
        }
 }