Lines Matching refs:hdr
36 struct nfs_pgio_header *hdr);
1069 static void ff_layout_reset_write(struct nfs_pgio_header *hdr, bool retry_pnfs) in ff_layout_reset_write() argument
1071 struct rpc_task *task = &hdr->task; in ff_layout_reset_write()
1073 pnfs_layoutcommit_inode(hdr->inode, false); in ff_layout_reset_write()
1078 hdr->task.tk_pid, in ff_layout_reset_write()
1079 hdr->inode->i_sb->s_id, in ff_layout_reset_write()
1080 (unsigned long long)NFS_FILEID(hdr->inode), in ff_layout_reset_write()
1081 hdr->args.count, in ff_layout_reset_write()
1082 (unsigned long long)hdr->args.offset); in ff_layout_reset_write()
1084 hdr->completion_ops->reschedule_io(hdr); in ff_layout_reset_write()
1088 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in ff_layout_reset_write()
1091 hdr->task.tk_pid, in ff_layout_reset_write()
1092 hdr->inode->i_sb->s_id, in ff_layout_reset_write()
1093 (unsigned long long)NFS_FILEID(hdr->inode), in ff_layout_reset_write()
1094 hdr->args.count, in ff_layout_reset_write()
1095 (unsigned long long)hdr->args.offset); in ff_layout_reset_write()
1097 trace_pnfs_mds_fallback_write_done(hdr->inode, in ff_layout_reset_write()
1098 hdr->args.offset, hdr->args.count, in ff_layout_reset_write()
1099 IOMODE_RW, NFS_I(hdr->inode)->layout, in ff_layout_reset_write()
1100 hdr->lseg); in ff_layout_reset_write()
1101 task->tk_status = pnfs_write_done_resend_to_mds(hdr); in ff_layout_reset_write()
1105 static void ff_layout_reset_read(struct nfs_pgio_header *hdr) in ff_layout_reset_read() argument
1107 struct rpc_task *task = &hdr->task; in ff_layout_reset_read()
1109 pnfs_layoutcommit_inode(hdr->inode, false); in ff_layout_reset_read()
1111 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in ff_layout_reset_read()
1114 hdr->task.tk_pid, in ff_layout_reset_read()
1115 hdr->inode->i_sb->s_id, in ff_layout_reset_read()
1116 (unsigned long long)NFS_FILEID(hdr->inode), in ff_layout_reset_read()
1117 hdr->args.count, in ff_layout_reset_read()
1118 (unsigned long long)hdr->args.offset); in ff_layout_reset_read()
1120 trace_pnfs_mds_fallback_read_done(hdr->inode, in ff_layout_reset_read()
1121 hdr->args.offset, hdr->args.count, in ff_layout_reset_read()
1122 IOMODE_READ, NFS_I(hdr->inode)->layout, in ff_layout_reset_read()
1123 hdr->lseg); in ff_layout_reset_read()
1124 task->tk_status = pnfs_read_done_resend_to_mds(hdr); in ff_layout_reset_read()
1319 struct nfs_pgio_header *hdr) in ff_layout_read_done_cb() argument
1321 int new_idx = hdr->pgio_mirror_idx; in ff_layout_read_done_cb()
1324 trace_nfs4_pnfs_read(hdr, task->tk_status); in ff_layout_read_done_cb()
1326 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_read_done_cb()
1327 hdr->args.offset, hdr->args.count, in ff_layout_read_done_cb()
1328 hdr->res.op_status, OP_READ, in ff_layout_read_done_cb()
1330 err = ff_layout_async_handle_error(task, hdr->args.context->state, in ff_layout_read_done_cb()
1331 hdr->ds_clp, hdr->lseg, in ff_layout_read_done_cb()
1332 hdr->pgio_mirror_idx); in ff_layout_read_done_cb()
1334 clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_read_done_cb()
1335 clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_read_done_cb()
1338 if (ff_layout_choose_best_ds_for_read(hdr->lseg, in ff_layout_read_done_cb()
1339 hdr->pgio_mirror_idx + 1, in ff_layout_read_done_cb()
1342 set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_read_done_cb()
1345 set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_read_done_cb()
1353 ff_layout_read_record_layoutstats_done(task, hdr); in ff_layout_read_done_cb()
1354 ff_layout_send_layouterror(hdr->lseg); in ff_layout_read_done_cb()
1355 hdr->pgio_mirror_idx = new_idx; in ff_layout_read_done_cb()
1390 struct nfs_pgio_header *hdr) in ff_layout_read_record_layoutstats_start() argument
1392 if (test_and_set_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_read_record_layoutstats_start()
1394 nfs4_ff_layout_stat_io_start_read(hdr->inode, in ff_layout_read_record_layoutstats_start()
1395 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_start()
1396 hdr->args.count, in ff_layout_read_record_layoutstats_start()
1401 struct nfs_pgio_header *hdr) in ff_layout_read_record_layoutstats_done() argument
1403 if (!test_and_clear_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_read_record_layoutstats_done()
1406 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_done()
1407 hdr->args.count, in ff_layout_read_record_layoutstats_done()
1408 hdr->res.count); in ff_layout_read_record_layoutstats_done()
1409 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_read_record_layoutstats_done()
1413 struct nfs_pgio_header *hdr) in ff_layout_read_prepare_common() argument
1415 if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) { in ff_layout_read_prepare_common()
1420 ff_layout_read_record_layoutstats_start(task, hdr); in ff_layout_read_prepare_common()
1431 struct nfs_pgio_header *hdr = data; in ff_layout_read_prepare_v3() local
1433 if (ff_layout_read_prepare_common(task, hdr)) in ff_layout_read_prepare_v3()
1441 struct nfs_pgio_header *hdr = data; in ff_layout_read_prepare_v4() local
1443 if (nfs4_setup_sequence(hdr->ds_clp, in ff_layout_read_prepare_v4()
1444 &hdr->args.seq_args, in ff_layout_read_prepare_v4()
1445 &hdr->res.seq_res, in ff_layout_read_prepare_v4()
1449 ff_layout_read_prepare_common(task, hdr); in ff_layout_read_prepare_v4()
1454 struct nfs_pgio_header *hdr = data; in ff_layout_read_call_done() local
1458 if (test_bit(NFS_IOHDR_REDO, &hdr->flags) && in ff_layout_read_call_done()
1460 nfs4_sequence_done(task, &hdr->res.seq_res); in ff_layout_read_call_done()
1465 hdr->mds_ops->rpc_call_done(task, hdr); in ff_layout_read_call_done()
1470 struct nfs_pgio_header *hdr = data; in ff_layout_read_count_stats() local
1472 ff_layout_read_record_layoutstats_done(task, hdr); in ff_layout_read_count_stats()
1474 &NFS_CLIENT(hdr->inode)->cl_metrics[NFSPROC4_CLNT_READ]); in ff_layout_read_count_stats()
1479 struct nfs_pgio_header *hdr = data; in ff_layout_read_release() local
1481 ff_layout_read_record_layoutstats_done(&hdr->task, hdr); in ff_layout_read_release()
1482 if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags)) { in ff_layout_read_release()
1483 ff_layout_send_layouterror(hdr->lseg); in ff_layout_read_release()
1484 pnfs_read_resend_pnfs(hdr); in ff_layout_read_release()
1485 } else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags)) in ff_layout_read_release()
1486 ff_layout_reset_read(hdr); in ff_layout_read_release()
1492 struct nfs_pgio_header *hdr) in ff_layout_write_done_cb() argument
1497 trace_nfs4_pnfs_write(hdr, task->tk_status); in ff_layout_write_done_cb()
1499 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_write_done_cb()
1500 hdr->args.offset, hdr->args.count, in ff_layout_write_done_cb()
1501 hdr->res.op_status, OP_WRITE, in ff_layout_write_done_cb()
1503 err = ff_layout_async_handle_error(task, hdr->args.context->state, in ff_layout_write_done_cb()
1504 hdr->ds_clp, hdr->lseg, in ff_layout_write_done_cb()
1505 hdr->pgio_mirror_idx); in ff_layout_write_done_cb()
1507 clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_write_done_cb()
1508 clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_write_done_cb()
1511 set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_write_done_cb()
1514 set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_write_done_cb()
1520 if (hdr->res.verf->committed == NFS_FILE_SYNC || in ff_layout_write_done_cb()
1521 hdr->res.verf->committed == NFS_DATA_SYNC) in ff_layout_write_done_cb()
1522 end_offs = hdr->mds_offset + (loff_t)hdr->res.count; in ff_layout_write_done_cb()
1525 ff_layout_set_layoutcommit(hdr->inode, hdr->lseg, end_offs); in ff_layout_write_done_cb()
1528 hdr->fattr.valid = 0; in ff_layout_write_done_cb()
1530 nfs_writeback_update_inode(hdr); in ff_layout_write_done_cb()
1567 struct nfs_pgio_header *hdr) in ff_layout_write_record_layoutstats_start() argument
1569 if (test_and_set_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_write_record_layoutstats_start()
1571 nfs4_ff_layout_stat_io_start_write(hdr->inode, in ff_layout_write_record_layoutstats_start()
1572 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_start()
1573 hdr->args.count, in ff_layout_write_record_layoutstats_start()
1578 struct nfs_pgio_header *hdr) in ff_layout_write_record_layoutstats_done() argument
1580 if (!test_and_clear_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_write_record_layoutstats_done()
1583 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_done()
1584 hdr->args.count, hdr->res.count, in ff_layout_write_record_layoutstats_done()
1585 hdr->res.verf->committed); in ff_layout_write_record_layoutstats_done()
1586 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_write_record_layoutstats_done()
1590 struct nfs_pgio_header *hdr) in ff_layout_write_prepare_common() argument
1592 if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) { in ff_layout_write_prepare_common()
1597 ff_layout_write_record_layoutstats_start(task, hdr); in ff_layout_write_prepare_common()
1603 struct nfs_pgio_header *hdr = data; in ff_layout_write_prepare_v3() local
1605 if (ff_layout_write_prepare_common(task, hdr)) in ff_layout_write_prepare_v3()
1613 struct nfs_pgio_header *hdr = data; in ff_layout_write_prepare_v4() local
1615 if (nfs4_setup_sequence(hdr->ds_clp, in ff_layout_write_prepare_v4()
1616 &hdr->args.seq_args, in ff_layout_write_prepare_v4()
1617 &hdr->res.seq_res, in ff_layout_write_prepare_v4()
1621 ff_layout_write_prepare_common(task, hdr); in ff_layout_write_prepare_v4()
1626 struct nfs_pgio_header *hdr = data; in ff_layout_write_call_done() local
1628 if (test_bit(NFS_IOHDR_REDO, &hdr->flags) && in ff_layout_write_call_done()
1630 nfs4_sequence_done(task, &hdr->res.seq_res); in ff_layout_write_call_done()
1635 hdr->mds_ops->rpc_call_done(task, hdr); in ff_layout_write_call_done()
1640 struct nfs_pgio_header *hdr = data; in ff_layout_write_count_stats() local
1642 ff_layout_write_record_layoutstats_done(task, hdr); in ff_layout_write_count_stats()
1644 &NFS_CLIENT(hdr->inode)->cl_metrics[NFSPROC4_CLNT_WRITE]); in ff_layout_write_count_stats()
1649 struct nfs_pgio_header *hdr = data; in ff_layout_write_release() local
1651 ff_layout_write_record_layoutstats_done(&hdr->task, hdr); in ff_layout_write_release()
1652 if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags)) { in ff_layout_write_release()
1653 ff_layout_send_layouterror(hdr->lseg); in ff_layout_write_release()
1654 ff_layout_reset_write(hdr, true); in ff_layout_write_release()
1655 } else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags)) in ff_layout_write_release()
1656 ff_layout_reset_write(hdr, false); in ff_layout_write_release()
1778 ff_layout_read_pagelist(struct nfs_pgio_header *hdr) in ff_layout_read_pagelist() argument
1780 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_read_pagelist()
1785 loff_t offset = hdr->args.offset; in ff_layout_read_pagelist()
1786 u32 idx = hdr->pgio_mirror_idx; in ff_layout_read_pagelist()
1791 __func__, hdr->inode->i_ino, in ff_layout_read_pagelist()
1792 hdr->args.pgbase, (size_t)hdr->args.count, offset); in ff_layout_read_pagelist()
1800 hdr->inode); in ff_layout_read_pagelist()
1804 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_read_pagelist()
1813 hdr->pgio_done_cb = ff_layout_read_done_cb; in ff_layout_read_pagelist()
1815 hdr->ds_clp = ds->ds_clp; in ff_layout_read_pagelist()
1818 hdr->args.fh = fh; in ff_layout_read_pagelist()
1820 nfs4_ff_layout_select_ds_stateid(mirror, &hdr->args.stateid); in ff_layout_read_pagelist()
1826 hdr->args.offset = offset; in ff_layout_read_pagelist()
1827 hdr->mds_offset = offset; in ff_layout_read_pagelist()
1830 nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops, in ff_layout_read_pagelist()
1840 trace_pnfs_mds_fallback_read_pagelist(hdr->inode, in ff_layout_read_pagelist()
1841 hdr->args.offset, hdr->args.count, in ff_layout_read_pagelist()
1842 IOMODE_READ, NFS_I(hdr->inode)->layout, lseg); in ff_layout_read_pagelist()
1848 ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync) in ff_layout_write_pagelist() argument
1850 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_write_pagelist()
1855 loff_t offset = hdr->args.offset; in ff_layout_write_pagelist()
1858 int idx = hdr->pgio_mirror_idx; in ff_layout_write_pagelist()
1866 hdr->inode); in ff_layout_write_pagelist()
1870 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_write_pagelist()
1877 __func__, hdr->inode->i_ino, sync, (size_t) hdr->args.count, in ff_layout_write_pagelist()
1881 hdr->pgio_done_cb = ff_layout_write_done_cb; in ff_layout_write_pagelist()
1883 hdr->ds_clp = ds->ds_clp; in ff_layout_write_pagelist()
1884 hdr->ds_commit_idx = idx; in ff_layout_write_pagelist()
1887 hdr->args.fh = fh; in ff_layout_write_pagelist()
1889 nfs4_ff_layout_select_ds_stateid(mirror, &hdr->args.stateid); in ff_layout_write_pagelist()
1895 hdr->args.offset = offset; in ff_layout_write_pagelist()
1898 nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops, in ff_layout_write_pagelist()
1908 trace_pnfs_mds_fallback_write_pagelist(hdr->inode, in ff_layout_write_pagelist()
1909 hdr->args.offset, hdr->args.count, in ff_layout_write_pagelist()
1910 IOMODE_RW, NFS_I(hdr->inode)->layout, lseg); in ff_layout_write_pagelist()