Lines Matching refs:cnt_cur

479 	struct xfs_btree_cur	*cnt_cur)  in xfs_alloc_cursor_at_lastrec()  argument
485 block = xfs_btree_get_block(cnt_cur, 0, &bp); in xfs_alloc_cursor_at_lastrec()
487 xfs_btree_get_sibling(cnt_cur, block, &ptr, XFS_BB_RIGHTSIB); in xfs_alloc_cursor_at_lastrec()
488 return xfs_btree_ptr_is_null(cnt_cur, &ptr); in xfs_alloc_cursor_at_lastrec()
498 struct xfs_btree_cur *cnt_cur, in xfs_cntbt_longest() argument
506 memset(&cnt_cur->bc_rec, 0xFF, sizeof(cnt_cur->bc_rec)); in xfs_cntbt_longest()
507 error = xfs_btree_lookup(cnt_cur, XFS_LOOKUP_LE, &stat); in xfs_cntbt_longest()
516 error = xfs_btree_get_rec(cnt_cur, &rec, &stat); in xfs_cntbt_longest()
519 if (XFS_IS_CORRUPT(cnt_cur->bc_mp, !stat)) { in xfs_cntbt_longest()
520 xfs_btree_mark_sick(cnt_cur); in xfs_cntbt_longest()
540 struct xfs_btree_cur *cnt_cur) in xfs_alloc_fixup_longest() argument
542 struct xfs_perag *pag = cnt_cur->bc_ag.pag; in xfs_alloc_fixup_longest()
543 struct xfs_buf *bp = cnt_cur->bc_ag.agbp; in xfs_alloc_fixup_longest()
549 error = xfs_cntbt_longest(cnt_cur, &longest); in xfs_alloc_fixup_longest()
555 xfs_alloc_log_agf(cnt_cur->bc_tp, bp, XFS_AGF_LONGEST); in xfs_alloc_fixup_longest()
569 struct xfs_btree_cur *cnt_cur, /* cursor for by-size btree */ in xfs_alloc_fixup_trees() argument
586 mp = cnt_cur->bc_mp; in xfs_alloc_fixup_trees()
593 if ((error = xfs_alloc_get_rec(cnt_cur, &nfbno1, &nflen1, &i))) in xfs_alloc_fixup_trees()
599 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
604 if ((error = xfs_alloc_lookup_eq(cnt_cur, fbno, flen, &i))) in xfs_alloc_fixup_trees()
607 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
636 if (bno_cur->bc_nlevels == 1 && cnt_cur->bc_nlevels == 1) { in xfs_alloc_fixup_trees()
641 cntblock = XFS_BUF_TO_BLOCK(cnt_cur->bc_levels[0].bp); in xfs_alloc_fixup_trees()
674 if (xfs_alloc_cursor_at_lastrec(cnt_cur)) in xfs_alloc_fixup_trees()
680 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_alloc_fixup_trees()
683 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
690 if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i))) in xfs_alloc_fixup_trees()
693 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
696 if ((error = xfs_btree_insert(cnt_cur, &i))) in xfs_alloc_fixup_trees()
699 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
704 if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i))) in xfs_alloc_fixup_trees()
707 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
710 if ((error = xfs_btree_insert(cnt_cur, &i))) in xfs_alloc_fixup_trees()
713 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_fixup_trees()
756 return xfs_alloc_fixup_longest(cnt_cur); in xfs_alloc_fixup_trees()
1321 struct xfs_btree_cur *cnt_cur;/* by count btree cursor */ in xfs_alloc_ag_vextent_exact() local
1397 cnt_cur = xfs_cntbt_init_cursor(args->mp, args->tp, args->agbp, in xfs_alloc_ag_vextent_exact()
1400 error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, args->agbno, in xfs_alloc_ag_vextent_exact()
1403 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_ERROR); in xfs_alloc_ag_vextent_exact()
1408 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_alloc_ag_vextent_exact()
1796 struct xfs_btree_cur *cnt_cur; in xfs_alloc_ag_vextent_size() local
1812 cnt_cur = xfs_cntbt_init_cursor(args->mp, args->tp, args->agbp, in xfs_alloc_ag_vextent_size()
1819 if ((error = xfs_alloc_lookup_ge(cnt_cur, 0, in xfs_alloc_ag_vextent_size()
1831 error = xfs_alloc_ag_vextent_small(args, cnt_cur, in xfs_alloc_ag_vextent_size()
1836 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_alloc_ag_vextent_size()
1848 error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, &i); in xfs_alloc_ag_vextent_size()
1852 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_ag_vextent_size()
1863 error = xfs_btree_increment(cnt_cur, 0, &i); in xfs_alloc_ag_vextent_size()
1883 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_alloc_ag_vextent_size()
1899 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_ag_vextent_size()
1914 if ((error = xfs_btree_decrement(cnt_cur, 0, &i))) in xfs_alloc_ag_vextent_size()
1918 if ((error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, in xfs_alloc_ag_vextent_size()
1922 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_ag_vextent_size()
1935 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_ag_vextent_size()
1948 if ((error = xfs_alloc_lookup_eq(cnt_cur, bestfbno, bestflen, in xfs_alloc_ag_vextent_size()
1952 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_ag_vextent_size()
1982 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_alloc_ag_vextent_size()
1991 xfs_btree_mark_sick(cnt_cur); in xfs_alloc_ag_vextent_size()
2000 if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, in xfs_alloc_ag_vextent_size()
2003 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_alloc_ag_vextent_size()
2005 cnt_cur = bno_cur = NULL; in xfs_alloc_ag_vextent_size()
2020 if (cnt_cur) in xfs_alloc_ag_vextent_size()
2021 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_ERROR); in xfs_alloc_ag_vextent_size()
2027 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_alloc_ag_vextent_size()
2048 struct xfs_btree_cur *cnt_cur; in xfs_free_ag_extent() local
2062 bno_cur = cnt_cur = NULL; in xfs_free_ag_extent()
2148 cnt_cur = xfs_cntbt_init_cursor(mp, tp, agbp, pag); in xfs_free_ag_extent()
2157 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) in xfs_free_ag_extent()
2160 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2164 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
2167 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2174 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) in xfs_free_ag_extent()
2177 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2181 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
2184 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2246 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) in xfs_free_ag_extent()
2249 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2253 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
2256 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2284 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) in xfs_free_ag_extent()
2287 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2291 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
2294 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2332 if ((error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i))) in xfs_free_ag_extent()
2335 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2339 if (xfs_alloc_cursor_at_lastrec(cnt_cur)) in xfs_free_ag_extent()
2341 if ((error = xfs_btree_insert(cnt_cur, &i))) in xfs_free_ag_extent()
2344 xfs_btree_mark_sick(cnt_cur); in xfs_free_ag_extent()
2349 error = xfs_alloc_fixup_longest(cnt_cur); in xfs_free_ag_extent()
2354 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); in xfs_free_ag_extent()
2355 cnt_cur = NULL; in xfs_free_ag_extent()
2376 if (cnt_cur) in xfs_free_ag_extent()
2377 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_ERROR); in xfs_free_ag_extent()
2779 struct xfs_btree_cur *cnt_cur; in xfs_exact_minlen_extent_available() local
2784 cnt_cur = xfs_cntbt_init_cursor(args->mp, args->tp, agbp, in xfs_exact_minlen_extent_available()
2786 error = xfs_alloc_lookup_ge(cnt_cur, 0, args->minlen, stat); in xfs_exact_minlen_extent_available()
2791 xfs_btree_mark_sick(cnt_cur); in xfs_exact_minlen_extent_available()
2796 error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, stat); in xfs_exact_minlen_extent_available()
2804 xfs_btree_del_cursor(cnt_cur, error); in xfs_exact_minlen_extent_available()