diff options
author | Anna Schumaker <Anna.Schumaker@netapp.com> | 2014-05-06 09:12:32 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-28 18:40:36 -0400 |
commit | 0eecb2145c1ce18e36617008424a93836ad0a3bd (patch) | |
tree | 469884c95d6e3c65383800e0c41b197d44851543 /fs/nfs/pagelist.c | |
parent | a4cdda59111f92000297e0d3edb1e0e08ba3549b (diff) |
NFS: Create a common nfs_pgio_result_common function
Combining these functions will let me make a single nfs_rw_common_ops
struct (see the next patch).
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 0fa211d35e40..f74df87058b6 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include "internal.h" | 24 | #include "internal.h" |
25 | #include "pnfs.h" | 25 | #include "pnfs.h" |
26 | 26 | ||
27 | #define NFSDBG_FACILITY NFSDBG_PAGECACHE | ||
28 | |||
27 | static struct kmem_cache *nfs_page_cachep; | 29 | static struct kmem_cache *nfs_page_cachep; |
28 | 30 | ||
29 | static bool nfs_pgarray_set(struct nfs_page_array *p, unsigned int pagecount) | 31 | static bool nfs_pgarray_set(struct nfs_page_array *p, unsigned int pagecount) |
@@ -447,6 +449,27 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc, | |||
447 | } | 449 | } |
448 | EXPORT_SYMBOL_GPL(nfs_pageio_init); | 450 | EXPORT_SYMBOL_GPL(nfs_pageio_init); |
449 | 451 | ||
452 | /** | ||
453 | * nfs_pgio_result - Basic pageio error handling | ||
454 | * @task: The task that ran | ||
455 | * @calldata: Pageio data to check | ||
456 | */ | ||
457 | void nfs_pgio_result(struct rpc_task *task, void *calldata) | ||
458 | { | ||
459 | struct nfs_pgio_data *data = calldata; | ||
460 | struct inode *inode = data->header->inode; | ||
461 | |||
462 | dprintk("NFS: %s: %5u, (status %d)\n", __func__, | ||
463 | task->tk_pid, task->tk_status); | ||
464 | |||
465 | if (data->header->rw_ops->rw_done(task, data, inode) != 0) | ||
466 | return; | ||
467 | if (task->tk_status < 0) | ||
468 | nfs_set_pgio_error(data->header, task->tk_status, data->args.offset); | ||
469 | else | ||
470 | data->header->rw_ops->rw_result(task, data); | ||
471 | } | ||
472 | |||
450 | static bool nfs_match_open_context(const struct nfs_open_context *ctx1, | 473 | static bool nfs_match_open_context(const struct nfs_open_context *ctx1, |
451 | const struct nfs_open_context *ctx2) | 474 | const struct nfs_open_context *ctx2) |
452 | { | 475 | { |