Lines Matching refs:state
64 STATIC void xfs_attr_leaf_rebalance(xfs_da_state_t *state,
67 STATIC int xfs_attr_leaf_figure_balance(xfs_da_state_t *state,
949 xfs_attr_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, in xfs_attr_leaf_split() argument
959 error = xfs_da_grow_inode(state->args, &blkno); in xfs_attr_leaf_split()
962 error = xfs_attr_leaf_create(state->args, blkno, &newblk->bp); in xfs_attr_leaf_split()
972 xfs_attr_leaf_rebalance(state, oldblk, newblk); in xfs_attr_leaf_split()
973 error = xfs_da_blk_link(state, oldblk, newblk); in xfs_attr_leaf_split()
984 if (state->inleaf) in xfs_attr_leaf_split()
985 error = xfs_attr_leaf_add(oldblk->bp, state->args); in xfs_attr_leaf_split()
987 error = xfs_attr_leaf_add(newblk->bp, state->args); in xfs_attr_leaf_split()
1252 xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, in xfs_attr_leaf_rebalance() argument
1270 args = state->args; in xfs_attr_leaf_rebalance()
1298 state->inleaf = xfs_attr_leaf_figure_balance(state, blk1, blk2, in xfs_attr_leaf_rebalance()
1301 state->inleaf = !state->inleaf; in xfs_attr_leaf_rebalance()
1329 leaf2, 0, count, state->mp); in xfs_attr_leaf_rebalance()
1331 xfs_da_log_buf(args->trans, blk1->bp, 0, state->blocksize-1); in xfs_attr_leaf_rebalance()
1332 xfs_da_log_buf(args->trans, blk2->bp, 0, state->blocksize-1); in xfs_attr_leaf_rebalance()
1361 be16_to_cpu(hdr1->count), count, state->mp); in xfs_attr_leaf_rebalance()
1363 xfs_da_log_buf(args->trans, blk1->bp, 0, state->blocksize-1); in xfs_attr_leaf_rebalance()
1364 xfs_da_log_buf(args->trans, blk2->bp, 0, state->blocksize-1); in xfs_attr_leaf_rebalance()
1388 ASSERT(state->inleaf == 0); in xfs_attr_leaf_rebalance()
1393 if (state->inleaf) { in xfs_attr_leaf_rebalance()
1405 ASSERT(state->inleaf == 1); in xfs_attr_leaf_rebalance()
1419 xfs_attr_leaf_figure_balance(xfs_da_state_t *state, in xfs_attr_leaf_figure_balance() argument
1449 state->args->namelen, in xfs_attr_leaf_figure_balance()
1450 state->args->valuelen, in xfs_attr_leaf_figure_balance()
1451 state->blocksize, NULL); in xfs_attr_leaf_figure_balance()
1453 lastdelta = state->blocksize; in xfs_attr_leaf_figure_balance()
1464 state->args->namelen, in xfs_attr_leaf_figure_balance()
1465 state->args->valuelen, in xfs_attr_leaf_figure_balance()
1466 state->blocksize, NULL); in xfs_attr_leaf_figure_balance()
1503 state->args->namelen, in xfs_attr_leaf_figure_balance()
1504 state->args->valuelen, in xfs_attr_leaf_figure_balance()
1505 state->blocksize, NULL); in xfs_attr_leaf_figure_balance()
1529 xfs_attr_leaf_toosmall(xfs_da_state_t *state, int *action) in xfs_attr_leaf_toosmall() argument
1543 blk = &state->path.blk[ state->path.active-1 ]; in xfs_attr_leaf_toosmall()
1551 if (bytes > (state->blocksize >> 1)) { in xfs_attr_leaf_toosmall()
1568 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_attr_leaf_toosmall()
1569 error = xfs_da_path_shift(state, &state->altpath, forward, in xfs_attr_leaf_toosmall()
1597 error = xfs_da_read_buf(state->args->trans, state->args->dp, in xfs_attr_leaf_toosmall()
1605 bytes = state->blocksize - (state->blocksize>>2); in xfs_attr_leaf_toosmall()
1613 xfs_da_brelse(state->args->trans, bp); in xfs_attr_leaf_toosmall()
1626 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_attr_leaf_toosmall()
1628 error = xfs_da_path_shift(state, &state->altpath, forward, in xfs_attr_leaf_toosmall()
1631 error = xfs_da_path_shift(state, &state->path, forward, in xfs_attr_leaf_toosmall()
1809 xfs_attr_leaf_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk, in xfs_attr_leaf_unbalance() argument
1820 mp = state->mp; in xfs_attr_leaf_unbalance()
1859 tmpbuffer = kmem_alloc(state->blocksize, KM_SLEEP); in xfs_attr_leaf_unbalance()
1861 memset(tmpbuffer, 0, state->blocksize); in xfs_attr_leaf_unbalance()
1866 tmp_hdr->firstused = cpu_to_be16(state->blocksize); in xfs_attr_leaf_unbalance()
1869 state->blocksize - XFS_ATTR_LEAF_NAME_ALIGN); in xfs_attr_leaf_unbalance()
1885 memcpy((char *)save_leaf, (char *)tmp_leaf, state->blocksize); in xfs_attr_leaf_unbalance()
1889 xfs_da_log_buf(state->args->trans, save_blk->bp, 0, in xfs_attr_leaf_unbalance()
1890 state->blocksize - 1); in xfs_attr_leaf_unbalance()