diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index f312860c15d0..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 | } |
87 | EXPORT_SYMBOL_GPL(nfs_writehdr_alloc); | ||
87 | 88 | ||
88 | static struct nfs_write_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr, | 89 | static 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 | } |
119 | EXPORT_SYMBOL_GPL(nfs_writehdr_free); | ||
118 | 120 | ||
119 | void nfs_writedata_release(struct nfs_write_data *wdata) | 121 | void 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 | } |
136 | EXPORT_SYMBOL_GPL(nfs_writedata_release); | ||
134 | 137 | ||
135 | static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error) | 138 | static 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 defined(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 defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 642 | #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4) |
640 | static unsigned long | 643 | static unsigned long |
641 | nfs_reqs_to_commit(struct nfs_commit_info *cinfo) | 644 | nfs_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 | } |
1179 | EXPORT_SYMBOL_GPL(nfs_generic_flush); | ||
1176 | 1180 | ||
1177 | static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) | 1181 | static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) |
1178 | { | 1182 | { |
@@ -1210,6 +1214,7 @@ void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, | |||
1210 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, compl_ops, | 1214 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, compl_ops, |
1211 | NFS_SERVER(inode)->wsize, ioflags); | 1215 | NFS_SERVER(inode)->wsize, ioflags); |
1212 | } | 1216 | } |
1217 | EXPORT_SYMBOL_GPL(nfs_pageio_init_write); | ||
1213 | 1218 | ||
1214 | void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio) | 1219 | void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio) |
1215 | { | 1220 | { |
@@ -1297,7 +1302,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) | |||
1297 | return; | 1302 | return; |
1298 | nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count); | 1303 | nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count); |
1299 | 1304 | ||
1300 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 1305 | #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4) |
1301 | if (resp->verf->committed < argp->stable && task->tk_status >= 0) { | 1306 | if (resp->verf->committed < argp->stable && task->tk_status >= 0) { |
1302 | /* We tried a write call, but the server did not | 1307 | /* We tried a write call, but the server did not |
1303 | * commit data to stable storage even though we | 1308 | * commit data to stable storage even though we |
@@ -1357,7 +1362,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) | |||
1357 | } | 1362 | } |
1358 | 1363 | ||
1359 | 1364 | ||
1360 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 1365 | #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4) |
1361 | static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) | 1366 | static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) |
1362 | { | 1367 | { |
1363 | int ret; | 1368 | int ret; |
@@ -1673,26 +1678,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
1673 | { | 1678 | { |
1674 | return nfs_commit_unstable_pages(inode, wbc); | 1679 | return nfs_commit_unstable_pages(inode, wbc); |
1675 | } | 1680 | } |
1676 | 1681 | EXPORT_SYMBOL_GPL(nfs_write_inode); | |
1677 | #ifdef CONFIG_NFS_V4 | ||
1678 | int nfs4_write_inode(struct inode *inode, struct writeback_control *wbc) | ||
1679 | { | ||
1680 | int ret = nfs_write_inode(inode, wbc); | ||
1681 | |||
1682 | if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) { | ||
1683 | int status; | ||
1684 | bool sync = true; | ||
1685 | |||
1686 | if (wbc->sync_mode == WB_SYNC_NONE) | ||
1687 | sync = false; | ||
1688 | |||
1689 | status = pnfs_layoutcommit_inode(inode, sync); | ||
1690 | if (status < 0) | ||
1691 | return status; | ||
1692 | } | ||
1693 | return ret; | ||
1694 | } | ||
1695 | #endif | ||
1696 | 1682 | ||
1697 | /* | 1683 | /* |
1698 | * flush the inode to disk. | 1684 | * flush the inode to disk. |
@@ -1708,6 +1694,7 @@ int nfs_wb_all(struct inode *inode) | |||
1708 | 1694 | ||
1709 | return sync_inode(inode, &wbc); | 1695 | return sync_inode(inode, &wbc); |
1710 | } | 1696 | } |
1697 | EXPORT_SYMBOL_GPL(nfs_wb_all); | ||
1711 | 1698 | ||
1712 | int nfs_wb_page_cancel(struct inode *inode, struct page *page) | 1699 | int nfs_wb_page_cancel(struct inode *inode, struct page *page) |
1713 | { | 1700 | { |