Lines Matching refs:state
68 STATIC void xfs_attr3_leaf_rebalance(xfs_da_state_t *state,
71 STATIC int xfs_attr3_leaf_figure_balance(xfs_da_state_t *state,
1083 struct xfs_da_state *state, in xfs_attr3_leaf_split() argument
1090 trace_xfs_attr_leaf_split(state->args); in xfs_attr3_leaf_split()
1096 error = xfs_da_grow_inode(state->args, &blkno); in xfs_attr3_leaf_split()
1099 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp); in xfs_attr3_leaf_split()
1109 xfs_attr3_leaf_rebalance(state, oldblk, newblk); in xfs_attr3_leaf_split()
1110 error = xfs_da3_blk_link(state, oldblk, newblk); in xfs_attr3_leaf_split()
1121 if (state->inleaf) { in xfs_attr3_leaf_split()
1122 trace_xfs_attr_leaf_add_old(state->args); in xfs_attr3_leaf_split()
1123 error = xfs_attr3_leaf_add(oldblk->bp, state->args); in xfs_attr3_leaf_split()
1125 trace_xfs_attr_leaf_add_new(state->args); in xfs_attr3_leaf_split()
1126 error = xfs_attr3_leaf_add(newblk->bp, state->args); in xfs_attr3_leaf_split()
1450 struct xfs_da_state *state, in xfs_attr3_leaf_rebalance() argument
1474 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr1, leaf1); in xfs_attr3_leaf_rebalance()
1475 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, leaf2); in xfs_attr3_leaf_rebalance()
1477 args = state->args; in xfs_attr3_leaf_rebalance()
1514 state->inleaf = xfs_attr3_leaf_figure_balance(state, blk1, &ichdr1, in xfs_attr3_leaf_rebalance()
1518 state->inleaf = !state->inleaf; in xfs_attr3_leaf_rebalance()
1576 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf1, &ichdr1); in xfs_attr3_leaf_rebalance()
1577 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf2, &ichdr2); in xfs_attr3_leaf_rebalance()
1602 ASSERT(state->inleaf == 0); in xfs_attr3_leaf_rebalance()
1607 if (state->inleaf) { in xfs_attr3_leaf_rebalance()
1621 if (!state->extravalid) { in xfs_attr3_leaf_rebalance()
1632 ASSERT(state->inleaf == 1); in xfs_attr3_leaf_rebalance()
1647 struct xfs_da_state *state, in xfs_attr3_leaf_figure_balance() argument
1674 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1676 lastdelta = state->args->geo->blksize; in xfs_attr3_leaf_figure_balance()
1686 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1722 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1747 struct xfs_da_state *state, in xfs_attr3_leaf_toosmall() argument
1761 trace_xfs_attr_leaf_toosmall(state->args); in xfs_attr3_leaf_toosmall()
1768 blk = &state->path.blk[ state->path.active-1 ]; in xfs_attr3_leaf_toosmall()
1770 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1774 if (bytes > (state->args->geo->blksize >> 1)) { in xfs_attr3_leaf_toosmall()
1791 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_attr3_leaf_toosmall()
1792 error = xfs_da3_path_shift(state, &state->altpath, forward, in xfs_attr3_leaf_toosmall()
1821 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp, in xfs_attr3_leaf_toosmall()
1826 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, bp->b_addr); in xfs_attr3_leaf_toosmall()
1828 bytes = state->args->geo->blksize - in xfs_attr3_leaf_toosmall()
1829 (state->args->geo->blksize >> 2) - in xfs_attr3_leaf_toosmall()
1835 xfs_trans_brelse(state->args->trans, bp); in xfs_attr3_leaf_toosmall()
1848 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_attr3_leaf_toosmall()
1850 error = xfs_da3_path_shift(state, &state->altpath, forward, in xfs_attr3_leaf_toosmall()
1853 error = xfs_da3_path_shift(state, &state->path, forward, in xfs_attr3_leaf_toosmall()
2028 struct xfs_da_state *state, in xfs_attr3_leaf_unbalance() argument
2038 trace_xfs_attr_leaf_unbalance(state->args); in xfs_attr3_leaf_unbalance()
2042 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &drophdr, drop_leaf); in xfs_attr3_leaf_unbalance()
2043 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &savehdr, save_leaf); in xfs_attr3_leaf_unbalance()
2063 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2068 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2081 tmp_leaf = kmem_zalloc(state->args->geo->blksize, KM_SLEEP); in xfs_attr3_leaf_unbalance()
2094 tmphdr.firstused = state->args->geo->blksize; in xfs_attr3_leaf_unbalance()
2097 xfs_attr3_leaf_hdr_to_disk(state->args->geo, tmp_leaf, &tmphdr); in xfs_attr3_leaf_unbalance()
2101 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2105 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2110 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2114 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2119 memcpy(save_leaf, tmp_leaf, state->args->geo->blksize); in xfs_attr3_leaf_unbalance()
2124 xfs_attr3_leaf_hdr_to_disk(state->args->geo, save_leaf, &savehdr); in xfs_attr3_leaf_unbalance()
2125 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0, in xfs_attr3_leaf_unbalance()
2126 state->args->geo->blksize - 1); in xfs_attr3_leaf_unbalance()