Lines Matching full:hdr

43 		struct nfs_pgio_header *hdr);
1019 static void ff_layout_reset_write(struct nfs_pgio_header *hdr, bool retry_pnfs) in ff_layout_reset_write() argument
1021 struct rpc_task *task = &hdr->task; in ff_layout_reset_write()
1023 pnfs_layoutcommit_inode(hdr->inode, false); in ff_layout_reset_write()
1028 hdr->task.tk_pid, in ff_layout_reset_write()
1029 hdr->inode->i_sb->s_id, in ff_layout_reset_write()
1030 (unsigned long long)NFS_FILEID(hdr->inode), in ff_layout_reset_write()
1031 hdr->args.count, in ff_layout_reset_write()
1032 (unsigned long long)hdr->args.offset); in ff_layout_reset_write()
1034 hdr->completion_ops->reschedule_io(hdr); in ff_layout_reset_write()
1038 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in ff_layout_reset_write()
1041 hdr->task.tk_pid, in ff_layout_reset_write()
1042 hdr->inode->i_sb->s_id, in ff_layout_reset_write()
1043 (unsigned long long)NFS_FILEID(hdr->inode), in ff_layout_reset_write()
1044 hdr->args.count, in ff_layout_reset_write()
1045 (unsigned long long)hdr->args.offset); in ff_layout_reset_write()
1047 trace_pnfs_mds_fallback_write_done(hdr->inode, in ff_layout_reset_write()
1048 hdr->args.offset, hdr->args.count, in ff_layout_reset_write()
1049 IOMODE_RW, NFS_I(hdr->inode)->layout, in ff_layout_reset_write()
1050 hdr->lseg); in ff_layout_reset_write()
1051 task->tk_status = pnfs_write_done_resend_to_mds(hdr); in ff_layout_reset_write()
1055 static void ff_layout_resend_pnfs_read(struct nfs_pgio_header *hdr) in ff_layout_resend_pnfs_read() argument
1057 u32 idx = hdr->pgio_mirror_idx + 1; in ff_layout_resend_pnfs_read()
1060 if (ff_layout_choose_any_ds_for_read(hdr->lseg, idx, &new_idx)) in ff_layout_resend_pnfs_read()
1061 ff_layout_send_layouterror(hdr->lseg); in ff_layout_resend_pnfs_read()
1063 pnfs_error_mark_layout_for_return(hdr->inode, hdr->lseg); in ff_layout_resend_pnfs_read()
1064 pnfs_read_resend_pnfs(hdr, new_idx); in ff_layout_resend_pnfs_read()
1067 static void ff_layout_reset_read(struct nfs_pgio_header *hdr) in ff_layout_reset_read() argument
1069 struct rpc_task *task = &hdr->task; in ff_layout_reset_read()
1071 pnfs_layoutcommit_inode(hdr->inode, false); in ff_layout_reset_read()
1072 pnfs_error_mark_layout_for_return(hdr->inode, hdr->lseg); in ff_layout_reset_read()
1074 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in ff_layout_reset_read()
1077 hdr->task.tk_pid, in ff_layout_reset_read()
1078 hdr->inode->i_sb->s_id, in ff_layout_reset_read()
1079 (unsigned long long)NFS_FILEID(hdr->inode), in ff_layout_reset_read()
1080 hdr->args.count, in ff_layout_reset_read()
1081 (unsigned long long)hdr->args.offset); in ff_layout_reset_read()
1083 trace_pnfs_mds_fallback_read_done(hdr->inode, in ff_layout_reset_read()
1084 hdr->args.offset, hdr->args.count, in ff_layout_reset_read()
1085 IOMODE_READ, NFS_I(hdr->inode)->layout, in ff_layout_reset_read()
1086 hdr->lseg); in ff_layout_reset_read()
1087 task->tk_status = pnfs_read_done_resend_to_mds(hdr); in ff_layout_reset_read()
1296 struct nfs_pgio_header *hdr) in ff_layout_read_done_cb() argument
1301 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_read_done_cb()
1302 hdr->args.offset, hdr->args.count, in ff_layout_read_done_cb()
1303 &hdr->res.op_status, OP_READ, in ff_layout_read_done_cb()
1305 trace_ff_layout_read_error(hdr); in ff_layout_read_done_cb()
1308 err = ff_layout_async_handle_error(task, hdr->args.context->state, in ff_layout_read_done_cb()
1309 hdr->ds_clp, hdr->lseg, in ff_layout_read_done_cb()
1310 hdr->pgio_mirror_idx); in ff_layout_read_done_cb()
1312 trace_nfs4_pnfs_read(hdr, err); in ff_layout_read_done_cb()
1313 clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_read_done_cb()
1314 clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_read_done_cb()
1317 set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_read_done_cb()
1320 set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_read_done_cb()
1361 struct nfs_pgio_header *hdr) in ff_layout_read_record_layoutstats_start() argument
1363 if (test_and_set_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_read_record_layoutstats_start()
1365 nfs4_ff_layout_stat_io_start_read(hdr->inode, in ff_layout_read_record_layoutstats_start()
1366 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_start()
1367 hdr->args.count, in ff_layout_read_record_layoutstats_start()
1372 struct nfs_pgio_header *hdr) in ff_layout_read_record_layoutstats_done() argument
1374 if (!test_and_clear_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_read_record_layoutstats_done()
1377 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_done()
1378 hdr->args.count, in ff_layout_read_record_layoutstats_done()
1379 hdr->res.count); in ff_layout_read_record_layoutstats_done()
1380 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_read_record_layoutstats_done()
1384 struct nfs_pgio_header *hdr) in ff_layout_read_prepare_common() argument
1386 if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) { in ff_layout_read_prepare_common()
1391 if (!pnfs_is_valid_lseg(hdr->lseg)) { in ff_layout_read_prepare_common()
1396 ff_layout_read_record_layoutstats_start(task, hdr); in ff_layout_read_prepare_common()
1407 struct nfs_pgio_header *hdr = data; in ff_layout_read_prepare_v3() local
1409 if (ff_layout_read_prepare_common(task, hdr)) in ff_layout_read_prepare_v3()
1417 struct nfs_pgio_header *hdr = data; in ff_layout_read_prepare_v4() local
1419 if (nfs4_setup_sequence(hdr->ds_clp, in ff_layout_read_prepare_v4()
1420 &hdr->args.seq_args, in ff_layout_read_prepare_v4()
1421 &hdr->res.seq_res, in ff_layout_read_prepare_v4()
1425 ff_layout_read_prepare_common(task, hdr); in ff_layout_read_prepare_v4()
1430 struct nfs_pgio_header *hdr = data; in ff_layout_read_call_done() local
1432 if (test_bit(NFS_IOHDR_REDO, &hdr->flags) && in ff_layout_read_call_done()
1434 nfs4_sequence_done(task, &hdr->res.seq_res); in ff_layout_read_call_done()
1439 hdr->mds_ops->rpc_call_done(task, hdr); in ff_layout_read_call_done()
1444 struct nfs_pgio_header *hdr = data; in ff_layout_read_count_stats() local
1446 ff_layout_read_record_layoutstats_done(task, hdr); in ff_layout_read_count_stats()
1448 &NFS_CLIENT(hdr->inode)->cl_metrics[NFSPROC4_CLNT_READ]); in ff_layout_read_count_stats()
1453 struct nfs_pgio_header *hdr = data; in ff_layout_read_release() local
1455 ff_layout_read_record_layoutstats_done(&hdr->task, hdr); in ff_layout_read_release()
1456 if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags)) in ff_layout_read_release()
1457 ff_layout_resend_pnfs_read(hdr); in ff_layout_read_release()
1458 else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags)) in ff_layout_read_release()
1459 ff_layout_reset_read(hdr); in ff_layout_read_release()
1465 struct nfs_pgio_header *hdr) in ff_layout_write_done_cb() argument
1471 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_write_done_cb()
1472 hdr->args.offset, hdr->args.count, in ff_layout_write_done_cb()
1473 &hdr->res.op_status, OP_WRITE, in ff_layout_write_done_cb()
1475 trace_ff_layout_write_error(hdr); in ff_layout_write_done_cb()
1478 err = ff_layout_async_handle_error(task, hdr->args.context->state, in ff_layout_write_done_cb()
1479 hdr->ds_clp, hdr->lseg, in ff_layout_write_done_cb()
1480 hdr->pgio_mirror_idx); in ff_layout_write_done_cb()
1482 trace_nfs4_pnfs_write(hdr, err); in ff_layout_write_done_cb()
1483 clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_write_done_cb()
1484 clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_write_done_cb()
1487 set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); in ff_layout_write_done_cb()
1490 set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); in ff_layout_write_done_cb()
1496 if (hdr->res.verf->committed == NFS_FILE_SYNC || in ff_layout_write_done_cb()
1497 hdr->res.verf->committed == NFS_DATA_SYNC) in ff_layout_write_done_cb()
1498 end_offs = hdr->mds_offset + (loff_t)hdr->res.count; in ff_layout_write_done_cb()
1501 ff_layout_set_layoutcommit(hdr->inode, hdr->lseg, end_offs); in ff_layout_write_done_cb()
1504 hdr->fattr.valid = 0; in ff_layout_write_done_cb()
1506 nfs_writeback_update_inode(hdr); in ff_layout_write_done_cb()
1546 struct nfs_pgio_header *hdr) in ff_layout_write_record_layoutstats_start() argument
1548 if (test_and_set_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_write_record_layoutstats_start()
1550 nfs4_ff_layout_stat_io_start_write(hdr->inode, in ff_layout_write_record_layoutstats_start()
1551 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_start()
1552 hdr->args.count, in ff_layout_write_record_layoutstats_start()
1557 struct nfs_pgio_header *hdr) in ff_layout_write_record_layoutstats_done() argument
1559 if (!test_and_clear_bit(NFS_IOHDR_STAT, &hdr->flags)) in ff_layout_write_record_layoutstats_done()
1562 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_done()
1563 hdr->args.count, hdr->res.count, in ff_layout_write_record_layoutstats_done()
1564 hdr->res.verf->committed); in ff_layout_write_record_layoutstats_done()
1565 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_write_record_layoutstats_done()
1569 struct nfs_pgio_header *hdr) in ff_layout_write_prepare_common() argument
1571 if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) { in ff_layout_write_prepare_common()
1576 if (!pnfs_is_valid_lseg(hdr->lseg)) { in ff_layout_write_prepare_common()
1581 ff_layout_write_record_layoutstats_start(task, hdr); in ff_layout_write_prepare_common()
1587 struct nfs_pgio_header *hdr = data; in ff_layout_write_prepare_v3() local
1589 if (ff_layout_write_prepare_common(task, hdr)) in ff_layout_write_prepare_v3()
1597 struct nfs_pgio_header *hdr = data; in ff_layout_write_prepare_v4() local
1599 if (nfs4_setup_sequence(hdr->ds_clp, in ff_layout_write_prepare_v4()
1600 &hdr->args.seq_args, in ff_layout_write_prepare_v4()
1601 &hdr->res.seq_res, in ff_layout_write_prepare_v4()
1605 ff_layout_write_prepare_common(task, hdr); in ff_layout_write_prepare_v4()
1610 struct nfs_pgio_header *hdr = data; in ff_layout_write_call_done() local
1612 if (test_bit(NFS_IOHDR_REDO, &hdr->flags) && in ff_layout_write_call_done()
1614 nfs4_sequence_done(task, &hdr->res.seq_res); in ff_layout_write_call_done()
1619 hdr->mds_ops->rpc_call_done(task, hdr); in ff_layout_write_call_done()
1624 struct nfs_pgio_header *hdr = data; in ff_layout_write_count_stats() local
1626 ff_layout_write_record_layoutstats_done(task, hdr); in ff_layout_write_count_stats()
1628 &NFS_CLIENT(hdr->inode)->cl_metrics[NFSPROC4_CLNT_WRITE]); in ff_layout_write_count_stats()
1633 struct nfs_pgio_header *hdr = data; in ff_layout_write_release() local
1635 ff_layout_write_record_layoutstats_done(&hdr->task, hdr); in ff_layout_write_release()
1636 if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags)) { in ff_layout_write_release()
1637 ff_layout_send_layouterror(hdr->lseg); in ff_layout_write_release()
1638 ff_layout_reset_write(hdr, true); in ff_layout_write_release()
1639 } else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags)) in ff_layout_write_release()
1640 ff_layout_reset_write(hdr, false); in ff_layout_write_release()
1770 ff_layout_read_pagelist(struct nfs_pgio_header *hdr) in ff_layout_read_pagelist() argument
1772 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_read_pagelist()
1778 loff_t offset = hdr->args.offset; in ff_layout_read_pagelist()
1779 u32 idx = hdr->pgio_mirror_idx; in ff_layout_read_pagelist()
1784 __func__, hdr->inode->i_ino, in ff_layout_read_pagelist()
1785 hdr->args.pgbase, (size_t)hdr->args.count, offset); in ff_layout_read_pagelist()
1793 hdr->inode); in ff_layout_read_pagelist()
1797 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_read_pagelist()
1806 hdr->pgio_done_cb = ff_layout_read_done_cb; in ff_layout_read_pagelist()
1808 hdr->ds_clp = ds->ds_clp; in ff_layout_read_pagelist()
1811 hdr->args.fh = fh; in ff_layout_read_pagelist()
1813 nfs4_ff_layout_select_ds_stateid(mirror, &hdr->args.stateid); in ff_layout_read_pagelist()
1819 hdr->args.offset = offset; in ff_layout_read_pagelist()
1820 hdr->mds_offset = offset; in ff_layout_read_pagelist()
1825 hdr->task.tk_start = ktime_get(); in ff_layout_read_pagelist()
1826 ff_layout_read_record_layoutstats_start(&hdr->task, hdr); 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()
1856 loff_t offset = hdr->args.offset; in ff_layout_write_pagelist()
1859 u32 idx = hdr->pgio_mirror_idx; in ff_layout_write_pagelist()
1867 hdr->inode); in ff_layout_write_pagelist()
1871 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_write_pagelist()
1878 __func__, hdr->inode->i_ino, sync, (size_t) hdr->args.count, in ff_layout_write_pagelist()
1882 hdr->pgio_done_cb = ff_layout_write_done_cb; in ff_layout_write_pagelist()
1884 hdr->ds_clp = ds->ds_clp; in ff_layout_write_pagelist()
1885 hdr->ds_commit_idx = idx; in ff_layout_write_pagelist()
1888 hdr->args.fh = fh; in ff_layout_write_pagelist()
1890 nfs4_ff_layout_select_ds_stateid(mirror, &hdr->args.stateid); in ff_layout_write_pagelist()
1896 hdr->args.offset = offset; in ff_layout_write_pagelist()
1902 hdr->task.tk_start = ktime_get(); in ff_layout_write_pagelist()
1903 ff_layout_write_record_layoutstats_start(&hdr->task, hdr); in ff_layout_write_pagelist()
1907 nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops, in ff_layout_write_pagelist()
1917 trace_pnfs_mds_fallback_write_pagelist(hdr->inode, in ff_layout_write_pagelist()
1918 hdr->args.offset, hdr->args.count, in ff_layout_write_pagelist()
1919 IOMODE_RW, NFS_I(hdr->inode)->layout, lseg); in ff_layout_write_pagelist()
2012 const struct nfs_pgio_header *hdr, in ff_layout_match_rw() argument
2015 return hdr->lseg == lseg; in ff_layout_match_rw()