Lines Matching refs:lseg
343 struct pnfs_layout_segment *lseg, in ff_layout_add_lseg() argument
346 pnfs_generic_layout_insert_lseg(lo, lseg, in ff_layout_add_lseg()
560 ff_layout_free_lseg(struct pnfs_layout_segment *lseg) in ff_layout_free_lseg() argument
562 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_free_lseg()
566 if (lseg->pls_range.iomode == IOMODE_RW) { in ff_layout_free_lseg()
570 ffl = FF_LAYOUT_FROM_HDR(lseg->pls_layout); in ff_layout_free_lseg()
573 pnfs_generic_ds_cinfo_release_lseg(&ffl->commit_info, lseg); in ff_layout_free_lseg()
724 ff_layout_mark_ds_unreachable(struct pnfs_layout_segment *lseg, u32 idx) in ff_layout_mark_ds_unreachable() argument
726 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_mark_ds_unreachable()
733 ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, u32 idx) in ff_layout_mark_ds_reachable() argument
735 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_mark_ds_reachable()
742 ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_ds_for_read() argument
746 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_choose_ds_for_read()
753 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_choose_ds_for_read()
754 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, false); in ff_layout_choose_ds_for_read()
770 ff_layout_choose_any_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_any_ds_for_read() argument
773 return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, false); in ff_layout_choose_any_ds_for_read()
777 ff_layout_choose_valid_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_valid_ds_for_read() argument
780 return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, true); in ff_layout_choose_valid_ds_for_read()
784 ff_layout_choose_best_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_best_ds_for_read() argument
789 ds = ff_layout_choose_valid_ds_for_read(lseg, start_idx, best_idx); in ff_layout_choose_best_ds_for_read()
792 return ff_layout_choose_any_ds_for_read(lseg, start_idx, best_idx); in ff_layout_choose_best_ds_for_read()
799 struct pnfs_layout_segment *lseg = pgio->pg_lseg; in ff_layout_get_ds_for_read() local
802 ds = ff_layout_choose_best_ds_for_read(lseg, pgio->pg_mirror_idx, in ff_layout_get_ds_for_read()
806 return ff_layout_choose_best_ds_for_read(lseg, 0, best_idx); in ff_layout_get_ds_for_read()
1042 hdr->lseg); in ff_layout_reset_write()
1052 if (ff_layout_choose_any_ds_for_read(hdr->lseg, idx, &new_idx)) in ff_layout_resend_pnfs_read()
1053 ff_layout_send_layouterror(hdr->lseg); in ff_layout_resend_pnfs_read()
1055 pnfs_error_mark_layout_for_return(hdr->inode, hdr->lseg); in ff_layout_resend_pnfs_read()
1064 pnfs_error_mark_layout_for_return(hdr->inode, hdr->lseg); in ff_layout_reset_read()
1078 hdr->lseg); in ff_layout_reset_read()
1086 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error_v4() argument
1089 struct pnfs_layout_hdr *lo = lseg->pls_layout; in ff_layout_async_handle_error_v4()
1091 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_async_handle_error_v4()
1149 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_async_handle_error_v4()
1162 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error_v3() argument
1165 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_async_handle_error_v3()
1177 nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); in ff_layout_async_handle_error_v3()
1197 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error() argument
1203 ff_layout_mark_ds_reachable(lseg, idx); in ff_layout_async_handle_error()
1208 if (!pnfs_is_valid_lseg(lseg)) in ff_layout_async_handle_error()
1213 return ff_layout_async_handle_error_v3(task, lseg, idx); in ff_layout_async_handle_error()
1216 lseg, idx); in ff_layout_async_handle_error()
1224 static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg, in ff_layout_io_track_ds_error() argument
1260 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_io_track_ds_error()
1261 err = ff_layout_track_ds_error(FF_LAYOUT_FROM_HDR(lseg->pls_layout), in ff_layout_io_track_ds_error()
1270 ff_layout_mark_ds_unreachable(lseg, idx); in ff_layout_io_track_ds_error()
1279 pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode, in ff_layout_io_track_ds_error()
1280 lseg); in ff_layout_io_track_ds_error()
1293 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_read_done_cb()
1301 hdr->ds_clp, hdr->lseg, in ff_layout_read_done_cb()
1325 ff_layout_need_layoutcommit(struct pnfs_layout_segment *lseg) in ff_layout_need_layoutcommit() argument
1327 return !(FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_LAYOUTCOMMIT); in ff_layout_need_layoutcommit()
1341 struct pnfs_layout_segment *lseg, in ff_layout_set_layoutcommit() argument
1344 if (!ff_layout_need_layoutcommit(lseg)) in ff_layout_set_layoutcommit()
1347 pnfs_set_layoutcommit(inode, lseg, end_offset); in ff_layout_set_layoutcommit()
1358 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_start()
1369 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_done()
1372 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_read_record_layoutstats_done()
1383 if (!pnfs_is_valid_lseg(hdr->lseg)) { in ff_layout_read_prepare_common()
1463 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_write_done_cb()
1471 hdr->ds_clp, hdr->lseg, in ff_layout_write_done_cb()
1493 ff_layout_set_layoutcommit(hdr->inode, hdr->lseg, end_offs); in ff_layout_write_done_cb()
1509 ff_layout_io_track_ds_error(data->lseg, data->ds_commit_index, in ff_layout_commit_done_cb()
1517 data->lseg, data->ds_commit_index); in ff_layout_commit_done_cb()
1532 ff_layout_set_layoutcommit(data->inode, data->lseg, data->lwb); in ff_layout_commit_done_cb()
1543 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_start()
1554 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_done()
1557 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_write_record_layoutstats_done()
1568 if (!pnfs_is_valid_lseg(hdr->lseg)) { in ff_layout_write_prepare_common()
1629 ff_layout_send_layouterror(hdr->lseg); in ff_layout_write_release()
1642 FF_LAYOUT_COMP(cdata->lseg, cdata->ds_commit_index), in ff_layout_commit_record_layoutstats_start()
1660 FF_LAYOUT_COMP(cdata->lseg, cdata->ds_commit_index), in ff_layout_commit_record_layoutstats_done()
1662 set_bit(NFS_LSEG_LAYOUTRETURN, &cdata->lseg->pls_flags); in ff_layout_commit_record_layoutstats_done()
1668 if (!pnfs_is_valid_lseg(cdata->lseg)) { in ff_layout_commit_prepare_common()
1764 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_read_pagelist() local
1778 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_read_pagelist()
1779 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, false); in ff_layout_read_pagelist()
1788 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_read_pagelist()
1822 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_read_pagelist()
1826 IOMODE_READ, NFS_I(hdr->inode)->layout, lseg); in ff_layout_read_pagelist()
1834 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_write_pagelist() local
1844 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_write_pagelist()
1845 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true); in ff_layout_write_pagelist()
1854 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_write_pagelist()
1890 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_write_pagelist()
1894 IOMODE_RW, NFS_I(hdr->inode)->layout, lseg); in ff_layout_write_pagelist()
1898 static u32 calc_ds_index_from_commit(struct pnfs_layout_segment *lseg, u32 i) in calc_ds_index_from_commit() argument
1904 select_ds_fh_from_commit(struct pnfs_layout_segment *lseg, u32 i) in select_ds_fh_from_commit() argument
1906 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in select_ds_fh_from_commit()
1916 struct pnfs_layout_segment *lseg = data->lseg; in ff_layout_initiate_commit() local
1925 if (!lseg || !(pnfs_is_valid_lseg(lseg) || in ff_layout_initiate_commit()
1926 test_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags))) in ff_layout_initiate_commit()
1929 idx = calc_ds_index_from_commit(lseg, data->ds_commit_index); in ff_layout_initiate_commit()
1930 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_initiate_commit()
1931 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true); in ff_layout_initiate_commit()
1940 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, data->cred); in ff_layout_initiate_commit()
1953 fh = select_ds_fh_from_commit(lseg, data->ds_commit_index); in ff_layout_initiate_commit()
1979 const struct pnfs_layout_segment *lseg) in ff_layout_match_rw() argument
1981 return hdr->lseg == lseg; in ff_layout_match_rw()
1986 const struct pnfs_layout_segment *lseg) in ff_layout_match_commit() argument
1988 return cdata->lseg == lseg; in ff_layout_match_commit()
2006 static void ff_layout_cancel_io(struct pnfs_layout_segment *lseg) in ff_layout_cancel_io() argument
2008 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in ff_layout_cancel_io()
2030 if (!rpc_cancel_tasks(clnt, -EAGAIN, ff_layout_match_io, lseg)) in ff_layout_cancel_io()
2049 struct pnfs_layout_segment *lseg) in ff_layout_setup_ds_info() argument
2051 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in ff_layout_setup_ds_info()
2052 struct inode *inode = lseg->pls_layout->plh_inode; in ff_layout_setup_ds_info()
2059 array = pnfs_add_commit_array(fl_cinfo, new, lseg); in ff_layout_setup_ds_info()
2264 ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) in ff_layout_send_layouterror() argument
2266 struct pnfs_layout_hdr *lo = lseg->pls_layout; in ff_layout_send_layouterror()
2272 ff_layout_fetch_ds_ioerr(lo, &lseg->pls_range, &head, -1); in ff_layout_send_layouterror()
2293 if (nfs42_proc_layouterror(lseg, errors, n) < 0) in ff_layout_send_layouterror()
2303 ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) in ff_layout_send_layouterror() argument