Skip to content

Commit 56f9cd6

Browse files
Fred IsamanTrond Myklebust
authored andcommitted
NFS: avoid some stat gathering for direct io
Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent b359f9d commit 56f9cd6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

fs/nfs/write.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,13 @@ nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst,
472472
nfs_list_add_request(req, dst);
473473
cinfo->mds->ncommit++;
474474
spin_unlock(cinfo->lock);
475-
inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
476-
inc_bdi_stat(req->wb_page->mapping->backing_dev_info, BDI_RECLAIMABLE);
477-
__mark_inode_dirty(req->wb_context->dentry->d_inode, I_DIRTY_DATASYNC);
475+
if (!cinfo->dreq) {
476+
inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
477+
inc_bdi_stat(req->wb_page->mapping->backing_dev_info,
478+
BDI_RECLAIMABLE);
479+
__mark_inode_dirty(req->wb_context->dentry->d_inode,
480+
I_DIRTY_DATASYNC);
481+
}
478482
}
479483
EXPORT_SYMBOL_GPL(nfs_request_add_commit_list);
480484

@@ -1455,9 +1459,11 @@ void nfs_retry_commit(struct list_head *page_list,
14551459
req = nfs_list_entry(page_list->next);
14561460
nfs_list_remove_request(req);
14571461
nfs_mark_request_commit(req, lseg, cinfo);
1458-
dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
1459-
dec_bdi_stat(req->wb_page->mapping->backing_dev_info,
1460-
BDI_RECLAIMABLE);
1462+
if (!cinfo->dreq) {
1463+
dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
1464+
dec_bdi_stat(req->wb_page->mapping->backing_dev_info,
1465+
BDI_RECLAIMABLE);
1466+
}
14611467
nfs_unlock_request(req);
14621468
}
14631469
}

0 commit comments

Comments
 (0)