diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-06 08:57:46 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-06 08:57:46 -0500 |
commit | e2fecb215b321db0e4a5b2597349a63c07bec42f (patch) | |
tree | eae83638b30a0ae5e742abd8cfb29fd5503e4102 /fs/nfs/write.c | |
parent | fe0fe83585f88346557868a803a479dfaaa0688a (diff) |
NFS: Remove pNFS bloat from the generic write path
We have no business doing any this in the standard write release path.
Get rid of it, and put it in the pNFS layer.
Also, while we're at it, get rid of the completely bogus unlock/relock
semantics that were present in nfs_writeback_release_full(). It is
not only unnecessary, but actually dangerous to release the write lock
just in order to take it again in nfs_page_async_flush(). Better just
to open code the pgio operations in a pnfs helper.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 1dda78db6a73..0c3885255f97 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1052,7 +1052,7 @@ static const struct nfs_pageio_ops nfs_pageio_write_ops = { | |||
1052 | .pg_doio = nfs_generic_pg_writepages, | 1052 | .pg_doio = nfs_generic_pg_writepages, |
1053 | }; | 1053 | }; |
1054 | 1054 | ||
1055 | static void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, | 1055 | void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, |
1056 | struct inode *inode, int ioflags) | 1056 | struct inode *inode, int ioflags) |
1057 | { | 1057 | { |
1058 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, | 1058 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, |
@@ -1166,13 +1166,7 @@ static void nfs_writeback_done_full(struct rpc_task *task, void *calldata) | |||
1166 | static void nfs_writeback_release_full(void *calldata) | 1166 | static void nfs_writeback_release_full(void *calldata) |
1167 | { | 1167 | { |
1168 | struct nfs_write_data *data = calldata; | 1168 | struct nfs_write_data *data = calldata; |
1169 | int ret, status = data->task.tk_status; | 1169 | int status = data->task.tk_status; |
1170 | struct nfs_pageio_descriptor pgio; | ||
1171 | |||
1172 | if (data->pnfs_error) { | ||
1173 | nfs_pageio_init_write_mds(&pgio, data->inode, FLUSH_STABLE); | ||
1174 | pgio.pg_recoalesce = 1; | ||
1175 | } | ||
1176 | 1170 | ||
1177 | /* Update attributes as result of writeback. */ | 1171 | /* Update attributes as result of writeback. */ |
1178 | while (!list_empty(&data->pages)) { | 1172 | while (!list_empty(&data->pages)) { |
@@ -1188,11 +1182,6 @@ static void nfs_writeback_release_full(void *calldata) | |||
1188 | req->wb_bytes, | 1182 | req->wb_bytes, |
1189 | (long long)req_offset(req)); | 1183 | (long long)req_offset(req)); |
1190 | 1184 | ||
1191 | if (data->pnfs_error) { | ||
1192 | dprintk(", pnfs error = %d\n", data->pnfs_error); | ||
1193 | goto next; | ||
1194 | } | ||
1195 | |||
1196 | if (status < 0) { | 1185 | if (status < 0) { |
1197 | nfs_set_pageerror(page); | 1186 | nfs_set_pageerror(page); |
1198 | nfs_context_set_write_error(req->wb_context, status); | 1187 | nfs_context_set_write_error(req->wb_context, status); |
@@ -1212,19 +1201,7 @@ remove_request: | |||
1212 | next: | 1201 | next: |
1213 | nfs_clear_page_tag_locked(req); | 1202 | nfs_clear_page_tag_locked(req); |
1214 | nfs_end_page_writeback(page); | 1203 | nfs_end_page_writeback(page); |
1215 | if (data->pnfs_error) { | ||
1216 | lock_page(page); | ||
1217 | nfs_pageio_cond_complete(&pgio, page->index); | ||
1218 | ret = nfs_page_async_flush(&pgio, page, 0); | ||
1219 | if (ret) { | ||
1220 | nfs_set_pageerror(page); | ||
1221 | dprintk("rewrite to MDS error = %d\n", ret); | ||
1222 | } | ||
1223 | unlock_page(page); | ||
1224 | } | ||
1225 | } | 1204 | } |
1226 | if (data->pnfs_error) | ||
1227 | nfs_pageio_complete(&pgio); | ||
1228 | nfs_writedata_release(calldata); | 1205 | nfs_writedata_release(calldata); |
1229 | } | 1206 | } |
1230 | 1207 | ||