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,
1299 struct xfs_da_state *state,
1306 trace_xfs_attr_leaf_split(state->args);
1312 error = xfs_da_grow_inode(state->args, &blkno);
1315 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp);
1325 xfs_attr3_leaf_rebalance(state, oldblk, newblk);
1326 error = xfs_da3_blk_link(state, oldblk, newblk);
1337 if (state->inleaf) {
1338 trace_xfs_attr_leaf_add_old(state->args);
1339 error = xfs_attr3_leaf_add(oldblk->bp, state->args);
1341 trace_xfs_attr_leaf_add_new(state->args);
1342 error = xfs_attr3_leaf_add(newblk->bp, state->args);
1667 struct xfs_da_state *state,
1691 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr1, leaf1);
1692 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, leaf2);
1694 args = state->args;
1724 state->inleaf = xfs_attr3_leaf_figure_balance(state, blk1, &ichdr1,
1728 state->inleaf = !state->inleaf;
1786 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf1, &ichdr1);
1787 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf2, &ichdr2);
1812 ASSERT(state->inleaf == 0);
1817 if (state->inleaf) {
1831 if (!state->extravalid) {
1842 ASSERT(state->inleaf == 1);
1857 struct xfs_da_state *state,
1884 xfs_attr_leaf_newentsize(state->args, NULL);
1886 lastdelta = state->args->geo->blksize;
1896 xfs_attr_leaf_newentsize(state->args, NULL);
1932 xfs_attr_leaf_newentsize(state->args, NULL);
1949 * If the block is empty, fill in the state structure and return 2.
1950 * If it can be collapsed, fill in the state structure and return 1.
1957 struct xfs_da_state *state,
1971 trace_xfs_attr_leaf_toosmall(state->args);
1978 blk = &state->path.blk[ state->path.active-1 ];
1980 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf);
1984 if (bytes > (state->args->geo->blksize >> 1)) {
2001 memcpy(&state->altpath, &state->path, sizeof(state->path));
2002 error = xfs_da3_path_shift(state, &state->altpath, forward,
2031 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp,
2036 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, bp->b_addr);
2038 bytes = state->args->geo->blksize -
2039 (state->args->geo->blksize >> 2) -
2045 xfs_trans_brelse(state->args->trans, bp);
2058 memcpy(&state->altpath, &state->path, sizeof(state->path));
2060 error = xfs_da3_path_shift(state, &state->altpath, forward,
2063 error = xfs_da3_path_shift(state, &state->path, forward,
2238 struct xfs_da_state *state,
2248 trace_xfs_attr_leaf_unbalance(state->args);
2252 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &drophdr, drop_leaf);
2253 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &savehdr, save_leaf);
2273 xfs_attr3_leaf_moveents(state->args,
2278 xfs_attr3_leaf_moveents(state->args,
2291 tmp_leaf = kmem_zalloc(state->args->geo->blksize, 0);
2304 tmphdr.firstused = state->args->geo->blksize;
2307 xfs_attr3_leaf_hdr_to_disk(state->args->geo, tmp_leaf, &tmphdr);
2311 xfs_attr3_leaf_moveents(state->args,
2315 xfs_attr3_leaf_moveents(state->args,
2320 xfs_attr3_leaf_moveents(state->args,
2324 xfs_attr3_leaf_moveents(state->args,
2329 memcpy(save_leaf, tmp_leaf, state->args->geo->blksize);
2334 xfs_attr3_leaf_hdr_to_disk(state->args->geo, save_leaf, &savehdr);
2335 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0,
2336 state->args->geo->blksize - 1);