Lines Matching full:hdr
113 bool nfs_read_alloc_scratch(struct nfs_pgio_header *hdr, size_t size) in nfs_read_alloc_scratch() argument
115 WARN_ON(hdr->res.scratch != NULL); in nfs_read_alloc_scratch()
116 hdr->res.scratch = kmalloc(size, GFP_KERNEL); in nfs_read_alloc_scratch()
117 return hdr->res.scratch != NULL; in nfs_read_alloc_scratch()
138 static void nfs_read_completion(struct nfs_pgio_header *hdr) in nfs_read_completion() argument
143 if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) in nfs_read_completion()
145 while (!list_empty(&hdr->pages)) { in nfs_read_completion()
146 struct nfs_page *req = nfs_list_entry(hdr->pages.next); in nfs_read_completion()
151 if (test_bit(NFS_IOHDR_EOF, &hdr->flags)) { in nfs_read_completion()
155 if (bytes > hdr->good_bytes) { in nfs_read_completion()
160 } else if (hdr->good_bytes - bytes < req->wb_bytes) { in nfs_read_completion()
163 start += hdr->good_bytes - bytes; in nfs_read_completion()
170 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags)) { in nfs_read_completion()
171 if (bytes <= hdr->good_bytes) in nfs_read_completion()
174 error = hdr->error; in nfs_read_completion()
182 nfs_netfs_read_completion(hdr); in nfs_read_completion()
185 hdr->release(hdr); in nfs_read_completion()
188 static void nfs_initiate_read(struct nfs_pgio_header *hdr, in nfs_initiate_read() argument
193 rpc_ops->read_setup(hdr, msg); in nfs_initiate_read()
194 nfs_netfs_initiate_read(hdr); in nfs_initiate_read()
195 trace_nfs_initiate_read(hdr); in nfs_initiate_read()
220 struct nfs_pgio_header *hdr, in nfs_readpage_done() argument
223 int status = NFS_PROTO(inode)->read_done(task, hdr); in nfs_readpage_done()
227 nfs_add_stats(inode, NFSIOS_SERVERREADBYTES, hdr->res.count); in nfs_readpage_done()
228 trace_nfs_readpage_done(task, hdr); in nfs_readpage_done()
238 struct nfs_pgio_header *hdr) in nfs_readpage_retry() argument
240 struct nfs_pgio_args *argp = &hdr->args; in nfs_readpage_retry()
241 struct nfs_pgio_res *resp = &hdr->res; in nfs_readpage_retry()
244 nfs_inc_stats(hdr->inode, NFSIOS_SHORTREAD); in nfs_readpage_retry()
245 trace_nfs_readpage_short(task, hdr); in nfs_readpage_retry()
249 nfs_set_pgio_error(hdr, -EIO, argp->offset); in nfs_readpage_retry()
255 hdr->pnfs_error = -EAGAIN; in nfs_readpage_retry()
259 /* Yes, so retry the read at the end of the hdr */ in nfs_readpage_retry()
260 hdr->mds_offset += resp->count; in nfs_readpage_retry()
270 struct nfs_pgio_header *hdr) in nfs_readpage_result() argument
272 if (hdr->res.eof) { in nfs_readpage_result()
273 loff_t pos = hdr->args.offset + hdr->res.count; in nfs_readpage_result()
274 unsigned int new = pos - hdr->io_start; in nfs_readpage_result()
276 if (hdr->good_bytes > new) { in nfs_readpage_result()
277 hdr->good_bytes = new; in nfs_readpage_result()
278 set_bit(NFS_IOHDR_EOF, &hdr->flags); in nfs_readpage_result()
279 clear_bit(NFS_IOHDR_ERROR, &hdr->flags); in nfs_readpage_result()
281 } else if (hdr->res.count < hdr->args.count) in nfs_readpage_result()
282 nfs_readpage_retry(task, hdr); in nfs_readpage_result()