Lines Matching full:hdr

89 static void filelayout_reset_write(struct nfs_pgio_header *hdr)  in filelayout_reset_write()  argument
91 struct rpc_task *task = &hdr->task; in filelayout_reset_write()
93 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in filelayout_reset_write()
96 hdr->task.tk_pid, in filelayout_reset_write()
97 hdr->inode->i_sb->s_id, in filelayout_reset_write()
98 (unsigned long long)NFS_FILEID(hdr->inode), in filelayout_reset_write()
99 hdr->args.count, in filelayout_reset_write()
100 (unsigned long long)hdr->args.offset); in filelayout_reset_write()
102 task->tk_status = pnfs_write_done_resend_to_mds(hdr); in filelayout_reset_write()
106 static void filelayout_reset_read(struct nfs_pgio_header *hdr) in filelayout_reset_read() argument
108 struct rpc_task *task = &hdr->task; in filelayout_reset_read()
110 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in filelayout_reset_read()
113 hdr->task.tk_pid, in filelayout_reset_read()
114 hdr->inode->i_sb->s_id, in filelayout_reset_read()
115 (unsigned long long)NFS_FILEID(hdr->inode), in filelayout_reset_read()
116 hdr->args.count, in filelayout_reset_read()
117 (unsigned long long)hdr->args.offset); in filelayout_reset_read()
119 task->tk_status = pnfs_read_done_resend_to_mds(hdr); in filelayout_reset_read()
206 struct nfs_pgio_header *hdr) in filelayout_read_done_cb() argument
210 trace_nfs4_pnfs_read(hdr, task->tk_status); in filelayout_read_done_cb()
211 err = filelayout_async_handle_error(task, hdr->args.context->state, in filelayout_read_done_cb()
212 hdr->ds_clp, hdr->lseg); in filelayout_read_done_cb()
216 filelayout_reset_read(hdr); in filelayout_read_done_cb()
232 filelayout_set_layoutcommit(struct nfs_pgio_header *hdr) in filelayout_set_layoutcommit() argument
236 if (FILELAYOUT_LSEG(hdr->lseg)->commit_through_mds || in filelayout_set_layoutcommit()
237 hdr->res.verf->committed == NFS_FILE_SYNC) in filelayout_set_layoutcommit()
239 if (hdr->res.verf->committed == NFS_DATA_SYNC) in filelayout_set_layoutcommit()
240 end_offs = hdr->mds_offset + (loff_t)hdr->res.count; in filelayout_set_layoutcommit()
243 pnfs_set_layoutcommit(hdr->inode, hdr->lseg, end_offs); in filelayout_set_layoutcommit()
244 dprintk("%s inode %lu pls_end_pos %lu\n", __func__, hdr->inode->i_ino, in filelayout_set_layoutcommit()
245 (unsigned long) NFS_I(hdr->inode)->layout->plh_lwb); in filelayout_set_layoutcommit()
270 struct nfs_pgio_header *hdr = data; in filelayout_read_prepare() local
272 if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) { in filelayout_read_prepare()
276 if (filelayout_reset_to_mds(hdr->lseg)) { in filelayout_read_prepare()
278 filelayout_reset_read(hdr); in filelayout_read_prepare()
282 hdr->pgio_done_cb = filelayout_read_done_cb; in filelayout_read_prepare()
284 if (nfs4_setup_sequence(hdr->ds_clp, in filelayout_read_prepare()
285 &hdr->args.seq_args, in filelayout_read_prepare()
286 &hdr->res.seq_res, in filelayout_read_prepare()
289 if (nfs4_set_rw_stateid(&hdr->args.stateid, hdr->args.context, in filelayout_read_prepare()
290 hdr->args.lock_context, FMODE_READ) == -EIO) in filelayout_read_prepare()
296 struct nfs_pgio_header *hdr = data; in filelayout_read_call_done() local
298 if (test_bit(NFS_IOHDR_REDO, &hdr->flags) && in filelayout_read_call_done()
300 nfs41_sequence_done(task, &hdr->res.seq_res); in filelayout_read_call_done()
305 hdr->mds_ops->rpc_call_done(task, data); in filelayout_read_call_done()
310 struct nfs_pgio_header *hdr = data; in filelayout_read_count_stats() local
312 rpc_count_iostats(task, NFS_SERVER(hdr->inode)->client->cl_metrics); in filelayout_read_count_stats()
316 struct nfs_pgio_header *hdr) in filelayout_write_done_cb() argument
320 trace_nfs4_pnfs_write(hdr, task->tk_status); in filelayout_write_done_cb()
321 err = filelayout_async_handle_error(task, hdr->args.context->state, in filelayout_write_done_cb()
322 hdr->ds_clp, hdr->lseg); in filelayout_write_done_cb()
326 filelayout_reset_write(hdr); in filelayout_write_done_cb()
333 filelayout_set_layoutcommit(hdr); in filelayout_write_done_cb()
336 hdr->fattr.valid = 0; in filelayout_write_done_cb()
338 nfs_writeback_update_inode(hdr); in filelayout_write_done_cb()
368 struct nfs_pgio_header *hdr = data; in filelayout_write_prepare() local
370 if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) { in filelayout_write_prepare()
374 if (filelayout_reset_to_mds(hdr->lseg)) { in filelayout_write_prepare()
376 filelayout_reset_write(hdr); in filelayout_write_prepare()
380 if (nfs4_setup_sequence(hdr->ds_clp, in filelayout_write_prepare()
381 &hdr->args.seq_args, in filelayout_write_prepare()
382 &hdr->res.seq_res, in filelayout_write_prepare()
385 if (nfs4_set_rw_stateid(&hdr->args.stateid, hdr->args.context, in filelayout_write_prepare()
386 hdr->args.lock_context, FMODE_WRITE) == -EIO) in filelayout_write_prepare()
392 struct nfs_pgio_header *hdr = data; in filelayout_write_call_done() local
394 if (test_bit(NFS_IOHDR_REDO, &hdr->flags) && in filelayout_write_call_done()
396 nfs41_sequence_done(task, &hdr->res.seq_res); in filelayout_write_call_done()
401 hdr->mds_ops->rpc_call_done(task, data); in filelayout_write_call_done()
406 struct nfs_pgio_header *hdr = data; in filelayout_write_count_stats() local
408 rpc_count_iostats(task, NFS_SERVER(hdr->inode)->client->cl_metrics); in filelayout_write_count_stats()
450 filelayout_read_pagelist(struct nfs_pgio_header *hdr) in filelayout_read_pagelist() argument
452 struct pnfs_layout_segment *lseg = hdr->lseg; in filelayout_read_pagelist()
455 loff_t offset = hdr->args.offset; in filelayout_read_pagelist()
460 __func__, hdr->inode->i_ino, in filelayout_read_pagelist()
461 hdr->args.pgbase, (size_t)hdr->args.count, offset); in filelayout_read_pagelist()
470 ds_clnt = nfs4_find_or_create_ds_client(ds->ds_clp, hdr->inode); in filelayout_read_pagelist()
479 hdr->ds_clp = ds->ds_clp; in filelayout_read_pagelist()
480 hdr->ds_commit_idx = idx; in filelayout_read_pagelist()
483 hdr->args.fh = fh; in filelayout_read_pagelist()
485 hdr->args.offset = filelayout_get_dserver_offset(lseg, offset); in filelayout_read_pagelist()
486 hdr->mds_offset = offset; in filelayout_read_pagelist()
489 nfs_initiate_pgio(ds_clnt, hdr, hdr->cred, in filelayout_read_pagelist()
490 NFS_PROTO(hdr->inode), &filelayout_read_call_ops, in filelayout_read_pagelist()
497 filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync) in filelayout_write_pagelist() argument
499 struct pnfs_layout_segment *lseg = hdr->lseg; in filelayout_write_pagelist()
502 loff_t offset = hdr->args.offset; in filelayout_write_pagelist()
513 ds_clnt = nfs4_find_or_create_ds_client(ds->ds_clp, hdr->inode); in filelayout_write_pagelist()
518 __func__, hdr->inode->i_ino, sync, (size_t) hdr->args.count, in filelayout_write_pagelist()
521 hdr->pgio_done_cb = filelayout_write_done_cb; in filelayout_write_pagelist()
523 hdr->ds_clp = ds->ds_clp; in filelayout_write_pagelist()
524 hdr->ds_commit_idx = idx; in filelayout_write_pagelist()
527 hdr->args.fh = fh; in filelayout_write_pagelist()
528 hdr->args.offset = filelayout_get_dserver_offset(lseg, offset); in filelayout_write_pagelist()
531 nfs_initiate_pgio(ds_clnt, hdr, hdr->cred, in filelayout_write_pagelist()
532 NFS_PROTO(hdr->inode), &filelayout_write_call_ops, in filelayout_write_pagelist()