Lines Matching refs:cur

110 	struct xfs_btree_cur	*cur,
114 cur->bc_rec.b = *irec;
115 return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
120 struct xfs_btree_cur *cur,
123 cur->bc_rec.b.br_startoff = 0;
124 cur->bc_rec.b.br_startblock = 0;
125 cur->bc_rec.b.br_blockcount = 0;
126 return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
154 * Update the record referred to by cur to the value given by irec
159 struct xfs_btree_cur *cur,
165 return xfs_btree_update(cur, &rec);
256 struct xfs_btree_cur *cur,
262 if (!cur)
265 for (i = 0; i < cur->bc_maxlevels; i++) {
266 if (!cur->bc_levels[i].bp)
268 if (xfs_buf_daddr(cur->bc_levels[i].bp) == bno)
269 return cur->bc_levels[i].bp;
273 list_for_each_entry(lip, &cur->bc_tp->t_items, li_trans) {
342 struct xfs_btree_cur *cur, /* btree cursor or null */
387 /* See if buf is in cur first */
389 bp = xfs_bmap_get_bp(cur, XFS_FSB_TO_DADDR(mp, bno));
394 xfs_btree_mark_sick(cur);
411 xfs_btree_mark_sick(cur);
476 bp = xfs_bmap_get_bp(cur, XFS_FSB_TO_DADDR(mp, bno));
481 xfs_btree_mark_sick(cur);
544 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0)
563 struct xfs_btree_cur *cur, /* btree cursor */
581 ASSERT(cur);
591 if (XFS_IS_CORRUPT(cur->bc_mp, !xfs_verify_fsbno(mp, cbno))) {
592 xfs_btree_mark_sick(cur);
598 xfs_btree_mark_sick(cur);
602 if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
606 error = xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo,
614 if (cur->bc_levels[0].bp == cbp)
615 cur->bc_levels[0].bp = NULL;
641 struct xfs_btree_cur *cur; /* bmap btree cursor */
670 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
672 cur->bc_flags |= XFS_BTREE_BMBT_WASDEL;
698 cur->bc_bmap.allocated++;
729 pp = XFS_BMBT_PTR_ADDR(mp, block, 1, xfs_bmbt_get_maxrecs(cur,
737 xfs_btree_log_block(cur, abp, XFS_BB_ALL_BITS);
738 xfs_btree_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
740 *curp = cur;
750 xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
891 struct xfs_btree_cur *cur; /* btree cursor */
901 cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK);
902 error = xfs_bmbt_lookup_first(cur, &stat);
907 xfs_btree_mark_sick(cur);
911 if ((error = xfs_btree_new_iroot(cur, flags, &stat)))
914 xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
917 cur->bc_bmap.allocated = 0;
918 xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
922 xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
935 struct xfs_btree_cur *cur; /* bmap btree cursor */
941 cur = NULL;
942 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
944 if (cur) {
945 cur->bc_bmap.allocated = 0;
946 xfs_btree_del_cursor(cur, error);
1133 struct xfs_btree_cur *cur,
1138 struct xfs_mount *mp = cur->bc_mp;
1139 struct xfs_inode *ip = cur->bc_ino.ip;
1145 int whichfork = cur->bc_ino.whichfork;
1148 block = xfs_btree_get_block(cur, level, &bp);
1199 struct xfs_btree_cur *cur;
1209 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
1210 error = xfs_btree_visit_blocks(cur, xfs_iread_bmbt_block,
1212 xfs_btree_del_cursor(cur, error);
1451 ASSERT(!bma->cur || (bma->cur->bc_flags & XFS_BTREE_BMBT_WASDEL));
1541 if (bma->cur == NULL)
1545 error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
1549 xfs_btree_mark_sick(bma->cur);
1553 error = xfs_btree_delete(bma->cur, &i);
1557 xfs_btree_mark_sick(bma->cur);
1561 error = xfs_btree_decrement(bma->cur, 0, &i);
1565 xfs_btree_mark_sick(bma->cur);
1569 error = xfs_bmbt_update(bma->cur, &LEFT);
1588 if (bma->cur == NULL)
1592 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1596 xfs_btree_mark_sick(bma->cur);
1600 error = xfs_bmbt_update(bma->cur, &LEFT);
1623 if (bma->cur == NULL)
1627 error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
1631 xfs_btree_mark_sick(bma->cur);
1635 error = xfs_bmbt_update(bma->cur, &PREV);
1653 if (bma->cur == NULL)
1657 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1661 xfs_btree_mark_sick(bma->cur);
1665 error = xfs_btree_insert(bma->cur, &i);
1669 xfs_btree_mark_sick(bma->cur);
1697 if (bma->cur == NULL)
1701 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1705 xfs_btree_mark_sick(bma->cur);
1709 error = xfs_bmbt_update(bma->cur, &LEFT);
1724 if (bma->cur == NULL)
1728 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1732 xfs_btree_mark_sick(bma->cur);
1736 error = xfs_btree_insert(bma->cur, &i);
1740 xfs_btree_mark_sick(bma->cur);
1748 &bma->cur, 1, &tmp_rval, whichfork);
1757 (bma->cur ? bma->cur->bc_bmap.allocated : 0));
1777 if (bma->cur == NULL)
1781 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1785 xfs_btree_mark_sick(bma->cur);
1789 error = xfs_bmbt_update(bma->cur, &RIGHT);
1815 if (bma->cur == NULL)
1819 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1823 xfs_btree_mark_sick(bma->cur);
1827 error = xfs_btree_insert(bma->cur, &i);
1831 xfs_btree_mark_sick(bma->cur);
1839 &bma->cur, 1, &tmp_rval, whichfork);
1848 (bma->cur ? bma->cur->bc_bmap.allocated : 0));
1904 if (bma->cur == NULL)
1908 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1912 xfs_btree_mark_sick(bma->cur);
1916 error = xfs_btree_insert(bma->cur, &i);
1920 xfs_btree_mark_sick(bma->cur);
1928 &bma->cur, 1, &tmp_rval, whichfork);
1959 ASSERT(bma->cur == NULL);
1961 &bma->cur, da_old > 0, &tmp_logflags,
1971 if (bma->cur) {
1972 da_new += bma->cur->bc_bmap.allocated;
1973 bma->cur->bc_bmap.allocated = 0;
1982 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork);
2005 struct xfs_btree_cur *cur; /* btree cursor */
2019 cur = *curp;
2108 if (cur == NULL)
2112 error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
2116 xfs_btree_mark_sick(cur);
2120 if ((error = xfs_btree_delete(cur, &i)))
2123 xfs_btree_mark_sick(cur);
2127 if ((error = xfs_btree_decrement(cur, 0, &i)))
2130 xfs_btree_mark_sick(cur);
2134 if ((error = xfs_btree_delete(cur, &i)))
2137 xfs_btree_mark_sick(cur);
2141 if ((error = xfs_btree_decrement(cur, 0, &i)))
2144 xfs_btree_mark_sick(cur);
2148 error = xfs_bmbt_update(cur, &LEFT);
2165 if (cur == NULL)
2169 error = xfs_bmbt_lookup_eq(cur, &PREV, &i);
2173 xfs_btree_mark_sick(cur);
2177 if ((error = xfs_btree_delete(cur, &i)))
2180 xfs_btree_mark_sick(cur);
2184 if ((error = xfs_btree_decrement(cur, 0, &i)))
2187 xfs_btree_mark_sick(cur);
2191 error = xfs_bmbt_update(cur, &LEFT);
2211 if (cur == NULL)
2215 error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
2219 xfs_btree_mark_sick(cur);
2223 if ((error = xfs_btree_delete(cur, &i)))
2226 xfs_btree_mark_sick(cur);
2230 if ((error = xfs_btree_decrement(cur, 0, &i)))
2233 xfs_btree_mark_sick(cur);
2237 error = xfs_bmbt_update(cur, &PREV);
2252 if (cur == NULL)
2256 error = xfs_bmbt_lookup_eq(cur, new, &i);
2260 xfs_btree_mark_sick(cur);
2264 error = xfs_bmbt_update(cur, &PREV);
2286 if (cur == NULL)
2290 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2294 xfs_btree_mark_sick(cur);
2298 error = xfs_bmbt_update(cur, &PREV);
2301 error = xfs_btree_decrement(cur, 0, &i);
2304 error = xfs_bmbt_update(cur, &LEFT);
2324 if (cur == NULL)
2328 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2332 xfs_btree_mark_sick(cur);
2336 error = xfs_bmbt_update(cur, &PREV);
2339 cur->bc_rec.b = *new;
2340 if ((error = xfs_btree_insert(cur, &i)))
2343 xfs_btree_mark_sick(cur);
2366 if (cur == NULL)
2370 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2374 xfs_btree_mark_sick(cur);
2378 error = xfs_bmbt_update(cur, &PREV);
2381 error = xfs_btree_increment(cur, 0, &i);
2384 error = xfs_bmbt_update(cur, &RIGHT);
2403 if (cur == NULL)
2407 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2411 xfs_btree_mark_sick(cur);
2415 error = xfs_bmbt_update(cur, &PREV);
2418 error = xfs_bmbt_lookup_eq(cur, new, &i);
2422 xfs_btree_mark_sick(cur);
2426 if ((error = xfs_btree_insert(cur, &i)))
2429 xfs_btree_mark_sick(cur);
2458 if (cur == NULL)
2462 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2466 xfs_btree_mark_sick(cur);
2471 error = xfs_bmbt_update(cur, &r[1]);
2475 cur->bc_rec.b = PREV;
2476 if ((error = xfs_btree_insert(cur, &i)))
2479 xfs_btree_mark_sick(cur);
2488 error = xfs_bmbt_lookup_eq(cur, new, &i);
2492 xfs_btree_mark_sick(cur);
2497 if ((error = xfs_btree_insert(cur, &i)))
2500 xfs_btree_mark_sick(cur);
2527 ASSERT(cur == NULL);
2528 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
2536 if (cur) {
2537 cur->bc_bmap.allocated = 0;
2538 *curp = cur;
2706 struct xfs_btree_cur *cur = *curp;
2716 ASSERT(!cur || !(cur->bc_flags & XFS_BTREE_BMBT_WASDEL));
2778 if (cur == NULL) {
2782 error = xfs_bmbt_lookup_eq(cur, &right, &i);
2786 xfs_btree_mark_sick(cur);
2790 error = xfs_btree_delete(cur, &i);
2794 xfs_btree_mark_sick(cur);
2798 error = xfs_btree_decrement(cur, 0, &i);
2802 xfs_btree_mark_sick(cur);
2806 error = xfs_bmbt_update(cur, &left);
2824 if (cur == NULL) {
2828 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2832 xfs_btree_mark_sick(cur);
2836 error = xfs_bmbt_update(cur, &left);
2855 if (cur == NULL) {
2859 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2863 xfs_btree_mark_sick(cur);
2867 error = xfs_bmbt_update(cur, &right);
2882 if (cur == NULL) {
2886 error = xfs_bmbt_lookup_eq(cur, new, &i);
2890 xfs_btree_mark_sick(cur);
2894 error = xfs_btree_insert(cur, &i);
2898 xfs_btree_mark_sick(cur);
2914 ASSERT(cur == NULL);
2918 cur = *curp;
2924 if (cur)
2925 cur->bc_bmap.allocated = 0;
2927 xfs_bmap_check_leaf_extents(cur, ip, whichfork);
4225 if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur)
4226 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork);
4233 if (bma->cur && bma->wasdel)
4234 bma->cur->bc_flags |= XFS_BTREE_BMBT_WASDEL;
4248 whichfork, &bma->icur, &bma->cur, &bma->got,
4295 if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur) {
4296 bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp,
4314 &bma->icur, &bma->cur, mval, &tmp_logflags);
4385 if (bma->cur)
4386 xfs_btree_del_cursor(bma->cur, error);
4586 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, &bma.logflags,
4732 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, &bma.logflags,
4791 struct xfs_btree_cur *cur = NULL;
4829 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
4840 &cur, &got, &logflags, flags);
4844 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags, whichfork);
4854 if (cur)
4855 xfs_btree_del_cursor(cur, error);
5143 struct xfs_btree_cur *cur, /* if null, not a btree */
5201 if (cur) {
5202 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5206 xfs_btree_mark_sick(cur);
5226 if (!cur) {
5230 if ((error = xfs_btree_delete(cur, &i)))
5233 xfs_btree_mark_sick(cur);
5245 if (!cur) {
5249 error = xfs_bmbt_update(cur, &got);
5259 if (!cur) {
5263 error = xfs_bmbt_update(cur, &got);
5283 if (cur) {
5284 error = xfs_bmbt_update(cur, &got);
5287 error = xfs_btree_increment(cur, 0, &i);
5290 cur->bc_rec.b = new;
5291 error = xfs_btree_insert(cur, &i);
5304 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5308 xfs_btree_mark_sick(cur);
5315 error = xfs_bmbt_update(cur, &old);
5327 xfs_btree_mark_sick(cur);
5399 struct xfs_btree_cur *cur; /* bmap btree cursor */
5454 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5456 cur = NULL;
5539 whichfork, &icur, &cur, &del,
5599 ip, whichfork, &icur, &cur,
5608 ip, whichfork, &icur, &cur,
5620 error = xfs_bmap_del_extent_real(ip, tp, &icur, cur,
5652 ASSERT(cur == NULL);
5653 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
5657 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags,
5678 if (cur) {
5680 cur->bc_bmap.allocated = 0;
5681 xfs_btree_del_cursor(cur, error);
5749 struct xfs_btree_cur *cur,
5772 if (!cur) {
5778 error = xfs_bmbt_lookup_eq(cur, got, &i);
5782 xfs_btree_mark_sick(cur);
5786 error = xfs_btree_delete(cur, &i);
5790 xfs_btree_mark_sick(cur);
5795 error = xfs_bmbt_lookup_eq(cur, left, &i);
5799 xfs_btree_mark_sick(cur);
5803 error = xfs_bmbt_update(cur, &new);
5808 error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork);
5833 struct xfs_btree_cur *cur,
5845 if (cur) {
5846 error = xfs_bmbt_lookup_eq(cur, &prev, &i);
5850 xfs_btree_mark_sick(cur);
5854 error = xfs_bmbt_update(cur, got);
5881 struct xfs_btree_cur *cur = NULL;
5904 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5926 cur, &logflags);
5939 cur, &logflags, new_startoff);
5951 if (cur)
5952 xfs_btree_del_cursor(cur, error);
5996 struct xfs_btree_cur *cur = NULL;
6019 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
6064 cur, &logflags, new_startoff);
6076 if (cur)
6077 xfs_btree_del_cursor(cur, error);
6097 struct xfs_btree_cur *cur = NULL;
6135 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
6136 error = xfs_bmbt_lookup_eq(cur, &got, &i);
6140 xfs_btree_mark_sick(cur);
6151 if (cur) {
6152 error = xfs_bmbt_update(cur, &got);
6163 if (cur) {
6164 error = xfs_bmbt_lookup_eq(cur, &new, &i);
6168 xfs_btree_mark_sick(cur);
6172 error = xfs_btree_insert(cur, &i);
6176 xfs_btree_mark_sick(cur);
6188 ASSERT(cur == NULL);
6189 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
6195 if (cur) {
6196 cur->bc_bmap.allocated = 0;
6197 xfs_btree_del_cursor(cur, error);
6400 struct xfs_btree_cur *cur,
6409 fa = xfs_bmap_validate_extent(cur->bc_ino.ip, cur->bc_ino.whichfork,
6412 xfs_btree_mark_sick(cur);
6413 return xfs_bmap_complain_bad_rec(cur->bc_ino.ip,
6414 cur->bc_ino.whichfork, fa, &irec);
6417 return query->fn(cur, &irec, query->priv);
6423 struct xfs_btree_cur *cur,
6432 return xfs_btree_query_all(cur, xfs_bmap_query_range_helper, &query);