Lines Matching refs:cur

32  * in the btree given by cur.
36 struct xfs_btree_cur *cur,
47 cur->bc_rec.r.rm_startblock = bno;
48 cur->bc_rec.r.rm_blockcount = 0;
49 cur->bc_rec.r.rm_owner = owner;
50 cur->bc_rec.r.rm_offset = offset;
51 cur->bc_rec.r.rm_flags = flags;
53 error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
57 error = xfs_rmap_get_rec(cur, irec, &get_stat);
61 xfs_btree_mark_sick(cur);
70 * in the btree given by cur.
74 struct xfs_btree_cur *cur,
82 cur->bc_rec.r.rm_startblock = bno;
83 cur->bc_rec.r.rm_blockcount = len;
84 cur->bc_rec.r.rm_owner = owner;
85 cur->bc_rec.r.rm_offset = offset;
86 cur->bc_rec.r.rm_flags = flags;
87 return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
91 * Update the record referred to by cur to the value given
97 struct xfs_btree_cur *cur,
103 trace_xfs_rmap_update(cur->bc_mp, cur->bc_ag.pag->pag_agno,
112 error = xfs_btree_update(cur, &rec);
114 trace_xfs_rmap_update_error(cur->bc_mp,
115 cur->bc_ag.pag->pag_agno, error, _RET_IP_);
274 struct xfs_btree_cur *cur,
277 if (xfs_btree_is_mem_rmap(cur->bc_ops))
278 return xfs_rmap_check_irec(cur->bc_mem.pag, irec);
279 return xfs_rmap_check_irec(cur->bc_ag.pag, irec);
284 struct xfs_btree_cur *cur,
288 struct xfs_mount *mp = cur->bc_mp;
290 if (xfs_btree_is_mem_rmap(cur->bc_ops))
296 cur->bc_ag.pag->pag_agno, fa);
301 xfs_btree_mark_sick(cur);
310 struct xfs_btree_cur *cur,
318 error = xfs_btree_get_rec(cur, &rec, stat);
324 fa = xfs_rmap_check_btrec(cur, irec);
326 return xfs_rmap_complain_bad_rec(cur, fa, irec);
339 struct xfs_btree_cur *cur,
345 trace_xfs_rmap_find_left_neighbor_candidate(cur->bc_mp,
346 cur->bc_ag.pag->pag_agno, rec->rm_startblock,
368 struct xfs_btree_cur *cur,
396 trace_xfs_rmap_find_left_neighbor_query(cur->bc_mp,
397 cur->bc_ag.pag->pag_agno, bno, 0, owner, offset, flags);
415 error = xfs_rmap_lookup_le(cur, bno, owner, offset, flags, irec,
420 error = xfs_rmap_find_left_neighbor_helper(cur, irec, &info);
422 error = xfs_rmap_query_range(cur, &info.high, &info.high,
428 trace_xfs_rmap_find_left_neighbor_result(cur->bc_mp,
429 cur->bc_ag.pag->pag_agno, irec->rm_startblock,
438 struct xfs_btree_cur *cur,
444 trace_xfs_rmap_lookup_le_range_candidate(cur->bc_mp,
445 cur->bc_ag.pag->pag_agno, rec->rm_startblock,
469 struct xfs_btree_cur *cur,
492 trace_xfs_rmap_lookup_le_range(cur->bc_mp, cur->bc_ag.pag->pag_agno,
511 error = xfs_rmap_lookup_le(cur, bno, owner, offset, flags, irec,
516 error = xfs_rmap_lookup_le_range_helper(cur, irec, &info);
518 error = xfs_rmap_query_range(cur, &info.high, &info.high,
524 trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
525 cur->bc_ag.pag->pag_agno, irec->rm_startblock,
537 struct xfs_btree_cur *cur,
545 struct xfs_mount *mp = cur->bc_mp;
555 xfs_btree_mark_sick(cur);
562 xfs_btree_mark_sick(cur);
574 xfs_btree_mark_sick(cur);
580 xfs_btree_mark_sick(cur);
586 xfs_btree_mark_sick(cur);
616 struct xfs_btree_cur *cur,
622 struct xfs_mount *mp = cur->bc_mp;
637 trace_xfs_rmap_unmap(mp, cur->bc_ag.pag->pag_agno, bno, len,
645 error = xfs_rmap_lookup_le(cur, bno, owner, offset, flags, &ltrec, &i);
649 xfs_btree_mark_sick(cur);
654 trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
655 cur->bc_ag.pag->pag_agno, ltrec.rm_startblock,
671 xfs_btree_mark_sick(cur);
689 error = xfs_btree_increment(cur, 0, &i);
694 error = xfs_rmap_get_rec(cur, &rtrec, &i);
698 xfs_btree_mark_sick(cur);
711 xfs_btree_mark_sick(cur);
717 error = xfs_rmap_free_check_owner(cur, ltoff, &ltrec, len, owner,
724 trace_xfs_rmap_delete(mp, cur->bc_ag.pag->pag_agno,
728 error = xfs_btree_delete(cur, &i);
732 xfs_btree_mark_sick(cur);
751 error = xfs_rmap_update(cur, &ltrec);
766 error = xfs_rmap_update(cur, &ltrec);
786 error = xfs_rmap_update(cur, &ltrec);
790 error = xfs_btree_increment(cur, 0, &i);
794 cur->bc_rec.r.rm_startblock = bno + len;
795 cur->bc_rec.r.rm_blockcount = orig_len - len -
797 cur->bc_rec.r.rm_owner = ltrec.rm_owner;
799 cur->bc_rec.r.rm_offset = 0;
801 cur->bc_rec.r.rm_offset = offset + len;
802 cur->bc_rec.r.rm_flags = flags;
803 trace_xfs_rmap_insert(mp, cur->bc_ag.pag->pag_agno,
804 cur->bc_rec.r.rm_startblock,
805 cur->bc_rec.r.rm_blockcount,
806 cur->bc_rec.r.rm_owner,
807 cur->bc_rec.r.rm_offset,
808 cur->bc_rec.r.rm_flags);
809 error = xfs_btree_insert(cur, &i);
815 trace_xfs_rmap_unmap_done(mp, cur->bc_ag.pag->pag_agno, bno, len,
819 trace_xfs_rmap_unmap_error(mp, cur->bc_ag.pag->pag_agno,
917 struct xfs_btree_cur *cur;
923 cur = xfs_rmapbt_init_cursor(mp, tp, agbp, pag);
925 error = xfs_rmap_unmap(cur, bno, len, false, oinfo);
927 xfs_btree_del_cursor(cur, error);
966 struct xfs_btree_cur *cur,
972 struct xfs_mount *mp = cur->bc_mp;
990 trace_xfs_rmap_map(mp, cur->bc_ag.pag->pag_agno, bno, len,
999 error = xfs_rmap_lookup_le(cur, bno, owner, offset, flags, &ltrec,
1004 trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
1005 cur->bc_ag.pag->pag_agno, ltrec.rm_startblock,
1016 xfs_btree_mark_sick(cur);
1026 error = xfs_btree_increment(cur, 0, &have_gt);
1030 error = xfs_rmap_get_rec(cur, &gtrec, &have_gt);
1034 xfs_btree_mark_sick(cur);
1039 xfs_btree_mark_sick(cur);
1043 trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
1044 cur->bc_ag.pag->pag_agno, gtrec.rm_startblock,
1083 trace_xfs_rmap_delete(mp, cur->bc_ag.pag->pag_agno,
1089 error = xfs_btree_delete(cur, &i);
1093 xfs_btree_mark_sick(cur);
1100 error = xfs_btree_decrement(cur, 0, &have_gt);
1103 error = xfs_rmap_update(cur, &ltrec);
1122 error = xfs_rmap_update(cur, &gtrec);
1130 cur->bc_rec.r.rm_startblock = bno;
1131 cur->bc_rec.r.rm_blockcount = len;
1132 cur->bc_rec.r.rm_owner = owner;
1133 cur->bc_rec.r.rm_offset = offset;
1134 cur->bc_rec.r.rm_flags = flags;
1135 trace_xfs_rmap_insert(mp, cur->bc_ag.pag->pag_agno, bno, len,
1137 error = xfs_btree_insert(cur, &i);
1141 xfs_btree_mark_sick(cur);
1147 trace_xfs_rmap_map_done(mp, cur->bc_ag.pag->pag_agno, bno, len,
1151 trace_xfs_rmap_map_error(mp, cur->bc_ag.pag->pag_agno,
1169 struct xfs_btree_cur *cur;
1175 cur = xfs_rmapbt_init_cursor(mp, tp, agbp, pag);
1177 error = xfs_rmap_map(cur, bno, len, false, oinfo);
1179 xfs_btree_del_cursor(cur, error);
1201 struct xfs_btree_cur *cur,
1207 struct xfs_mount *mp = cur->bc_mp;
1226 trace_xfs_rmap_convert(mp, cur->bc_ag.pag->pag_agno, bno, len,
1234 error = xfs_rmap_lookup_le(cur, bno, owner, offset, oldext, &PREV, &i);
1238 xfs_btree_mark_sick(cur);
1243 trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
1244 cur->bc_ag.pag->pag_agno, PREV.rm_startblock,
1267 error = xfs_btree_decrement(cur, 0, &i);
1272 error = xfs_rmap_get_rec(cur, &LEFT, &i);
1276 xfs_btree_mark_sick(cur);
1283 xfs_btree_mark_sick(cur);
1287 trace_xfs_rmap_find_left_neighbor_result(cur->bc_mp,
1288 cur->bc_ag.pag->pag_agno, LEFT.rm_startblock,
1302 error = xfs_btree_increment(cur, 0, &i);
1306 xfs_btree_mark_sick(cur);
1310 error = xfs_btree_increment(cur, 0, &i);
1315 error = xfs_rmap_get_rec(cur, &RIGHT, &i);
1319 xfs_btree_mark_sick(cur);
1324 xfs_btree_mark_sick(cur);
1328 trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
1329 cur->bc_ag.pag->pag_agno, RIGHT.rm_startblock,
1347 trace_xfs_rmap_convert_state(mp, cur->bc_ag.pag->pag_agno, state,
1351 error = xfs_rmap_lookup_le(cur, bno, owner, offset, oldext, NULL, &i);
1355 xfs_btree_mark_sick(cur);
1371 error = xfs_btree_increment(cur, 0, &i);
1375 xfs_btree_mark_sick(cur);
1379 trace_xfs_rmap_delete(mp, cur->bc_ag.pag->pag_agno,
1383 error = xfs_btree_delete(cur, &i);
1387 xfs_btree_mark_sick(cur);
1391 error = xfs_btree_decrement(cur, 0, &i);
1395 xfs_btree_mark_sick(cur);
1399 trace_xfs_rmap_delete(mp, cur->bc_ag.pag->pag_agno,
1403 error = xfs_btree_delete(cur, &i);
1407 xfs_btree_mark_sick(cur);
1411 error = xfs_btree_decrement(cur, 0, &i);
1415 xfs_btree_mark_sick(cur);
1421 error = xfs_rmap_update(cur, &NEW);
1431 trace_xfs_rmap_delete(mp, cur->bc_ag.pag->pag_agno,
1435 error = xfs_btree_delete(cur, &i);
1439 xfs_btree_mark_sick(cur);
1443 error = xfs_btree_decrement(cur, 0, &i);
1447 xfs_btree_mark_sick(cur);
1453 error = xfs_rmap_update(cur, &NEW);
1463 error = xfs_btree_increment(cur, 0, &i);
1467 xfs_btree_mark_sick(cur);
1471 trace_xfs_rmap_delete(mp, cur->bc_ag.pag->pag_agno,
1475 error = xfs_btree_delete(cur, &i);
1479 xfs_btree_mark_sick(cur);
1483 error = xfs_btree_decrement(cur, 0, &i);
1487 xfs_btree_mark_sick(cur);
1494 error = xfs_rmap_update(cur, &NEW);
1507 error = xfs_rmap_update(cur, &NEW);
1521 error = xfs_rmap_update(cur, &NEW);
1524 error = xfs_btree_decrement(cur, 0, &i);
1529 error = xfs_rmap_update(cur, &NEW);
1543 error = xfs_rmap_update(cur, &NEW);
1551 cur->bc_rec.r = NEW;
1552 trace_xfs_rmap_insert(mp, cur->bc_ag.pag->pag_agno, bno,
1554 error = xfs_btree_insert(cur, &i);
1558 xfs_btree_mark_sick(cur);
1571 error = xfs_rmap_update(cur, &NEW);
1574 error = xfs_btree_increment(cur, 0, &i);
1581 error = xfs_rmap_update(cur, &NEW);
1593 error = xfs_rmap_update(cur, &NEW);
1596 error = xfs_rmap_lookup_eq(cur, bno, len, owner, offset,
1601 xfs_btree_mark_sick(cur);
1610 cur->bc_rec.r = NEW;
1611 trace_xfs_rmap_insert(mp, cur->bc_ag.pag->pag_agno, bno,
1613 error = xfs_btree_insert(cur, &i);
1617 xfs_btree_mark_sick(cur);
1636 error = xfs_rmap_update(cur, &NEW);
1642 cur->bc_rec.r = NEW;
1643 trace_xfs_rmap_insert(mp, cur->bc_ag.pag->pag_agno,
1647 error = xfs_btree_insert(cur, &i);
1651 xfs_btree_mark_sick(cur);
1660 error = xfs_rmap_lookup_eq(cur, bno, len, owner, offset,
1665 xfs_btree_mark_sick(cur);
1670 cur->bc_rec.r.rm_flags &= ~XFS_RMAP_UNWRITTEN;
1671 cur->bc_rec.r.rm_flags |= newext;
1672 trace_xfs_rmap_insert(mp, cur->bc_ag.pag->pag_agno, bno, len,
1674 error = xfs_btree_insert(cur, &i);
1678 xfs_btree_mark_sick(cur);
1697 trace_xfs_rmap_convert_done(mp, cur->bc_ag.pag->pag_agno, bno, len,
1701 trace_xfs_rmap_convert_error(cur->bc_mp,
1702 cur->bc_ag.pag->pag_agno, error, _RET_IP_);
1713 struct xfs_btree_cur *cur,
1719 struct xfs_mount *mp = cur->bc_mp;
1738 trace_xfs_rmap_convert(mp, cur->bc_ag.pag->pag_agno, bno, len,
1746 error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, oldext,
1751 xfs_btree_mark_sick(cur);
1771 error = xfs_rmap_find_left_neighbor(cur, bno, owner, offset, newext,
1780 xfs_btree_mark_sick(cur);
1789 error = xfs_rmap_lookup_eq(cur, bno + len, len, owner, offset + len,
1795 error = xfs_rmap_get_rec(cur, &RIGHT, &i);
1799 xfs_btree_mark_sick(cur);
1804 xfs_btree_mark_sick(cur);
1808 trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
1809 cur->bc_ag.pag->pag_agno, RIGHT.rm_startblock,
1825 trace_xfs_rmap_convert_state(mp, cur->bc_ag.pag->pag_agno, state,
1838 error = xfs_rmap_delete(cur, RIGHT.rm_startblock,
1843 error = xfs_rmap_delete(cur, PREV.rm_startblock,
1849 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
1855 xfs_btree_mark_sick(cur);
1860 error = xfs_rmap_update(cur, &NEW);
1870 error = xfs_rmap_delete(cur, PREV.rm_startblock,
1876 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
1882 xfs_btree_mark_sick(cur);
1887 error = xfs_rmap_update(cur, &NEW);
1897 error = xfs_rmap_delete(cur, RIGHT.rm_startblock,
1903 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
1909 xfs_btree_mark_sick(cur);
1915 error = xfs_rmap_update(cur, &NEW);
1927 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
1933 xfs_btree_mark_sick(cur);
1938 error = xfs_rmap_update(cur, &NEW);
1949 error = xfs_rmap_delete(cur, NEW.rm_startblock,
1957 error = xfs_rmap_insert(cur, NEW.rm_startblock,
1963 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
1969 xfs_btree_mark_sick(cur);
1974 error = xfs_rmap_update(cur, &NEW);
1985 error = xfs_rmap_delete(cur, NEW.rm_startblock,
1993 error = xfs_rmap_insert(cur, NEW.rm_startblock,
1998 error = xfs_rmap_insert(cur, bno, len, owner, offset, newext);
2009 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
2015 xfs_btree_mark_sick(cur);
2020 error = xfs_rmap_update(cur, &NEW);
2024 error = xfs_rmap_delete(cur, NEW.rm_startblock,
2032 error = xfs_rmap_insert(cur, NEW.rm_startblock,
2045 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
2051 xfs_btree_mark_sick(cur);
2056 error = xfs_rmap_update(cur, &NEW);
2059 error = xfs_rmap_insert(cur, bno, len, owner, offset, newext);
2077 error = xfs_rmap_insert(cur, NEW.rm_startblock,
2084 error = xfs_rmap_lookup_eq(cur, NEW.rm_startblock,
2090 xfs_btree_mark_sick(cur);
2095 error = xfs_rmap_update(cur, &NEW);
2104 error = xfs_rmap_insert(cur, NEW.rm_startblock,
2124 trace_xfs_rmap_convert_done(mp, cur->bc_ag.pag->pag_agno, bno, len,
2128 trace_xfs_rmap_convert_error(cur->bc_mp,
2129 cur->bc_ag.pag->pag_agno, error, _RET_IP_);
2149 struct xfs_btree_cur *cur,
2155 struct xfs_mount *mp = cur->bc_mp;
2167 trace_xfs_rmap_unmap(mp, cur->bc_ag.pag->pag_agno, bno, len,
2175 error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, flags,
2180 xfs_btree_mark_sick(cur);
2191 xfs_btree_mark_sick(cur);
2198 xfs_btree_mark_sick(cur);
2207 xfs_btree_mark_sick(cur);
2214 xfs_btree_mark_sick(cur);
2219 xfs_btree_mark_sick(cur);
2226 error = xfs_rmap_delete(cur, ltrec.rm_startblock,
2244 error = xfs_rmap_delete(cur, ltrec.rm_startblock,
2254 error = xfs_rmap_insert(cur, ltrec.rm_startblock,
2270 error = xfs_rmap_lookup_eq(cur, ltrec.rm_startblock,
2276 xfs_btree_mark_sick(cur);
2281 error = xfs_rmap_update(cur, &ltrec);
2300 error = xfs_rmap_lookup_eq(cur, ltrec.rm_startblock,
2306 xfs_btree_mark_sick(cur);
2311 error = xfs_rmap_update(cur, &ltrec);
2316 error = xfs_rmap_insert(cur, bno + len,
2324 trace_xfs_rmap_unmap_done(mp, cur->bc_ag.pag->pag_agno, bno, len,
2328 trace_xfs_rmap_unmap_error(cur->bc_mp,
2329 cur->bc_ag.pag->pag_agno, error, _RET_IP_);
2344 struct xfs_btree_cur *cur,
2350 struct xfs_mount *mp = cur->bc_mp;
2364 trace_xfs_rmap_map(mp, cur->bc_ag.pag->pag_agno, bno, len,
2368 error = xfs_rmap_find_left_neighbor(cur, bno, owner, offset, flags,
2377 error = xfs_rmap_lookup_eq(cur, bno + len, len, owner, offset + len,
2382 error = xfs_rmap_get_rec(cur, &gtrec, &have_gt);
2386 xfs_btree_mark_sick(cur);
2390 trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
2391 cur->bc_ag.pag->pag_agno, gtrec.rm_startblock,
2425 error = xfs_rmap_delete(cur, gtrec.rm_startblock,
2433 error = xfs_rmap_lookup_eq(cur, ltrec.rm_startblock,
2439 xfs_btree_mark_sick(cur);
2444 error = xfs_rmap_update(cur, &ltrec);
2460 error = xfs_rmap_delete(cur, gtrec.rm_startblock,
2470 error = xfs_rmap_insert(cur, gtrec.rm_startblock,
2480 error = xfs_rmap_insert(cur, bno, len, owner, offset, flags);
2485 trace_xfs_rmap_map_done(mp, cur->bc_ag.pag->pag_agno, bno, len,
2489 trace_xfs_rmap_map_error(cur->bc_mp,
2490 cur->bc_ag.pag->pag_agno, error, _RET_IP_);
2497 struct xfs_btree_cur *cur,
2508 return xfs_rmap_map(cur, rmap->rm_startblock,
2513 return xfs_rmap_map_shared(cur, rmap->rm_startblock,
2527 struct xfs_btree_cur *cur,
2537 fa = xfs_rmap_check_btrec(cur, &irec);
2539 return xfs_rmap_complain_bad_rec(cur, fa, &irec);
2541 return query->fn(cur, &irec, query->priv);
2547 struct xfs_btree_cur *cur,
2557 return xfs_btree_query_range(cur, &low_brec, &high_brec,
2564 struct xfs_btree_cur *cur,
2572 return xfs_btree_query_all(cur, xfs_rmap_query_range_helper, &query);
2887 struct xfs_btree_cur *cur,
2903 return xfs_btree_has_records(cur, &low, &high, &mask, outcome);
2965 struct xfs_btree_cur *cur,
3004 if (xfs_rmap_shareable(cur->bc_mp, &roc->good) ^
3005 xfs_rmap_shareable(cur->bc_mp, &check))
3018 struct xfs_btree_cur *cur,
3028 error = xfs_rmap_query_range(cur, &roc.low, &roc.high,
3049 struct xfs_btree_cur *cur,
3062 error = xfs_rmap_query_range(cur, &roc.low, &roc.high,