Lines Matching refs:state
53 STATIC void xfs_attr3_leaf_rebalance(xfs_da_state_t *state,
56 STATIC int xfs_attr3_leaf_figure_balance(xfs_da_state_t *state,
1204 struct xfs_da_state *state, in xfs_attr3_leaf_split() argument
1211 trace_xfs_attr_leaf_split(state->args); in xfs_attr3_leaf_split()
1217 error = xfs_da_grow_inode(state->args, &blkno); in xfs_attr3_leaf_split()
1220 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp); in xfs_attr3_leaf_split()
1230 xfs_attr3_leaf_rebalance(state, oldblk, newblk); in xfs_attr3_leaf_split()
1231 error = xfs_da3_blk_link(state, oldblk, newblk); in xfs_attr3_leaf_split()
1242 if (state->inleaf) { in xfs_attr3_leaf_split()
1243 trace_xfs_attr_leaf_add_old(state->args); in xfs_attr3_leaf_split()
1244 error = xfs_attr3_leaf_add(oldblk->bp, state->args); in xfs_attr3_leaf_split()
1246 trace_xfs_attr_leaf_add_new(state->args); in xfs_attr3_leaf_split()
1247 error = xfs_attr3_leaf_add(newblk->bp, state->args); in xfs_attr3_leaf_split()
1569 struct xfs_da_state *state, in xfs_attr3_leaf_rebalance() argument
1593 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr1, leaf1); in xfs_attr3_leaf_rebalance()
1594 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, leaf2); in xfs_attr3_leaf_rebalance()
1596 args = state->args; in xfs_attr3_leaf_rebalance()
1626 state->inleaf = xfs_attr3_leaf_figure_balance(state, blk1, &ichdr1, in xfs_attr3_leaf_rebalance()
1630 state->inleaf = !state->inleaf; in xfs_attr3_leaf_rebalance()
1688 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf1, &ichdr1); in xfs_attr3_leaf_rebalance()
1689 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf2, &ichdr2); in xfs_attr3_leaf_rebalance()
1714 ASSERT(state->inleaf == 0); in xfs_attr3_leaf_rebalance()
1719 if (state->inleaf) { in xfs_attr3_leaf_rebalance()
1733 if (!state->extravalid) { in xfs_attr3_leaf_rebalance()
1744 ASSERT(state->inleaf == 1); in xfs_attr3_leaf_rebalance()
1759 struct xfs_da_state *state, in xfs_attr3_leaf_figure_balance() argument
1786 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1788 lastdelta = state->args->geo->blksize; in xfs_attr3_leaf_figure_balance()
1798 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1834 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1859 struct xfs_da_state *state, in xfs_attr3_leaf_toosmall() argument
1873 trace_xfs_attr_leaf_toosmall(state->args); in xfs_attr3_leaf_toosmall()
1880 blk = &state->path.blk[ state->path.active-1 ]; in xfs_attr3_leaf_toosmall()
1882 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1886 if (bytes > (state->args->geo->blksize >> 1)) { in xfs_attr3_leaf_toosmall()
1903 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_attr3_leaf_toosmall()
1904 error = xfs_da3_path_shift(state, &state->altpath, forward, in xfs_attr3_leaf_toosmall()
1933 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp, in xfs_attr3_leaf_toosmall()
1938 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, bp->b_addr); in xfs_attr3_leaf_toosmall()
1940 bytes = state->args->geo->blksize - in xfs_attr3_leaf_toosmall()
1941 (state->args->geo->blksize >> 2) - in xfs_attr3_leaf_toosmall()
1947 xfs_trans_brelse(state->args->trans, bp); in xfs_attr3_leaf_toosmall()
1960 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_attr3_leaf_toosmall()
1962 error = xfs_da3_path_shift(state, &state->altpath, forward, in xfs_attr3_leaf_toosmall()
1965 error = xfs_da3_path_shift(state, &state->path, forward, in xfs_attr3_leaf_toosmall()
2140 struct xfs_da_state *state, in xfs_attr3_leaf_unbalance() argument
2150 trace_xfs_attr_leaf_unbalance(state->args); in xfs_attr3_leaf_unbalance()
2154 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &drophdr, drop_leaf); in xfs_attr3_leaf_unbalance()
2155 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &savehdr, save_leaf); in xfs_attr3_leaf_unbalance()
2175 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2180 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2193 tmp_leaf = kmem_zalloc(state->args->geo->blksize, 0); in xfs_attr3_leaf_unbalance()
2206 tmphdr.firstused = state->args->geo->blksize; in xfs_attr3_leaf_unbalance()
2209 xfs_attr3_leaf_hdr_to_disk(state->args->geo, tmp_leaf, &tmphdr); in xfs_attr3_leaf_unbalance()
2213 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2217 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2222 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2226 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2231 memcpy(save_leaf, tmp_leaf, state->args->geo->blksize); in xfs_attr3_leaf_unbalance()
2236 xfs_attr3_leaf_hdr_to_disk(state->args->geo, save_leaf, &savehdr); in xfs_attr3_leaf_unbalance()
2237 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0, in xfs_attr3_leaf_unbalance()
2238 state->args->geo->blksize - 1); in xfs_attr3_leaf_unbalance()