diff options
author | Weston Andros Adamson <dros@primarydata.com> | 2014-05-15 11:56:53 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-29 11:11:48 -0400 |
commit | 7f714720fac03383d687dbe39494cc96b845bd46 (patch) | |
tree | b12d2f58de79558408c773c79fda7c0122fa2d38 /fs/nfs/pagelist.c | |
parent | f0cb9ab8d5589fc553761068200e5a8342f61de0 (diff) |
nfs: remove data list from pgio header
Since the ability to split pages into subpage requests has been added,
nfs_pgio_header->rpc_list only ever has one pgio data.
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index ec4311df05d9..fab78d13ee14 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -470,7 +470,6 @@ struct nfs_rw_header *nfs_rw_header_alloc(const struct nfs_rw_ops *ops) | |||
470 | struct nfs_pgio_header *hdr = &header->header; | 470 | struct nfs_pgio_header *hdr = &header->header; |
471 | 471 | ||
472 | INIT_LIST_HEAD(&hdr->pages); | 472 | INIT_LIST_HEAD(&hdr->pages); |
473 | INIT_LIST_HEAD(&hdr->rpc_list); | ||
474 | spin_lock_init(&hdr->lock); | 473 | spin_lock_init(&hdr->lock); |
475 | atomic_set(&hdr->refcnt, 0); | 474 | atomic_set(&hdr->refcnt, 0); |
476 | hdr->rw_ops = ops; | 475 | hdr->rw_ops = ops; |
@@ -648,27 +647,6 @@ out: | |||
648 | } | 647 | } |
649 | EXPORT_SYMBOL_GPL(nfs_initiate_pgio); | 648 | EXPORT_SYMBOL_GPL(nfs_initiate_pgio); |
650 | 649 | ||
651 | static int nfs_do_multiple_pgios(struct list_head *head, | ||
652 | const struct rpc_call_ops *call_ops, | ||
653 | int how) | ||
654 | { | ||
655 | struct nfs_pgio_data *data; | ||
656 | int ret = 0; | ||
657 | |||
658 | while (!list_empty(head)) { | ||
659 | int ret2; | ||
660 | |||
661 | data = list_first_entry(head, struct nfs_pgio_data, list); | ||
662 | list_del_init(&data->list); | ||
663 | |||
664 | ret2 = nfs_initiate_pgio(NFS_CLIENT(data->header->inode), | ||
665 | data, call_ops, how, 0); | ||
666 | if (ret == 0) | ||
667 | ret = ret2; | ||
668 | } | ||
669 | return ret; | ||
670 | } | ||
671 | |||
672 | /** | 650 | /** |
673 | * nfs_pgio_error - Clean up from a pageio error | 651 | * nfs_pgio_error - Clean up from a pageio error |
674 | * @desc: IO descriptor | 652 | * @desc: IO descriptor |
@@ -677,14 +655,9 @@ static int nfs_do_multiple_pgios(struct list_head *head, | |||
677 | static int nfs_pgio_error(struct nfs_pageio_descriptor *desc, | 655 | static int nfs_pgio_error(struct nfs_pageio_descriptor *desc, |
678 | struct nfs_pgio_header *hdr) | 656 | struct nfs_pgio_header *hdr) |
679 | { | 657 | { |
680 | struct nfs_pgio_data *data; | ||
681 | |||
682 | set_bit(NFS_IOHDR_REDO, &hdr->flags); | 658 | set_bit(NFS_IOHDR_REDO, &hdr->flags); |
683 | while (!list_empty(&hdr->rpc_list)) { | 659 | nfs_pgio_data_release(hdr->data); |
684 | data = list_first_entry(&hdr->rpc_list, struct nfs_pgio_data, list); | 660 | hdr->data = NULL; |
685 | list_del(&data->list); | ||
686 | nfs_pgio_data_release(data); | ||
687 | } | ||
688 | desc->pg_completion_ops->error_cleanup(&desc->pg_list); | 661 | desc->pg_completion_ops->error_cleanup(&desc->pg_list); |
689 | return -ENOMEM; | 662 | return -ENOMEM; |
690 | } | 663 | } |
@@ -794,7 +767,7 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc, | |||
794 | 767 | ||
795 | /* Set up the argument struct */ | 768 | /* Set up the argument struct */ |
796 | nfs_pgio_rpcsetup(data, desc->pg_count, 0, desc->pg_ioflags, &cinfo); | 769 | nfs_pgio_rpcsetup(data, desc->pg_count, 0, desc->pg_ioflags, &cinfo); |
797 | list_add(&data->list, &hdr->rpc_list); | 770 | hdr->data = data; |
798 | desc->pg_rpc_callops = &nfs_pgio_common_ops; | 771 | desc->pg_rpc_callops = &nfs_pgio_common_ops; |
799 | return 0; | 772 | return 0; |
800 | } | 773 | } |
@@ -816,9 +789,9 @@ static int nfs_generic_pg_pgios(struct nfs_pageio_descriptor *desc) | |||
816 | atomic_inc(&hdr->refcnt); | 789 | atomic_inc(&hdr->refcnt); |
817 | ret = nfs_generic_pgio(desc, hdr); | 790 | ret = nfs_generic_pgio(desc, hdr); |
818 | if (ret == 0) | 791 | if (ret == 0) |
819 | ret = nfs_do_multiple_pgios(&hdr->rpc_list, | 792 | ret = nfs_initiate_pgio(NFS_CLIENT(hdr->inode), |
820 | desc->pg_rpc_callops, | 793 | hdr->data, desc->pg_rpc_callops, |
821 | desc->pg_ioflags); | 794 | desc->pg_ioflags, 0); |
822 | if (atomic_dec_and_test(&hdr->refcnt)) | 795 | if (atomic_dec_and_test(&hdr->refcnt)) |
823 | hdr->completion_ops->completion(hdr); | 796 | hdr->completion_ops->completion(hdr); |
824 | return ret; | 797 | return ret; |