Lines Matching defs:hdr
113 bool nfs_read_alloc_scratch(struct nfs_pgio_header *hdr, size_t size)
115 WARN_ON(hdr->res.scratch != NULL);
116 hdr->res.scratch = kmalloc(size, GFP_KERNEL);
117 return hdr->res.scratch != NULL;
140 static void nfs_read_completion(struct nfs_pgio_header *hdr)
145 if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
147 while (!list_empty(&hdr->pages)) {
148 struct nfs_page *req = nfs_list_entry(hdr->pages.next);
153 if (test_bit(NFS_IOHDR_EOF, &hdr->flags)) {
157 if (bytes > hdr->good_bytes) {
162 } else if (hdr->good_bytes - bytes < req->wb_bytes) {
165 start += hdr->good_bytes - bytes;
172 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags)) {
173 if (bytes <= hdr->good_bytes)
176 error = hdr->error;
184 nfs_netfs_read_completion(hdr);
187 hdr->release(hdr);
190 static void nfs_initiate_read(struct nfs_pgio_header *hdr,
195 rpc_ops->read_setup(hdr, msg);
196 nfs_netfs_initiate_read(hdr);
197 trace_nfs_initiate_read(hdr);
222 struct nfs_pgio_header *hdr,
225 int status = NFS_PROTO(inode)->read_done(task, hdr);
229 nfs_add_stats(inode, NFSIOS_SERVERREADBYTES, hdr->res.count);
230 trace_nfs_readpage_done(task, hdr);
240 struct nfs_pgio_header *hdr)
242 struct nfs_pgio_args *argp = &hdr->args;
243 struct nfs_pgio_res *resp = &hdr->res;
246 nfs_inc_stats(hdr->inode, NFSIOS_SHORTREAD);
247 trace_nfs_readpage_short(task, hdr);
251 nfs_set_pgio_error(hdr, -EIO, argp->offset);
257 hdr->pnfs_error = -EAGAIN;
261 /* Yes, so retry the read at the end of the hdr */
262 hdr->mds_offset += resp->count;
272 struct nfs_pgio_header *hdr)
274 if (hdr->res.eof) {
275 loff_t pos = hdr->args.offset + hdr->res.count;
276 unsigned int new = pos - hdr->io_start;
278 if (hdr->good_bytes > new) {
279 hdr->good_bytes = new;
280 set_bit(NFS_IOHDR_EOF, &hdr->flags);
281 clear_bit(NFS_IOHDR_ERROR, &hdr->flags);
283 } else if (hdr->res.count < hdr->args.count)
284 nfs_readpage_retry(task, hdr);