Lines Matching refs:lseg

341 		struct pnfs_layout_segment *lseg,  in ff_layout_add_lseg()  argument
344 pnfs_generic_layout_insert_lseg(lo, lseg, in ff_layout_add_lseg()
565 struct pnfs_layout_segment *lseg; in ff_layout_has_rw_segments() local
567 list_for_each_entry(lseg, &layout->plh_segs, pls_list) in ff_layout_has_rw_segments()
568 if (lseg->pls_range.iomode == IOMODE_RW) in ff_layout_has_rw_segments()
575 ff_layout_free_lseg(struct pnfs_layout_segment *lseg) in ff_layout_free_lseg() argument
577 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_free_lseg()
581 if (lseg->pls_range.iomode == IOMODE_RW) { in ff_layout_free_lseg()
585 ffl = FF_LAYOUT_FROM_HDR(lseg->pls_layout); in ff_layout_free_lseg()
588 if (!ff_layout_has_rw_segments(lseg->pls_layout)) { in ff_layout_free_lseg()
750 ff_layout_alloc_commit_info(struct pnfs_layout_segment *lseg, in ff_layout_alloc_commit_info() argument
754 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_alloc_commit_info()
767 size = ff_layout_get_lseg_count(fls) * FF_LAYOUT_MIRROR_COUNT(lseg); in ff_layout_alloc_commit_info()
796 ff_layout_mark_ds_unreachable(struct pnfs_layout_segment *lseg, int idx) in ff_layout_mark_ds_unreachable() argument
798 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_mark_ds_unreachable()
805 ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, int idx) in ff_layout_mark_ds_reachable() argument
807 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_mark_ds_reachable()
814 ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_ds_for_read() argument
818 struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg); in ff_layout_choose_ds_for_read()
829 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_choose_ds_for_read()
830 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, fail_return); in ff_layout_choose_ds_for_read()
846 ff_layout_choose_any_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_any_ds_for_read() argument
849 return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, false); in ff_layout_choose_any_ds_for_read()
853 ff_layout_choose_valid_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_valid_ds_for_read() argument
856 return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, true); in ff_layout_choose_valid_ds_for_read()
860 ff_layout_choose_best_ds_for_read(struct pnfs_layout_segment *lseg, in ff_layout_choose_best_ds_for_read() argument
865 ds = ff_layout_choose_valid_ds_for_read(lseg, start_idx, best_idx); in ff_layout_choose_best_ds_for_read()
868 return ff_layout_choose_any_ds_for_read(lseg, start_idx, best_idx); in ff_layout_choose_best_ds_for_read()
1100 hdr->lseg); in ff_layout_reset_write()
1123 hdr->lseg); in ff_layout_reset_read()
1131 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error_v4() argument
1134 struct pnfs_layout_hdr *lo = lseg->pls_layout; in ff_layout_async_handle_error_v4()
1136 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_async_handle_error_v4()
1192 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_async_handle_error_v4()
1205 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error_v3() argument
1208 struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); in ff_layout_async_handle_error_v3()
1220 nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); in ff_layout_async_handle_error_v3()
1240 struct pnfs_layout_segment *lseg, in ff_layout_async_handle_error() argument
1246 ff_layout_mark_ds_reachable(lseg, idx); in ff_layout_async_handle_error()
1251 if (!pnfs_is_valid_lseg(lseg)) in ff_layout_async_handle_error()
1256 return ff_layout_async_handle_error_v3(task, lseg, idx); in ff_layout_async_handle_error()
1259 lseg, idx); in ff_layout_async_handle_error()
1267 static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg, in ff_layout_io_track_ds_error() argument
1307 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_io_track_ds_error()
1308 err = ff_layout_track_ds_error(FF_LAYOUT_FROM_HDR(lseg->pls_layout), in ff_layout_io_track_ds_error()
1312 ff_layout_mark_ds_unreachable(lseg, idx); in ff_layout_io_track_ds_error()
1313 pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode, lseg); in ff_layout_io_track_ds_error()
1326 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_read_done_cb()
1331 hdr->ds_clp, hdr->lseg, in ff_layout_read_done_cb()
1338 if (ff_layout_choose_best_ds_for_read(hdr->lseg, in ff_layout_read_done_cb()
1354 ff_layout_send_layouterror(hdr->lseg); in ff_layout_read_done_cb()
1362 ff_layout_need_layoutcommit(struct pnfs_layout_segment *lseg) in ff_layout_need_layoutcommit() argument
1364 return !(FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_LAYOUTCOMMIT); in ff_layout_need_layoutcommit()
1378 struct pnfs_layout_segment *lseg, in ff_layout_set_layoutcommit() argument
1381 if (!ff_layout_need_layoutcommit(lseg)) in ff_layout_set_layoutcommit()
1384 pnfs_set_layoutcommit(inode, lseg, end_offset); in ff_layout_set_layoutcommit()
1395 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_start()
1406 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_read_record_layoutstats_done()
1409 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_read_record_layoutstats_done()
1483 ff_layout_send_layouterror(hdr->lseg); in ff_layout_read_release()
1499 ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, in ff_layout_write_done_cb()
1504 hdr->ds_clp, hdr->lseg, in ff_layout_write_done_cb()
1525 ff_layout_set_layoutcommit(hdr->inode, hdr->lseg, end_offs); in ff_layout_write_done_cb()
1542 ff_layout_io_track_ds_error(data->lseg, data->ds_commit_index, in ff_layout_commit_done_cb()
1547 data->lseg, data->ds_commit_index); in ff_layout_commit_done_cb()
1561 ff_layout_set_layoutcommit(data->inode, data->lseg, data->lwb); in ff_layout_commit_done_cb()
1572 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_start()
1583 FF_LAYOUT_COMP(hdr->lseg, hdr->pgio_mirror_idx), in ff_layout_write_record_layoutstats_done()
1586 set_bit(NFS_LSEG_LAYOUTRETURN, &hdr->lseg->pls_flags); in ff_layout_write_record_layoutstats_done()
1653 ff_layout_send_layouterror(hdr->lseg); in ff_layout_write_release()
1666 FF_LAYOUT_COMP(cdata->lseg, cdata->ds_commit_index), in ff_layout_commit_record_layoutstats_start()
1684 FF_LAYOUT_COMP(cdata->lseg, cdata->ds_commit_index), in ff_layout_commit_record_layoutstats_done()
1686 set_bit(NFS_LSEG_LAYOUTRETURN, &cdata->lseg->pls_flags); in ff_layout_commit_record_layoutstats_done()
1780 struct pnfs_layout_segment *lseg = hdr->lseg; in ff_layout_read_pagelist() local
1794 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_read_pagelist()
1795 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, false); in ff_layout_read_pagelist()
1804 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
1860 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_write_pagelist()
1861 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true); in ff_layout_write_pagelist()
1870 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred); in ff_layout_write_pagelist()
1906 if (ff_layout_avoid_mds_available_ds(lseg)) in ff_layout_write_pagelist()
1910 IOMODE_RW, NFS_I(hdr->inode)->layout, lseg); in ff_layout_write_pagelist()
1914 static u32 calc_ds_index_from_commit(struct pnfs_layout_segment *lseg, u32 i) in calc_ds_index_from_commit() argument
1920 select_ds_fh_from_commit(struct pnfs_layout_segment *lseg, u32 i) in select_ds_fh_from_commit() argument
1922 struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg); in select_ds_fh_from_commit()
1932 struct pnfs_layout_segment *lseg = data->lseg; in ff_layout_initiate_commit() local
1941 if (!lseg || !(pnfs_is_valid_lseg(lseg) || in ff_layout_initiate_commit()
1942 test_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags))) in ff_layout_initiate_commit()
1945 idx = calc_ds_index_from_commit(lseg, data->ds_commit_index); in ff_layout_initiate_commit()
1946 mirror = FF_LAYOUT_COMP(lseg, idx); in ff_layout_initiate_commit()
1947 ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true); in ff_layout_initiate_commit()
1956 ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, data->cred); in ff_layout_initiate_commit()
1969 fh = select_ds_fh_from_commit(lseg, data->ds_commit_index); in ff_layout_initiate_commit()
2192 ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) in ff_layout_send_layouterror() argument
2194 struct pnfs_layout_hdr *lo = lseg->pls_layout; in ff_layout_send_layouterror()
2200 ff_layout_fetch_ds_ioerr(lo, &lseg->pls_range, &head, -1); in ff_layout_send_layouterror()
2221 if (nfs42_proc_layouterror(lseg, errors, n) < 0) in ff_layout_send_layouterror()
2231 ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) in ff_layout_send_layouterror() argument