summaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-07-30 16:05:25 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-30 19:06:52 -0400
commit89d77c8fa8e6d1cb7e2cce95b428be30ddcc6f23 (patch)
tree37a076ec2675209fd78bc6ac0474dbecee8d11e7 /fs/nfs/write.c
parent1c606fb74c758beafd98cbad9a9133eadeec2371 (diff)
NFS: Convert v4 into a module
This patch exports symbols needed by the v4 module. In addition, I also switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or CONFIG_NFS_V4_MODULE are set. The module (nfs4.ko) will be created in the same directory as nfs.ko and will be automatically loaded the first time you try to mount over NFS v4. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index f268fe4f2785..e4a2ad2059bd 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -84,6 +84,7 @@ struct nfs_write_header *nfs_writehdr_alloc(void)
84 } 84 }
85 return p; 85 return p;
86} 86}
87EXPORT_SYMBOL_GPL(nfs_writehdr_alloc);
87 88
88static struct nfs_write_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr, 89static struct nfs_write_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr,
89 unsigned int pagecount) 90 unsigned int pagecount)
@@ -115,6 +116,7 @@ void nfs_writehdr_free(struct nfs_pgio_header *hdr)
115 struct nfs_write_header *whdr = container_of(hdr, struct nfs_write_header, header); 116 struct nfs_write_header *whdr = container_of(hdr, struct nfs_write_header, header);
116 mempool_free(whdr, nfs_wdata_mempool); 117 mempool_free(whdr, nfs_wdata_mempool);
117} 118}
119EXPORT_SYMBOL_GPL(nfs_writehdr_free);
118 120
119void nfs_writedata_release(struct nfs_write_data *wdata) 121void nfs_writedata_release(struct nfs_write_data *wdata)
120{ 122{
@@ -131,6 +133,7 @@ void nfs_writedata_release(struct nfs_write_data *wdata)
131 if (atomic_dec_and_test(&hdr->refcnt)) 133 if (atomic_dec_and_test(&hdr->refcnt))
132 hdr->completion_ops->completion(hdr); 134 hdr->completion_ops->completion(hdr);
133} 135}
136EXPORT_SYMBOL_GPL(nfs_writedata_release);
134 137
135static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error) 138static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error)
136{ 139{
@@ -446,7 +449,7 @@ nfs_mark_request_dirty(struct nfs_page *req)
446 __set_page_dirty_nobuffers(req->wb_page); 449 __set_page_dirty_nobuffers(req->wb_page);
447} 450}
448 451
449#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 452#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
450/** 453/**
451 * nfs_request_add_commit_list - add request to a commit list 454 * nfs_request_add_commit_list - add request to a commit list
452 * @req: pointer to a struct nfs_page 455 * @req: pointer to a struct nfs_page
@@ -636,7 +639,7 @@ out:
636 hdr->release(hdr); 639 hdr->release(hdr);
637} 640}
638 641
639#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 642#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
640static unsigned long 643static unsigned long
641nfs_reqs_to_commit(struct nfs_commit_info *cinfo) 644nfs_reqs_to_commit(struct nfs_commit_info *cinfo)
642{ 645{
@@ -1173,6 +1176,7 @@ int nfs_generic_flush(struct nfs_pageio_descriptor *desc,
1173 return nfs_flush_multi(desc, hdr); 1176 return nfs_flush_multi(desc, hdr);
1174 return nfs_flush_one(desc, hdr); 1177 return nfs_flush_one(desc, hdr);
1175} 1178}
1179EXPORT_SYMBOL_GPL(nfs_generic_flush);
1176 1180
1177static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) 1181static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
1178{ 1182{
@@ -1298,7 +1302,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
1298 return; 1302 return;
1299 nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count); 1303 nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count);
1300 1304
1301#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 1305#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
1302 if (resp->verf->committed < argp->stable && task->tk_status >= 0) { 1306 if (resp->verf->committed < argp->stable && task->tk_status >= 0) {
1303 /* We tried a write call, but the server did not 1307 /* We tried a write call, but the server did not
1304 * commit data to stable storage even though we 1308 * commit data to stable storage even though we
@@ -1358,7 +1362,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
1358} 1362}
1359 1363
1360 1364
1361#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 1365#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
1362static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) 1366static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait)
1363{ 1367{
1364 int ret; 1368 int ret;
@@ -1674,6 +1678,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
1674{ 1678{
1675 return nfs_commit_unstable_pages(inode, wbc); 1679 return nfs_commit_unstable_pages(inode, wbc);
1676} 1680}
1681EXPORT_SYMBOL_GPL(nfs_write_inode);
1677 1682
1678/* 1683/*
1679 * flush the inode to disk. 1684 * flush the inode to disk.