Lines Matching refs:state
55 STATIC void xfs_attr3_leaf_rebalance(xfs_da_state_t *state,
58 STATIC int xfs_attr3_leaf_figure_balance(xfs_da_state_t *state,
492 /* All remaining matches need to be filtered by INCOMPLETE state. */
1344 struct xfs_da_state *state,
1351 trace_xfs_attr_leaf_split(state->args);
1357 error = xfs_da_grow_inode(state->args, &blkno);
1360 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp);
1370 xfs_attr3_leaf_rebalance(state, oldblk, newblk);
1371 error = xfs_da3_blk_link(state, oldblk, newblk);
1382 if (state->inleaf) {
1383 trace_xfs_attr_leaf_add_old(state->args);
1384 error = xfs_attr3_leaf_add(oldblk->bp, state->args);
1386 trace_xfs_attr_leaf_add_new(state->args);
1387 error = xfs_attr3_leaf_add(newblk->bp, state->args);
1713 struct xfs_da_state *state,
1737 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr1, leaf1);
1738 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, leaf2);
1740 args = state->args;
1770 state->inleaf = xfs_attr3_leaf_figure_balance(state, blk1, &ichdr1,
1774 state->inleaf = !state->inleaf;
1832 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf1, &ichdr1);
1833 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf2, &ichdr2);
1858 ASSERT(state->inleaf == 0);
1863 if (state->inleaf) {
1877 if (!state->extravalid) {
1888 ASSERT(state->inleaf == 1);
1903 struct xfs_da_state *state,
1930 xfs_attr_leaf_newentsize(state->args, NULL);
1932 lastdelta = state->args->geo->blksize;
1942 xfs_attr_leaf_newentsize(state->args, NULL);
1978 xfs_attr_leaf_newentsize(state->args, NULL);
1995 * If the block is empty, fill in the state structure and return 2.
1996 * If it can be collapsed, fill in the state structure and return 1.
2003 struct xfs_da_state *state,
2017 trace_xfs_attr_leaf_toosmall(state->args);
2024 blk = &state->path.blk[ state->path.active-1 ];
2026 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf);
2030 if (bytes > (state->args->geo->blksize >> 1)) {
2047 memcpy(&state->altpath, &state->path, sizeof(state->path));
2048 error = xfs_da3_path_shift(state, &state->altpath, forward,
2077 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp,
2082 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, bp->b_addr);
2084 bytes = state->args->geo->blksize -
2085 (state->args->geo->blksize >> 2) -
2091 xfs_trans_brelse(state->args->trans, bp);
2104 memcpy(&state->altpath, &state->path, sizeof(state->path));
2106 error = xfs_da3_path_shift(state, &state->altpath, forward,
2109 error = xfs_da3_path_shift(state, &state->path, forward,
2284 struct xfs_da_state *state,
2294 trace_xfs_attr_leaf_unbalance(state->args);
2296 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &drophdr, drop_leaf);
2297 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &savehdr, save_leaf);
2317 xfs_attr3_leaf_moveents(state->args,
2322 xfs_attr3_leaf_moveents(state->args,
2335 tmp_leaf = kmem_zalloc(state->args->geo->blksize, 0);
2348 tmphdr.firstused = state->args->geo->blksize;
2351 xfs_attr3_leaf_hdr_to_disk(state->args->geo, tmp_leaf, &tmphdr);
2355 xfs_attr3_leaf_moveents(state->args,
2359 xfs_attr3_leaf_moveents(state->args,
2364 xfs_attr3_leaf_moveents(state->args,
2368 xfs_attr3_leaf_moveents(state->args,
2373 memcpy(save_leaf, tmp_leaf, state->args->geo->blksize);
2378 xfs_attr3_leaf_hdr_to_disk(state->args->geo, save_leaf, &savehdr);
2379 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0,
2380 state->args->geo->blksize - 1);