Lines Matching defs:cur
99 struct xfs_btree_cur *cur,
103 cur->bc_rec.b = *irec;
104 return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
109 struct xfs_btree_cur *cur,
112 cur->bc_rec.b.br_startoff = 0;
113 cur->bc_rec.b.br_startblock = 0;
114 cur->bc_rec.b.br_blockcount = 0;
115 return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
143 * Update the record referred to by cur to the value given by irec
148 struct xfs_btree_cur *cur,
154 return xfs_btree_update(cur, &rec);
230 struct xfs_btree_cur *cur,
236 if (!cur)
240 if (!cur->bc_bufs[i])
242 if (XFS_BUF_ADDR(cur->bc_bufs[i]) == bno)
243 return cur->bc_bufs[i];
247 list_for_each_entry(lip, &cur->bc_tp->t_items, li_trans) {
316 xfs_btree_cur_t *cur, /* btree cursor or null */
361 /* See if buf is in cur first */
363 bp = xfs_bmap_get_bp(cur, XFS_FSB_TO_DADDR(mp, bno));
449 bp = xfs_bmap_get_bp(cur, XFS_FSB_TO_DADDR(mp, bno));
517 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0)
586 struct xfs_btree_cur *cur, /* btree cursor */
604 ASSERT(cur);
615 if (XFS_IS_CORRUPT(cur->bc_mp, !xfs_btree_check_lptr(cur, cbno, 1)))
623 if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
626 xfs_bmap_add_free(cur->bc_tp, cbno, 1, &oinfo);
630 if (cur->bc_bufs[0] == cbp)
631 cur->bc_bufs[0] = NULL;
658 struct xfs_btree_cur *cur; /* bmap btree cursor */
690 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
691 cur->bc_ino.flags = wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
728 cur->bc_ino.allocated++;
762 pp = XFS_BMBT_PTR_ADDR(mp, block, 1, xfs_bmbt_get_maxrecs(cur,
770 xfs_btree_log_block(cur, abp, XFS_BB_ALL_BITS);
771 xfs_btree_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
773 *curp = cur;
783 xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
930 xfs_btree_cur_t *cur; /* btree cursor */
939 cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK);
940 error = xfs_bmbt_lookup_first(cur, &stat);
948 if ((error = xfs_btree_new_iroot(cur, flags, &stat)))
951 xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
954 cur->bc_ino.allocated = 0;
955 xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
959 xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
972 xfs_btree_cur_t *cur; /* bmap btree cursor */
978 cur = NULL;
979 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
981 if (cur) {
982 cur->bc_ino.allocated = 0;
983 xfs_btree_del_cursor(cur, error);
1167 struct xfs_btree_cur *cur,
1172 struct xfs_mount *mp = cur->bc_mp;
1173 struct xfs_inode *ip = cur->bc_ino.ip;
1179 int whichfork = cur->bc_ino.whichfork;
1182 block = xfs_btree_get_block(cur, level, &bp);
1230 struct xfs_btree_cur *cur;
1242 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
1243 error = xfs_btree_visit_blocks(cur, xfs_iread_bmbt_block,
1245 xfs_btree_del_cursor(cur, error);
1512 ASSERT(!bma->cur ||
1513 (bma->cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
1603 if (bma->cur == NULL)
1607 error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
1614 error = xfs_btree_delete(bma->cur, &i);
1621 error = xfs_btree_decrement(bma->cur, 0, &i);
1628 error = xfs_bmbt_update(bma->cur, &LEFT);
1646 if (bma->cur == NULL)
1650 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1657 error = xfs_bmbt_update(bma->cur, &LEFT);
1679 if (bma->cur == NULL)
1683 error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
1690 error = xfs_bmbt_update(bma->cur, &PREV);
1707 if (bma->cur == NULL)
1711 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1718 error = xfs_btree_insert(bma->cur, &i);
1748 if (bma->cur == NULL)
1752 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1759 error = xfs_bmbt_update(bma->cur, &LEFT);
1773 if (bma->cur == NULL)
1777 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1784 error = xfs_btree_insert(bma->cur, &i);
1795 &bma->cur, 1, &tmp_rval, whichfork);
1804 (bma->cur ? bma->cur->bc_ino.allocated : 0));
1824 if (bma->cur == NULL)
1828 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1835 error = xfs_bmbt_update(bma->cur, &RIGHT);
1860 if (bma->cur == NULL)
1864 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1871 error = xfs_btree_insert(bma->cur, &i);
1882 &bma->cur, 1, &tmp_rval, whichfork);
1891 (bma->cur ? bma->cur->bc_ino.allocated : 0));
1946 if (bma->cur == NULL)
1950 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1957 error = xfs_btree_insert(bma->cur, &i);
1968 &bma->cur, 1, &tmp_rval, whichfork);
1999 ASSERT(bma->cur == NULL);
2001 &bma->cur, da_old > 0, &tmp_logflags,
2011 if (bma->cur) {
2012 da_new += bma->cur->bc_ino.allocated;
2013 bma->cur->bc_ino.allocated = 0;
2023 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork);
2046 xfs_btree_cur_t *cur; /* btree cursor */
2060 cur = *curp;
2149 if (cur == NULL)
2153 error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
2160 if ((error = xfs_btree_delete(cur, &i)))
2166 if ((error = xfs_btree_decrement(cur, 0, &i)))
2172 if ((error = xfs_btree_delete(cur, &i)))
2178 if ((error = xfs_btree_decrement(cur, 0, &i)))
2184 error = xfs_bmbt_update(cur, &LEFT);
2201 if (cur == NULL)
2205 error = xfs_bmbt_lookup_eq(cur, &PREV, &i);
2212 if ((error = xfs_btree_delete(cur, &i)))
2218 if ((error = xfs_btree_decrement(cur, 0, &i)))
2224 error = xfs_bmbt_update(cur, &LEFT);
2244 if (cur == NULL)
2248 error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
2255 if ((error = xfs_btree_delete(cur, &i)))
2261 if ((error = xfs_btree_decrement(cur, 0, &i)))
2267 error = xfs_bmbt_update(cur, &PREV);
2282 if (cur == NULL)
2286 error = xfs_bmbt_lookup_eq(cur, new, &i);
2293 error = xfs_bmbt_update(cur, &PREV);
2315 if (cur == NULL)
2319 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2326 error = xfs_bmbt_update(cur, &PREV);
2329 error = xfs_btree_decrement(cur, 0, &i);
2332 error = xfs_bmbt_update(cur, &LEFT);
2352 if (cur == NULL)
2356 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2363 error = xfs_bmbt_update(cur, &PREV);
2366 cur->bc_rec.b = *new;
2367 if ((error = xfs_btree_insert(cur, &i)))
2392 if (cur == NULL)
2396 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2403 error = xfs_bmbt_update(cur, &PREV);
2406 error = xfs_btree_increment(cur, 0, &i);
2409 error = xfs_bmbt_update(cur, &RIGHT);
2428 if (cur == NULL)
2432 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2439 error = xfs_bmbt_update(cur, &PREV);
2442 error = xfs_bmbt_lookup_eq(cur, new, &i);
2449 if ((error = xfs_btree_insert(cur, &i)))
2480 if (cur == NULL)
2484 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2492 error = xfs_bmbt_update(cur, &r[1]);
2496 cur->bc_rec.b = PREV;
2497 if ((error = xfs_btree_insert(cur, &i)))
2508 error = xfs_bmbt_lookup_eq(cur, new, &i);
2516 if ((error = xfs_btree_insert(cur, &i)))
2545 ASSERT(cur == NULL);
2546 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
2554 if (cur) {
2555 cur->bc_ino.allocated = 0;
2556 *curp = cur;
2724 struct xfs_btree_cur *cur = *curp;
2734 ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
2796 if (cur == NULL) {
2800 error = xfs_bmbt_lookup_eq(cur, &right, &i);
2807 error = xfs_btree_delete(cur, &i);
2814 error = xfs_btree_decrement(cur, 0, &i);
2821 error = xfs_bmbt_update(cur, &left);
2839 if (cur == NULL) {
2843 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2850 error = xfs_bmbt_update(cur, &left);
2869 if (cur == NULL) {
2873 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2880 error = xfs_bmbt_update(cur, &right);
2895 if (cur == NULL) {
2899 error = xfs_bmbt_lookup_eq(cur, new, &i);
2906 error = xfs_btree_insert(cur, &i);
2925 ASSERT(cur == NULL);
2929 cur = *curp;
2935 if (cur)
2936 cur->bc_ino.allocated = 0;
2938 xfs_bmap_check_leaf_extents(cur, ip, whichfork);
4135 if ((ifp->if_flags & XFS_IFBROOT) && !bma->cur)
4136 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork);
4143 if (bma->cur)
4144 bma->cur->bc_ino.flags =
4159 whichfork, &bma->icur, &bma->cur, &bma->got,
4208 if ((ifp->if_flags & XFS_IFBROOT) && !bma->cur) {
4209 bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp,
4227 &bma->icur, &bma->cur, mval, &tmp_logflags);
4298 if (bma->cur)
4299 xfs_btree_del_cursor(bma->cur, error);
4479 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, &bma.logflags,
4602 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, &bma.logflags,
4631 struct xfs_btree_cur *cur = NULL;
4670 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
4671 cur->bc_ino.flags = 0;
4683 &cur, &got, &logflags, flags);
4687 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags, whichfork);
4697 if (cur)
4698 xfs_btree_del_cursor(cur, error);
4996 xfs_btree_cur_t *cur, /* if null, not a btree */
5078 if (cur) {
5079 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5103 if (!cur) {
5107 if ((error = xfs_btree_delete(cur, &i)))
5122 if (!cur) {
5126 error = xfs_bmbt_update(cur, &got);
5136 if (!cur) {
5140 error = xfs_bmbt_update(cur, &got);
5159 if (cur) {
5160 error = xfs_bmbt_update(cur, &got);
5163 error = xfs_btree_increment(cur, 0, &i);
5166 cur->bc_rec.b = new;
5167 error = xfs_btree_insert(cur, &i);
5180 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5191 error = xfs_bmbt_update(cur, &old);
5264 struct xfs_btree_cur *cur; /* bmap btree cursor */
5329 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5330 cur->bc_ino.flags = 0;
5332 cur = NULL;
5443 whichfork, &icur, &cur, &del,
5502 ip, whichfork, &icur, &cur,
5511 ip, whichfork, &icur, &cur,
5524 error = xfs_bmap_del_extent_real(ip, tp, &icur, cur,
5558 ASSERT(cur == NULL);
5559 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
5563 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags,
5584 if (cur) {
5586 cur->bc_ino.allocated = 0;
5587 xfs_btree_del_cursor(cur, error);
5655 struct xfs_btree_cur *cur,
5679 if (!cur) {
5685 error = xfs_bmbt_lookup_eq(cur, got, &i);
5691 error = xfs_btree_delete(cur, &i);
5698 error = xfs_bmbt_lookup_eq(cur, left, &i);
5704 error = xfs_bmbt_update(cur, &new);
5709 error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork);
5734 struct xfs_btree_cur *cur,
5746 if (cur) {
5747 error = xfs_bmbt_lookup_eq(cur, &prev, &i);
5753 error = xfs_bmbt_update(cur, got);
5780 struct xfs_btree_cur *cur = NULL;
5804 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5805 cur->bc_ino.flags = 0;
5827 cur, &logflags);
5840 cur, &logflags, new_startoff);
5852 if (cur)
5853 xfs_btree_del_cursor(cur, error);
5897 struct xfs_btree_cur *cur = NULL;
5921 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5922 cur->bc_ino.flags = 0;
5966 cur, &logflags, new_startoff);
5978 if (cur)
5979 xfs_btree_del_cursor(cur, error);
5999 struct xfs_btree_cur *cur = NULL;
6038 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
6039 cur->bc_ino.flags = 0;
6040 error = xfs_bmbt_lookup_eq(cur, &got, &i);
6054 if (cur) {
6055 error = xfs_bmbt_update(cur, &got);
6066 if (cur) {
6067 error = xfs_bmbt_lookup_eq(cur, &new, &i);
6074 error = xfs_btree_insert(cur, &i);
6089 ASSERT(cur == NULL);
6090 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
6096 if (cur) {
6097 cur->bc_ino.allocated = 0;
6098 xfs_btree_del_cursor(cur, error);