aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-09-03 12:19:07 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-09-12 13:49:31 -0400
commitf418c64b71590bac8fdebd0969a1eeaffaf036d2 (patch)
tree371dac8b5cbe52ce144920963a2e76bc66e97d4d /fs/nfs
parent164ae58c3c2a56e99d7ae207499f1fbd5e6f263d (diff)
NFS: Unconditionally enable commit code
The goal is to create a generic NFS module with code that does not depend on what versions of NFS are enabled. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/direct.c14
-rw-r--r--fs/nfs/write.c61
2 files changed, 0 insertions, 75 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 65ef6e00deee..dda4b8667c02 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -178,7 +178,6 @@ static int nfs_direct_set_or_cmp_hdr_verf(struct nfs_direct_req *dreq,
178 return memcmp(verfp, &hdr->verf, sizeof(struct nfs_writeverf)); 178 return memcmp(verfp, &hdr->verf, sizeof(struct nfs_writeverf));
179} 179}
180 180
181#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
182/* 181/*
183 * nfs_direct_cmp_commit_data_verf - compare verifier for commit data 182 * nfs_direct_cmp_commit_data_verf - compare verifier for commit data
184 * @dreq - direct request possibly spanning multiple servers 183 * @dreq - direct request possibly spanning multiple servers
@@ -197,7 +196,6 @@ static int nfs_direct_cmp_commit_data_verf(struct nfs_direct_req *dreq,
197 WARN_ON_ONCE(verfp->committed < 0); 196 WARN_ON_ONCE(verfp->committed < 0);
198 return memcmp(verfp, &data->verf, sizeof(struct nfs_writeverf)); 197 return memcmp(verfp, &data->verf, sizeof(struct nfs_writeverf));
199} 198}
200#endif
201 199
202/** 200/**
203 * nfs_direct_IO - NFS address space operation for direct I/O 201 * nfs_direct_IO - NFS address space operation for direct I/O
@@ -576,7 +574,6 @@ out:
576 return result; 574 return result;
577} 575}
578 576
579#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
580static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) 577static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
581{ 578{
582 struct nfs_pageio_descriptor desc; 579 struct nfs_pageio_descriptor desc;
@@ -700,17 +697,6 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
700 schedule_work(&dreq->work); /* Calls nfs_direct_write_schedule_work */ 697 schedule_work(&dreq->work); /* Calls nfs_direct_write_schedule_work */
701} 698}
702 699
703#else
704static void nfs_direct_write_schedule_work(struct work_struct *work)
705{
706}
707
708static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode *inode)
709{
710 nfs_direct_complete(dreq, true);
711}
712#endif
713
714static void nfs_direct_write_completion(struct nfs_pgio_header *hdr) 700static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
715{ 701{
716 struct nfs_direct_req *dreq = hdr->dreq; 702 struct nfs_direct_req *dreq = hdr->dreq;
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 128d97f01d1c..6786873a2901 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -720,7 +720,6 @@ nfs_mark_request_dirty(struct nfs_page *req)
720 __set_page_dirty_nobuffers(req->wb_page); 720 __set_page_dirty_nobuffers(req->wb_page);
721} 721}
722 722
723#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
724/* 723/*
725 * nfs_page_search_commits_for_head_request_locked 724 * nfs_page_search_commits_for_head_request_locked
726 * 725 *
@@ -870,43 +869,6 @@ int nfs_write_need_commit(struct nfs_pgio_header *hdr)
870 return hdr->verf.committed != NFS_FILE_SYNC; 869 return hdr->verf.committed != NFS_FILE_SYNC;
871} 870}
872 871
873#else
874static struct nfs_page *
875nfs_page_search_commits_for_head_request_locked(struct nfs_inode *nfsi,
876 struct page *page)
877{
878 return NULL;
879}
880
881static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo,
882 struct inode *inode)
883{
884}
885
886void nfs_init_cinfo(struct nfs_commit_info *cinfo,
887 struct inode *inode,
888 struct nfs_direct_req *dreq)
889{
890}
891
892void
893nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg,
894 struct nfs_commit_info *cinfo)
895{
896}
897
898static void
899nfs_clear_request_commit(struct nfs_page *req)
900{
901}
902
903int nfs_write_need_commit(struct nfs_pgio_header *hdr)
904{
905 return 0;
906}
907
908#endif
909
910static void nfs_write_completion(struct nfs_pgio_header *hdr) 872static void nfs_write_completion(struct nfs_pgio_header *hdr)
911{ 873{
912 struct nfs_commit_info cinfo; 874 struct nfs_commit_info cinfo;
@@ -942,7 +904,6 @@ out:
942 hdr->release(hdr); 904 hdr->release(hdr);
943} 905}
944 906
945#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
946unsigned long 907unsigned long
947nfs_reqs_to_commit(struct nfs_commit_info *cinfo) 908nfs_reqs_to_commit(struct nfs_commit_info *cinfo)
948{ 909{
@@ -999,19 +960,6 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst,
999 return ret; 960 return ret;
1000} 961}
1001 962
1002#else
1003unsigned long nfs_reqs_to_commit(struct nfs_commit_info *cinfo)
1004{
1005 return 0;
1006}
1007
1008int nfs_scan_commit(struct inode *inode, struct list_head *dst,
1009 struct nfs_commit_info *cinfo)
1010{
1011 return 0;
1012}
1013#endif
1014
1015/* 963/*
1016 * Search for an existing write request, and attempt to update 964 * Search for an existing write request, and attempt to update
1017 * it to reflect a new dirty region on a given page. 965 * it to reflect a new dirty region on a given page.
@@ -1404,7 +1352,6 @@ static int nfs_writeback_done(struct rpc_task *task,
1404 return status; 1352 return status;
1405 nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, hdr->res.count); 1353 nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, hdr->res.count);
1406 1354
1407#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
1408 if (hdr->res.verf->committed < hdr->args.stable && 1355 if (hdr->res.verf->committed < hdr->args.stable &&
1409 task->tk_status >= 0) { 1356 task->tk_status >= 0) {
1410 /* We tried a write call, but the server did not 1357 /* We tried a write call, but the server did not
@@ -1426,7 +1373,6 @@ static int nfs_writeback_done(struct rpc_task *task,
1426 complain = jiffies + 300 * HZ; 1373 complain = jiffies + 300 * HZ;
1427 } 1374 }
1428 } 1375 }
1429#endif
1430 1376
1431 /* Deal with the suid/sgid bit corner case */ 1377 /* Deal with the suid/sgid bit corner case */
1432 if (nfs_should_remove_suid(inode)) 1378 if (nfs_should_remove_suid(inode))
@@ -1479,7 +1425,6 @@ static void nfs_writeback_result(struct rpc_task *task,
1479} 1425}
1480 1426
1481 1427
1482#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
1483static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) 1428static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait)
1484{ 1429{
1485 int ret; 1430 int ret;
@@ -1803,12 +1748,6 @@ out_mark_dirty:
1803 __mark_inode_dirty(inode, I_DIRTY_DATASYNC); 1748 __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
1804 return ret; 1749 return ret;
1805} 1750}
1806#else
1807static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc)
1808{
1809 return 0;
1810}
1811#endif
1812 1751
1813int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) 1752int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
1814{ 1753{