Lines Matching refs:ptr
188 union xfs_btree_ptr *ptr, /* btree block disk address */ in xfs_btree_check_ptr() argument
194 be64_to_cpu((&ptr->l)[index]), level); in xfs_btree_check_ptr()
197 be32_to_cpu((&ptr->s)[index]), level); in xfs_btree_check_ptr()
843 union xfs_btree_ptr *ptr) in xfs_btree_ptr_is_null() argument
846 return be64_to_cpu(ptr->l) == NULLDFSBNO; in xfs_btree_ptr_is_null()
848 return be32_to_cpu(ptr->s) == NULLAGBLOCK; in xfs_btree_ptr_is_null()
854 union xfs_btree_ptr *ptr) in xfs_btree_set_ptr_null() argument
857 ptr->l = cpu_to_be64(NULLDFSBNO); in xfs_btree_set_ptr_null()
859 ptr->s = cpu_to_be32(NULLAGBLOCK); in xfs_btree_set_ptr_null()
869 union xfs_btree_ptr *ptr, in xfs_btree_get_sibling() argument
876 ptr->l = block->bb_u.l.bb_rightsib; in xfs_btree_get_sibling()
878 ptr->l = block->bb_u.l.bb_leftsib; in xfs_btree_get_sibling()
881 ptr->s = block->bb_u.s.bb_rightsib; in xfs_btree_get_sibling()
883 ptr->s = block->bb_u.s.bb_leftsib; in xfs_btree_get_sibling()
891 union xfs_btree_ptr *ptr, in xfs_btree_set_sibling() argument
898 block->bb_u.l.bb_rightsib = ptr->l; in xfs_btree_set_sibling()
900 block->bb_u.l.bb_leftsib = ptr->l; in xfs_btree_set_sibling()
903 block->bb_u.s.bb_rightsib = ptr->s; in xfs_btree_set_sibling()
905 block->bb_u.s.bb_leftsib = ptr->s; in xfs_btree_set_sibling()
940 union xfs_btree_ptr ptr; in xfs_btree_is_lastrec() local
947 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); in xfs_btree_is_lastrec()
948 if (!xfs_btree_ptr_is_null(cur, &ptr)) in xfs_btree_is_lastrec()
957 union xfs_btree_ptr *ptr) in xfs_btree_buf_to_ptr() argument
960 ptr->l = cpu_to_be64(XFS_DADDR_TO_FSB(cur->bc_mp, in xfs_btree_buf_to_ptr()
963 ptr->s = cpu_to_be32(xfs_daddr_to_agbno(cur->bc_mp, in xfs_btree_buf_to_ptr()
971 union xfs_btree_ptr *ptr) in xfs_btree_ptr_to_daddr() argument
974 ASSERT(be64_to_cpu(ptr->l) != NULLDFSBNO); in xfs_btree_ptr_to_daddr()
976 return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); in xfs_btree_ptr_to_daddr()
979 ASSERT(be32_to_cpu(ptr->s) != NULLAGBLOCK); in xfs_btree_ptr_to_daddr()
982 be32_to_cpu(ptr->s)); in xfs_btree_ptr_to_daddr()
1010 union xfs_btree_ptr *ptr, in xfs_btree_get_buf_block() argument
1021 d = xfs_btree_ptr_to_daddr(cur, ptr); in xfs_btree_get_buf_block()
1039 union xfs_btree_ptr *ptr, in xfs_btree_read_buf_block() argument
1052 d = xfs_btree_ptr_to_daddr(cur, ptr); in xfs_btree_read_buf_block()
1156 union xfs_btree_ptr *ptr, in xfs_btree_shift_ptrs() argument
1165 dst_ptr = (char *)ptr + (dir * xfs_btree_ptr_len(cur)); in xfs_btree_shift_ptrs()
1166 memmove(dst_ptr, ptr, numptrs * xfs_btree_ptr_len(cur)); in xfs_btree_shift_ptrs()
1298 union xfs_btree_ptr ptr; in xfs_btree_increment() local
1325 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); in xfs_btree_increment()
1326 if (xfs_btree_ptr_is_null(cur, &ptr)) in xfs_btree_increment()
1409 union xfs_btree_ptr ptr; in xfs_btree_decrement() local
1433 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); in xfs_btree_decrement()
1434 if (xfs_btree_ptr_is_null(cur, &ptr)) in xfs_btree_decrement()
1568 union xfs_btree_ptr ptr; /* ptr to btree block */ in xfs_btree_lookup() local
1579 cur->bc_ops->init_ptr_from_cur(cur, &ptr); in xfs_btree_lookup()
1580 pp = &ptr; in xfs_btree_lookup()
1678 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); in xfs_btree_lookup()
1681 !xfs_btree_ptr_is_null(cur, &ptr)) { in xfs_btree_lookup()
1724 int ptr; in xfs_btree_updkey() local
1737 for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { in xfs_btree_updkey()
1749 ptr = cur->bc_ptrs[level]; in xfs_btree_updkey()
1750 kp = xfs_btree_key_addr(cur, ptr, block); in xfs_btree_updkey()
1752 xfs_btree_log_keys(cur, bp, ptr, ptr); in xfs_btree_updkey()
1772 int ptr; in xfs_btree_update() local
1787 ptr = cur->bc_ptrs[0]; in xfs_btree_update()
1788 rp = xfs_btree_rec_addr(cur, ptr, block); in xfs_btree_update()
1792 xfs_btree_log_recs(cur, bp, ptr, ptr); in xfs_btree_update()
1800 ptr, LASTREC_UPDATE); in xfs_btree_update()
1804 if (ptr == 1) { in xfs_btree_update()
2683 int ptr; /* key/record index */ in xfs_btree_insrec() local
2709 ptr = cur->bc_ptrs[level]; in xfs_btree_insrec()
2710 if (ptr == 0) { in xfs_btree_insrec()
2719 optr = ptr; in xfs_btree_insrec()
2733 if (ptr <= numrecs) { in xfs_btree_insrec()
2736 xfs_btree_rec_addr(cur, ptr, block))); in xfs_btree_insrec()
2739 xfs_btree_key_addr(cur, ptr, block))); in xfs_btree_insrec()
2751 &optr, &ptr, &nptr, &ncur, &nrec, stat); in xfs_btree_insrec()
2773 XFS_BTREE_STATS_ADD(cur, moves, numrecs - ptr + 1); in xfs_btree_insrec()
2780 kp = xfs_btree_key_addr(cur, ptr, block); in xfs_btree_insrec()
2781 pp = xfs_btree_ptr_addr(cur, ptr, block); in xfs_btree_insrec()
2784 for (i = numrecs - ptr; i >= 0; i--) { in xfs_btree_insrec()
2791 xfs_btree_shift_keys(cur, kp, 1, numrecs - ptr + 1); in xfs_btree_insrec()
2792 xfs_btree_shift_ptrs(cur, pp, 1, numrecs - ptr + 1); in xfs_btree_insrec()
2805 xfs_btree_log_ptrs(cur, bp, ptr, numrecs); in xfs_btree_insrec()
2806 xfs_btree_log_keys(cur, bp, ptr, numrecs); in xfs_btree_insrec()
2808 if (ptr < numrecs) { in xfs_btree_insrec()
2810 xfs_btree_key_addr(cur, ptr + 1, block))); in xfs_btree_insrec()
2817 rp = xfs_btree_rec_addr(cur, ptr, block); in xfs_btree_insrec()
2819 xfs_btree_shift_recs(cur, rp, 1, numrecs - ptr + 1); in xfs_btree_insrec()
2824 xfs_btree_log_recs(cur, bp, ptr, numrecs); in xfs_btree_insrec()
2826 if (ptr < numrecs) { in xfs_btree_insrec()
2828 xfs_btree_rec_addr(cur, ptr + 1, block))); in xfs_btree_insrec()
2849 ptr, LASTREC_INSREC); in xfs_btree_insrec()
2972 union xfs_btree_ptr ptr; in xfs_btree_kill_iroot() local
3010 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); in xfs_btree_kill_iroot()
3011 ASSERT(xfs_btree_ptr_is_null(cur, &ptr)); in xfs_btree_kill_iroot()
3012 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); in xfs_btree_kill_iroot()
3013 ASSERT(xfs_btree_ptr_is_null(cur, &ptr)); in xfs_btree_kill_iroot()
3101 int ptr; /* key/record index */ in xfs_btree_delrec() local
3117 ptr = cur->bc_ptrs[level]; in xfs_btree_delrec()
3118 if (ptr == 0) { in xfs_btree_delrec()
3135 if (ptr > numrecs) { in xfs_btree_delrec()
3142 XFS_BTREE_STATS_ADD(cur, moves, numrecs - ptr); in xfs_btree_delrec()
3150 lkp = xfs_btree_key_addr(cur, ptr + 1, block); in xfs_btree_delrec()
3151 lpp = xfs_btree_ptr_addr(cur, ptr + 1, block); in xfs_btree_delrec()
3154 for (i = 0; i < numrecs - ptr; i++) { in xfs_btree_delrec()
3161 if (ptr < numrecs) { in xfs_btree_delrec()
3162 xfs_btree_shift_keys(cur, lkp, -1, numrecs - ptr); in xfs_btree_delrec()
3163 xfs_btree_shift_ptrs(cur, lpp, -1, numrecs - ptr); in xfs_btree_delrec()
3164 xfs_btree_log_keys(cur, bp, ptr, numrecs - 1); in xfs_btree_delrec()
3165 xfs_btree_log_ptrs(cur, bp, ptr, numrecs - 1); in xfs_btree_delrec()
3172 if (ptr == 1) in xfs_btree_delrec()
3176 if (ptr < numrecs) { in xfs_btree_delrec()
3178 xfs_btree_rec_addr(cur, ptr + 1, block), in xfs_btree_delrec()
3179 -1, numrecs - ptr); in xfs_btree_delrec()
3180 xfs_btree_log_recs(cur, bp, ptr, numrecs - 1); in xfs_btree_delrec()
3187 if (ptr == 1) { in xfs_btree_delrec()
3206 ptr, LASTREC_DELREC); in xfs_btree_delrec()
3258 if (ptr == 1) { in xfs_btree_delrec()
3662 int ptr; /* record number */ in xfs_btree_get_rec() local
3667 ptr = cur->bc_ptrs[0]; in xfs_btree_get_rec()
3679 if (ptr > xfs_btree_get_numrecs(block) || ptr <= 0) { in xfs_btree_get_rec()
3687 *recp = xfs_btree_rec_addr(cur, ptr, block); in xfs_btree_get_rec()