Lines Matching refs:lseg

359 		struct pnfs_layout_segment *lseg,  in ff_layout_add_lseg()  argument
362 pnfs_generic_layout_insert_lseg(lo, lseg, in ff_layout_add_lseg()
576 ff_layout_free_lseg(struct pnfs_layout_segment *lseg) in ff_layout_free_lseg() argument
578 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_free_lseg()
582 if (lseg->pls_range.iomode == IOMODE_RW) { in ff_layout_free_lseg()
586 ffl = FF_LAYOUT_FROM_HDR(lseg->pls_layout); in ff_layout_free_lseg()
589 pnfs_generic_ds_cinfo_release_lseg(&ffl->commit_info, lseg); in ff_layout_free_lseg()
740 ff_layout_mark_ds_unreachable(struct pnfs_layout_segment *lseg, u32 idx) in ff_layout_mark_ds_unreachable() argument
742 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_mark_ds_unreachable()
749 ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, u32 idx) in ff_layout_mark_ds_reachable() argument
751 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_mark_ds_reachable()
758 ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_ds_for_read() argument
762 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_choose_ds_for_read()
769 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_choose_ds_for_read()
770 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, false); in ff_layout_choose_ds_for_read()
786 ff_layout_choose_any_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_any_ds_for_read() argument
789 return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, false); in ff_layout_choose_any_ds_for_read()
793 ff_layout_choose_valid_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_valid_ds_for_read() argument
796 return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, true); in ff_layout_choose_valid_ds_for_read()
800 ff_layout_choose_best_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_best_ds_for_read() argument
805 ds = ff_layout_choose_valid_ds_for_read(lseg, start_idx, best_idx); in ff_layout_choose_best_ds_for_read()
808 return ff_layout_choose_any_ds_for_read(lseg, start_idx, best_idx); in ff_layout_choose_best_ds_for_read()
815 struct pnfs_layout_segment *lseg = pgio->pg_lseg; in ff_layout_get_ds_for_read() local
818 ds = ff_layout_choose_best_ds_for_read(lseg, pgio->pg_mirror_idx, in ff_layout_get_ds_for_read()
822 return ff_layout_choose_best_ds_for_read(lseg, 0, best_idx); in ff_layout_get_ds_for_read()
1050 hdr->lseg); in ff_layout_reset_write()
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()
1072 pnfs_error_mark_layout_for_return(hdr->inode, hdr->lseg); in ff_layout_reset_read()
1086 hdr->lseg); in ff_layout_reset_read()
1094 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error_v4() argument
1097 struct pnfs_layout_hdr *lo = lseg->pls_layout; in ff_layout_async_handle_error_v4()
1099 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_async_handle_error_v4()
1157 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_async_handle_error_v4()
1170 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error_v3() argument
1173 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_async_handle_error_v3()
1185 nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); in ff_layout_async_handle_error_v3()
1205 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error() argument
1211 ff_layout_mark_ds_reachable(lseg, idx); in ff_layout_async_handle_error()
1216 if (!pnfs_is_valid_lseg(lseg)) in ff_layout_async_handle_error()
1221 return ff_layout_async_handle_error_v3(task, lseg, idx); in ff_layout_async_handle_error()
1224 lseg, idx); in ff_layout_async_handle_error()
1232 static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg, in ff_layout_io_track_ds_error() argument
1268 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_io_track_ds_error()
1269 err = ff_layout_track_ds_error(FF_LAYOUT_FROM_HDR(lseg->pls_layout), in ff_layout_io_track_ds_error()
1278 ff_layout_mark_ds_unreachable(lseg, idx); in ff_layout_io_track_ds_error()
1287 pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode, in ff_layout_io_track_ds_error()
1288 lseg); in ff_layout_io_track_ds_error()
1301 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_read_done_cb()
1309 hdr->ds_clp, hdr->lseg, in ff_layout_read_done_cb()
1333 ff_layout_need_layoutcommit(struct pnfs_layout_segment *lseg) in ff_layout_need_layoutcommit() argument
1335 return !(FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_LAYOUTCOMMIT); in ff_layout_need_layoutcommit()
1349 struct pnfs_layout_segment *lseg, in ff_layout_set_layoutcommit() argument
1352 if (!ff_layout_need_layoutcommit(lseg)) in ff_layout_set_layoutcommit()
1355 pnfs_set_layoutcommit(inode, lseg, end_offset); in ff_layout_set_layoutcommit()
1366 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_start()
1377 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_done()
1380 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_read_record_layoutstats_done()
1391 if (!pnfs_is_valid_lseg(hdr->lseg)) { in ff_layout_read_prepare_common()
1471 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_write_done_cb()
1479 hdr->ds_clp, hdr->lseg, in ff_layout_write_done_cb()
1501 ff_layout_set_layoutcommit(hdr->inode, hdr->lseg, end_offs); in ff_layout_write_done_cb()
1517 ff_layout_io_track_ds_error(data->lseg, data->ds_commit_index, in ff_layout_commit_done_cb()
1525 data->lseg, data->ds_commit_index); in ff_layout_commit_done_cb()
1540 ff_layout_set_layoutcommit(data->inode, data->lseg, data->lwb); in ff_layout_commit_done_cb()
1551 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_start()
1562 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_done()
1565 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_write_record_layoutstats_done()
1576 if (!pnfs_is_valid_lseg(hdr->lseg)) { in ff_layout_write_prepare_common()
1637 ff_layout_send_layouterror(hdr->lseg); in ff_layout_write_release()
1650 FF_LAYOUT_COMP(cdata->lseg, cdata->ds_commit_index), in ff_layout_commit_record_layoutstats_start()
1668 FF_LAYOUT_COMP(cdata->lseg, cdata->ds_commit_index), in ff_layout_commit_record_layoutstats_done()
1670 set_bit(NFS_LSEG_LAYOUTRETURN, &cdata->lseg->pls_flags); in ff_layout_commit_record_layoutstats_done()
1676 if (!pnfs_is_valid_lseg(cdata->lseg)) { in ff_layout_commit_prepare_common()
1772 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_read_pagelist() local
1787 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_read_pagelist()
1788 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, false); in ff_layout_read_pagelist()
1797 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_read_pagelist()
1838 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_read_pagelist()
1842 IOMODE_READ, NFS_I(hdr->inode)->layout, lseg); in ff_layout_read_pagelist()
1850 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_write_pagelist() local
1861 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_write_pagelist()
1862 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true); in ff_layout_write_pagelist()
1871 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_write_pagelist()
1915 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_write_pagelist()
1919 IOMODE_RW, NFS_I(hdr->inode)->layout, lseg); in ff_layout_write_pagelist()
1923 static u32 calc_ds_index_from_commit(struct pnfs_layout_segment *lseg, u32 i) in calc_ds_index_from_commit() argument
1929 select_ds_fh_from_commit(struct pnfs_layout_segment *lseg, u32 i) in select_ds_fh_from_commit() argument
1931 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in select_ds_fh_from_commit()
1941 struct pnfs_layout_segment *lseg = data->lseg; in ff_layout_initiate_commit() local
1951 if (!lseg || !(pnfs_is_valid_lseg(lseg) || in ff_layout_initiate_commit()
1952 test_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags))) in ff_layout_initiate_commit()
1955 idx = calc_ds_index_from_commit(lseg, data->ds_commit_index); in ff_layout_initiate_commit()
1956 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_initiate_commit()
1957 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true); in ff_layout_initiate_commit()
1966 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, data->cred); in ff_layout_initiate_commit()
1979 fh = select_ds_fh_from_commit(lseg, data->ds_commit_index); in ff_layout_initiate_commit()
2013 const struct pnfs_layout_segment *lseg) in ff_layout_match_rw() argument
2015 return hdr->lseg == lseg; in ff_layout_match_rw()
2020 const struct pnfs_layout_segment *lseg) in ff_layout_match_commit() argument
2022 return cdata->lseg == lseg; in ff_layout_match_commit()
2040 static void ff_layout_cancel_io(struct pnfs_layout_segment *lseg) in ff_layout_cancel_io() argument
2042 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in ff_layout_cancel_io()
2064 if (!rpc_cancel_tasks(clnt, -EAGAIN, ff_layout_match_io, lseg)) in ff_layout_cancel_io()
2083 struct pnfs_layout_segment *lseg) in ff_layout_setup_ds_info() argument
2085 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in ff_layout_setup_ds_info()
2086 struct inode *inode = lseg->pls_layout->plh_inode; in ff_layout_setup_ds_info()
2093 array = pnfs_add_commit_array(fl_cinfo, new, lseg); in ff_layout_setup_ds_info()
2292 ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) in ff_layout_send_layouterror() argument
2294 struct pnfs_layout_hdr *lo = lseg->pls_layout; in ff_layout_send_layouterror()
2300 ff_layout_fetch_ds_ioerr(lo, &lseg->pls_range, &head, -1); in ff_layout_send_layouterror()
2321 if (nfs42_proc_layouterror(lseg, errors, n) < 0) in ff_layout_send_layouterror()
2331 ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) in ff_layout_send_layouterror() argument