Lines Matching refs:block

88 	xfs_alloc_block_t	*block;	/* btree block record/key lives in */  in xfs_alloc_delrec()  local
124 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_delrec()
126 if ((error = xfs_btree_check_sblock(cur, block, level, bp))) in xfs_alloc_delrec()
132 if (ptr > INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_delrec()
143 lkp = XFS_ALLOC_KEY_ADDR(block, 1, cur); in xfs_alloc_delrec()
144 lpp = XFS_ALLOC_PTR_ADDR(block, 1, cur); in xfs_alloc_delrec()
146 for (i = ptr; i < INT_GET(block->bb_numrecs, ARCH_CONVERT); i++) { in xfs_alloc_delrec()
151 if (ptr < INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_delrec()
153 (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr) * sizeof(*lkp)); /* INT_: mem copy */ in xfs_alloc_delrec()
155 (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr) * sizeof(*lpp)); /* INT_: mem copy */ in xfs_alloc_delrec()
156 xfs_alloc_log_ptrs(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT) - 1); in xfs_alloc_delrec()
157 xfs_alloc_log_keys(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT) - 1); in xfs_alloc_delrec()
165 lrp = XFS_ALLOC_REC_ADDR(block, 1, cur); in xfs_alloc_delrec()
166 if (ptr < INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_delrec()
168 (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr) * sizeof(*lrp)); in xfs_alloc_delrec()
169 xfs_alloc_log_recs(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT) - 1); in xfs_alloc_delrec()
184 INT_MOD(block->bb_numrecs, ARCH_CONVERT, -1); in xfs_alloc_delrec()
197 INT_GET(block->bb_rightsib, ARCH_CONVERT) == NULLAGBLOCK && in xfs_alloc_delrec()
198 ptr > INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_delrec()
199 ASSERT(ptr == INT_GET(block->bb_numrecs, ARCH_CONVERT) + 1); in xfs_alloc_delrec()
204 if (INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_delrec()
205 rrp = XFS_ALLOC_REC_ADDR(block, INT_GET(block->bb_numrecs, ARCH_CONVERT), cur); in xfs_alloc_delrec()
228 if (INT_GET(block->bb_numrecs, ARCH_CONVERT) == 1 && level > 0) { in xfs_alloc_delrec()
284 if (INT_GET(block->bb_numrecs, ARCH_CONVERT) >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { in xfs_alloc_delrec()
295 rbno = INT_GET(block->bb_rightsib, ARCH_CONVERT); in xfs_alloc_delrec()
296 lbno = INT_GET(block->bb_leftsib, ARCH_CONVERT); in xfs_alloc_delrec()
344 ASSERT(INT_GET(block->bb_numrecs, ARCH_CONVERT) >= in xfs_alloc_delrec()
408 ASSERT(INT_GET(block->bb_numrecs, ARCH_CONVERT) >= in xfs_alloc_delrec()
436 lrecs + INT_GET(block->bb_numrecs, ARCH_CONVERT) <= XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { in xfs_alloc_delrec()
442 right = block; in xfs_alloc_delrec()
456 rrecs + INT_GET(block->bb_numrecs, ARCH_CONVERT) <= in xfs_alloc_delrec()
463 left = block; in xfs_alloc_delrec()
613 xfs_alloc_block_t *block; /* btree block record/key lives in */ in xfs_alloc_insrec() local
659 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_insrec()
661 if ((error = xfs_btree_check_sblock(cur, block, level, bp))) in xfs_alloc_insrec()
666 if (ptr <= INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_insrec()
668 rp = XFS_ALLOC_REC_ADDR(block, ptr, cur); in xfs_alloc_insrec()
671 kp = XFS_ALLOC_KEY_ADDR(block, ptr, cur); in xfs_alloc_insrec()
682 if (INT_GET(block->bb_numrecs, ARCH_CONVERT) == XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { in xfs_alloc_insrec()
711 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_insrec()
715 block, level, bp))) in xfs_alloc_insrec()
741 kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); in xfs_alloc_insrec()
742 pp = XFS_ALLOC_PTR_ADDR(block, 1, cur); in xfs_alloc_insrec()
744 for (i = INT_GET(block->bb_numrecs, ARCH_CONVERT); i >= ptr; i--) { in xfs_alloc_insrec()
750 (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*kp)); /* INT_: copy */ in xfs_alloc_insrec()
752 (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*pp)); /* INT_: copy */ in xfs_alloc_insrec()
762 INT_MOD(block->bb_numrecs, ARCH_CONVERT, +1); in xfs_alloc_insrec()
763 xfs_alloc_log_keys(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT)); in xfs_alloc_insrec()
764 xfs_alloc_log_ptrs(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT)); in xfs_alloc_insrec()
766 if (ptr < INT_GET(block->bb_numrecs, ARCH_CONVERT)) in xfs_alloc_insrec()
774 rp = XFS_ALLOC_REC_ADDR(block, 1, cur); in xfs_alloc_insrec()
776 (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*rp)); in xfs_alloc_insrec()
782 INT_MOD(block->bb_numrecs, ARCH_CONVERT, +1); in xfs_alloc_insrec()
783 xfs_alloc_log_recs(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT)); in xfs_alloc_insrec()
785 if (ptr < INT_GET(block->bb_numrecs, ARCH_CONVERT)) in xfs_alloc_insrec()
807 INT_GET(block->bb_rightsib, ARCH_CONVERT) == NULLAGBLOCK && in xfs_alloc_insrec()
867 xfs_alloc_block_t *block; /* btree block to log from */ in xfs_alloc_log_keys() local
872 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_log_keys()
873 kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); in xfs_alloc_log_keys()
874 first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); in xfs_alloc_log_keys()
875 last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); in xfs_alloc_log_keys()
889 xfs_alloc_block_t *block; /* btree block to log from */ in xfs_alloc_log_ptrs() local
894 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_log_ptrs()
895 pp = XFS_ALLOC_PTR_ADDR(block, 1, cur); in xfs_alloc_log_ptrs()
896 first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); in xfs_alloc_log_ptrs()
897 last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); in xfs_alloc_log_ptrs()
911 xfs_alloc_block_t *block; /* btree block to log from */ in xfs_alloc_log_recs() local
917 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_log_recs()
918 rp = XFS_ALLOC_REC_ADDR(block, 1, cur); in xfs_alloc_log_recs()
930 first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); in xfs_alloc_log_recs()
931 last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); in xfs_alloc_log_recs()
947 xfs_alloc_block_t *block=NULL; /* current btree block */ in xfs_alloc_lookup() local
1000 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_lookup()
1001 if ((error = xfs_btree_check_sblock(cur, block, level, in xfs_alloc_lookup()
1005 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_lookup()
1025 kkbase = XFS_ALLOC_KEY_ADDR(block, 1, cur); in xfs_alloc_lookup()
1027 krbase = XFS_ALLOC_REC_ADDR(block, 1, cur); in xfs_alloc_lookup()
1032 if (!(high = INT_GET(block->bb_numrecs, ARCH_CONVERT))) { in xfs_alloc_lookup()
1108 agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, keyno, cur), ARCH_CONVERT); in xfs_alloc_lookup()
1127 keyno > INT_GET(block->bb_numrecs, ARCH_CONVERT) && in xfs_alloc_lookup()
1128 INT_GET(block->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) { in xfs_alloc_lookup()
1145 if (keyno == 0 || keyno > INT_GET(block->bb_numrecs, ARCH_CONVERT)) in xfs_alloc_lookup()
1750 xfs_alloc_block_t *block; /* btree block */ in xfs_alloc_updkey() local
1758 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_updkey()
1760 if ((error = xfs_btree_check_sblock(cur, block, level, bp))) in xfs_alloc_updkey()
1764 kp = XFS_ALLOC_KEY_ADDR(block, ptr, cur); in xfs_alloc_updkey()
1785 xfs_alloc_block_t *block; /* btree block */ in xfs_alloc_decrement() local
1805 block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[level]); in xfs_alloc_decrement()
1807 if ((error = xfs_btree_check_sblock(cur, block, level, in xfs_alloc_decrement()
1814 if (INT_GET(block->bb_leftsib, ARCH_CONVERT) == NULLAGBLOCK) { in xfs_alloc_decrement()
1839 for (block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); lev > level; ) { in xfs_alloc_decrement()
1843 agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT); in xfs_alloc_decrement()
1850 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_decrement()
1851 if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) in xfs_alloc_decrement()
1853 cur->bc_ptrs[lev] = INT_GET(block->bb_numrecs, ARCH_CONVERT); in xfs_alloc_decrement()
1905 xfs_alloc_block_t *block; /* btree block */ in xfs_alloc_get_rec() local
1912 block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]); in xfs_alloc_get_rec()
1914 if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))) in xfs_alloc_get_rec()
1920 if (ptr > INT_GET(block->bb_numrecs, ARCH_CONVERT) || ptr <= 0) { in xfs_alloc_get_rec()
1930 rec = XFS_ALLOC_REC_ADDR(block, ptr, cur); in xfs_alloc_get_rec()
1948 xfs_alloc_block_t *block; /* btree block */ in xfs_alloc_increment() local
1962 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_increment()
1964 if ((error = xfs_btree_check_sblock(cur, block, level, bp))) in xfs_alloc_increment()
1971 if (++cur->bc_ptrs[level] <= INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_increment()
1978 if (INT_GET(block->bb_rightsib, ARCH_CONVERT) == NULLAGBLOCK) { in xfs_alloc_increment()
1988 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_increment()
1990 if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) in xfs_alloc_increment()
1993 if (++cur->bc_ptrs[lev] <= INT_GET(block->bb_numrecs, ARCH_CONVERT)) in xfs_alloc_increment()
2009 for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_increment()
2013 agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT); in xfs_alloc_increment()
2020 block = XFS_BUF_TO_ALLOC_BLOCK(bp); in xfs_alloc_increment()
2021 if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) in xfs_alloc_increment()
2146 xfs_alloc_block_t *block; /* btree block to update */ in xfs_alloc_update() local
2154 block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]); in xfs_alloc_update()
2156 if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))) in xfs_alloc_update()
2166 rp = XFS_ALLOC_REC_ADDR(block, ptr, cur); in xfs_alloc_update()
2180 INT_GET(block->bb_rightsib, ARCH_CONVERT) == NULLAGBLOCK && in xfs_alloc_update()
2181 ptr == INT_GET(block->bb_numrecs, ARCH_CONVERT)) { in xfs_alloc_update()