Lines Matching refs:hdr
96 struct nfs_pgio_header *hdr, in nfs_pgheader_init() argument
97 void (*release)(struct nfs_pgio_header *hdr)) in nfs_pgheader_init() argument
102 hdr->req = nfs_list_entry(mirror->pg_list.next); in nfs_pgheader_init()
103 hdr->inode = desc->pg_inode; in nfs_pgheader_init()
104 hdr->cred = nfs_req_openctx(hdr->req)->cred; in nfs_pgheader_init()
105 hdr->io_start = req_offset(hdr->req); in nfs_pgheader_init()
106 hdr->good_bytes = mirror->pg_count; in nfs_pgheader_init()
107 hdr->io_completion = desc->pg_io_completion; in nfs_pgheader_init()
108 hdr->dreq = desc->pg_dreq; in nfs_pgheader_init()
109 nfs_netfs_set_pgio_header(hdr, desc); in nfs_pgheader_init()
110 hdr->release = release; in nfs_pgheader_init()
111 hdr->completion_ops = desc->pg_completion_ops; in nfs_pgheader_init()
112 if (hdr->completion_ops->init_hdr) in nfs_pgheader_init()
113 hdr->completion_ops->init_hdr(hdr); in nfs_pgheader_init()
115 hdr->pgio_mirror_idx = desc->pg_mirror_idx; in nfs_pgheader_init()
119 void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos) in nfs_set_pgio_error() argument
121 unsigned int new = pos - hdr->io_start; in nfs_set_pgio_error()
123 trace_nfs_pgio_error(hdr, error, pos); in nfs_set_pgio_error()
124 if (hdr->good_bytes > new) { in nfs_set_pgio_error()
125 hdr->good_bytes = new; in nfs_set_pgio_error()
126 clear_bit(NFS_IOHDR_EOF, &hdr->flags); in nfs_set_pgio_error()
127 if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags)) in nfs_set_pgio_error()
128 hdr->error = error; in nfs_set_pgio_error()
636 struct nfs_pgio_header *hdr = ops->rw_alloc_header(); in nfs_pgio_header_alloc() local
638 if (hdr) { in nfs_pgio_header_alloc()
639 INIT_LIST_HEAD(&hdr->pages); in nfs_pgio_header_alloc()
640 hdr->rw_ops = ops; in nfs_pgio_header_alloc()
642 return hdr; in nfs_pgio_header_alloc()
654 static void nfs_pgio_data_destroy(struct nfs_pgio_header *hdr) in nfs_pgio_data_destroy() argument
656 if (hdr->args.context) in nfs_pgio_data_destroy()
657 put_nfs_open_context(hdr->args.context); in nfs_pgio_data_destroy()
658 if (hdr->page_array.pagevec != hdr->page_array.page_array) in nfs_pgio_data_destroy()
659 kfree(hdr->page_array.pagevec); in nfs_pgio_data_destroy()
666 void nfs_pgio_header_free(struct nfs_pgio_header *hdr) in nfs_pgio_header_free() argument
668 nfs_pgio_data_destroy(hdr); in nfs_pgio_header_free()
669 hdr->rw_ops->rw_free_header(hdr); in nfs_pgio_header_free()
681 static void nfs_pgio_rpcsetup(struct nfs_pgio_header *hdr, unsigned int pgbase, in nfs_pgio_rpcsetup() argument
685 struct nfs_page *req = hdr->req; in nfs_pgio_rpcsetup()
690 hdr->args.fh = NFS_FH(hdr->inode); in nfs_pgio_rpcsetup()
691 hdr->args.offset = req_offset(req); in nfs_pgio_rpcsetup()
693 hdr->mds_offset = hdr->args.offset; in nfs_pgio_rpcsetup()
694 hdr->args.pgbase = pgbase; in nfs_pgio_rpcsetup()
695 hdr->args.pages = hdr->page_array.pagevec; in nfs_pgio_rpcsetup()
696 hdr->args.count = count; in nfs_pgio_rpcsetup()
697 hdr->args.context = get_nfs_open_context(nfs_req_openctx(req)); in nfs_pgio_rpcsetup()
698 hdr->args.lock_context = req->wb_lock_context; in nfs_pgio_rpcsetup()
699 hdr->args.stable = NFS_UNSTABLE; in nfs_pgio_rpcsetup()
708 hdr->args.stable = NFS_FILE_SYNC; in nfs_pgio_rpcsetup()
711 hdr->res.fattr = &hdr->fattr; in nfs_pgio_rpcsetup()
712 hdr->res.count = 0; in nfs_pgio_rpcsetup()
713 hdr->res.eof = 0; in nfs_pgio_rpcsetup()
714 hdr->res.verf = &hdr->verf; in nfs_pgio_rpcsetup()
715 nfs_fattr_init(&hdr->fattr); in nfs_pgio_rpcsetup()
725 struct nfs_pgio_header *hdr = calldata; in nfs_pgio_prepare() local
727 err = NFS_PROTO(hdr->inode)->pgio_rpc_prepare(task, hdr); in nfs_pgio_prepare()
732 int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr, in nfs_initiate_pgio() argument
739 .rpc_argp = &hdr->args, in nfs_initiate_pgio()
740 .rpc_resp = &hdr->res, in nfs_initiate_pgio()
745 .task = &hdr->task, in nfs_initiate_pgio()
748 .callback_data = hdr, in nfs_initiate_pgio()
753 if (nfs_server_capable(hdr->inode, NFS_CAP_MOVEABLE)) in nfs_initiate_pgio()
756 hdr->rw_ops->rw_initiate(hdr, &msg, rpc_ops, &task_setup_data, how); in nfs_initiate_pgio()
760 hdr->inode->i_sb->s_id, in nfs_initiate_pgio()
761 (unsigned long long)NFS_FILEID(hdr->inode), in nfs_initiate_pgio()
762 hdr->args.count, in nfs_initiate_pgio()
763 (unsigned long long)hdr->args.offset); in nfs_initiate_pgio()
766 return nfs_local_doio(NFS_SERVER(hdr->inode)->nfs_client, in nfs_initiate_pgio()
767 localio, hdr, call_ops); in nfs_initiate_pgio()
781 static void nfs_pgio_error(struct nfs_pgio_header *hdr) in nfs_pgio_error() argument
783 set_bit(NFS_IOHDR_REDO, &hdr->flags); in nfs_pgio_error()
784 hdr->completion_ops->completion(hdr); in nfs_pgio_error()
793 struct nfs_pgio_header *hdr = calldata; in nfs_pgio_release() local
794 hdr->completion_ops->completion(hdr); in nfs_pgio_release()
855 struct nfs_pgio_header *hdr = calldata; in nfs_pgio_result() local
856 struct inode *inode = hdr->inode; in nfs_pgio_result()
858 if (hdr->rw_ops->rw_done(task, hdr, inode) != 0) in nfs_pgio_result()
861 nfs_set_pgio_error(hdr, task->tk_status, hdr->args.offset); in nfs_pgio_result()
863 hdr->rw_ops->rw_result(task, hdr); in nfs_pgio_result()
875 struct nfs_pgio_header *hdr) in nfs_generic_pgio() argument
884 struct nfs_page_array *pg_array = &hdr->page_array; in nfs_generic_pgio()
898 nfs_pgio_error(hdr); in nfs_generic_pgio()
905 pages = hdr->page_array.pagevec; in nfs_generic_pgio()
913 nfs_list_move_request(req, &hdr->pages); in nfs_generic_pgio()
930 nfs_pgio_error(hdr); in nfs_generic_pgio()
940 nfs_pgio_rpcsetup(hdr, pg_base, mirror->pg_count, desc->pg_ioflags, in nfs_generic_pgio()
949 struct nfs_pgio_header *hdr; in nfs_generic_pg_pgios() local
953 hdr = nfs_pgio_header_alloc(desc->pg_rw_ops); in nfs_generic_pg_pgios()
954 if (!hdr) { in nfs_generic_pg_pgios()
958 nfs_pgheader_init(desc, hdr, nfs_pgio_header_free); in nfs_generic_pg_pgios()
959 ret = nfs_generic_pgio(desc, hdr); in nfs_generic_pg_pgios()
961 struct nfs_client *clp = NFS_SERVER(hdr->inode)->nfs_client; in nfs_generic_pg_pgios()
964 nfs_local_open_fh(clp, hdr->cred, in nfs_generic_pg_pgios()
965 hdr->args.fh, hdr->args.context->mode); in nfs_generic_pg_pgios()
967 if (NFS_SERVER(hdr->inode)->nfs_client->cl_minorversion) in nfs_generic_pg_pgios()
969 ret = nfs_initiate_pgio(NFS_CLIENT(hdr->inode), in nfs_generic_pg_pgios()
970 hdr, in nfs_generic_pg_pgios()
971 hdr->cred, in nfs_generic_pg_pgios()
972 NFS_PROTO(hdr->inode), in nfs_generic_pg_pgios()
1374 struct nfs_pgio_header *hdr) in nfs_pageio_resend() argument
1378 desc->pg_io_completion = hdr->io_completion; in nfs_pageio_resend()
1379 desc->pg_dreq = hdr->dreq; in nfs_pageio_resend()
1380 nfs_netfs_set_pageio_descriptor(desc, hdr); in nfs_pageio_resend()
1381 list_splice_init(&hdr->pages, &pages); in nfs_pageio_resend()
1391 hdr->completion_ops->error_cleanup(&pages, err); in nfs_pageio_resend()
1392 nfs_set_pgio_error(hdr, err, hdr->io_start); in nfs_pageio_resend()