• Home
  • Raw
  • Download

Lines Matching refs:state

57 STATIC int xfs_da3_root_split(xfs_da_state_t *state,
60 STATIC int xfs_da3_node_split(xfs_da_state_t *state,
66 STATIC void xfs_da3_node_rebalance(xfs_da_state_t *state,
69 STATIC void xfs_da3_node_add(xfs_da_state_t *state,
76 STATIC int xfs_da3_root_join(xfs_da_state_t *state,
78 STATIC int xfs_da3_node_toosmall(xfs_da_state_t *state, int *retval);
79 STATIC void xfs_da3_node_remove(xfs_da_state_t *state,
81 STATIC void xfs_da3_node_unbalance(xfs_da_state_t *state,
88 STATIC int xfs_da3_blk_unlink(xfs_da_state_t *state,
109 xfs_da_state_kill_altpath(xfs_da_state_t *state) in xfs_da_state_kill_altpath() argument
113 for (i = 0; i < state->altpath.active; i++) in xfs_da_state_kill_altpath()
114 state->altpath.blk[i].bp = NULL; in xfs_da_state_kill_altpath()
115 state->altpath.active = 0; in xfs_da_state_kill_altpath()
122 xfs_da_state_free(xfs_da_state_t *state) in xfs_da_state_free() argument
124 xfs_da_state_kill_altpath(state); in xfs_da_state_free()
126 memset((char *)state, 0, sizeof(*state)); in xfs_da_state_free()
128 kmem_zone_free(xfs_da_state_zone, state); in xfs_da_state_free()
353 struct xfs_da_state *state) in xfs_da3_split() argument
364 trace_xfs_da_split(state->args); in xfs_da3_split()
372 max = state->path.active - 1; in xfs_da3_split()
374 ASSERT(state->path.blk[max].magic == XFS_ATTR_LEAF_MAGIC || in xfs_da3_split()
375 state->path.blk[max].magic == XFS_DIR2_LEAFN_MAGIC); in xfs_da3_split()
377 addblk = &state->path.blk[max]; /* initial dummy value */ in xfs_da3_split()
378 for (i = max; (i >= 0) && addblk; state->path.active--, i--) { in xfs_da3_split()
379 oldblk = &state->path.blk[i]; in xfs_da3_split()
380 newblk = &state->altpath.blk[i]; in xfs_da3_split()
390 error = xfs_attr3_leaf_split(state, oldblk, newblk); in xfs_da3_split()
403 state->extravalid = 1; in xfs_da3_split()
404 if (state->inleaf) { in xfs_da3_split()
405 state->extraafter = 0; /* before newblk */ in xfs_da3_split()
406 trace_xfs_attr_leaf_split_before(state->args); in xfs_da3_split()
407 error = xfs_attr3_leaf_split(state, oldblk, in xfs_da3_split()
408 &state->extrablk); in xfs_da3_split()
410 state->extraafter = 1; /* after newblk */ in xfs_da3_split()
411 trace_xfs_attr_leaf_split_after(state->args); in xfs_da3_split()
412 error = xfs_attr3_leaf_split(state, newblk, in xfs_da3_split()
413 &state->extrablk); in xfs_da3_split()
420 error = xfs_dir2_leafn_split(state, oldblk, newblk); in xfs_da3_split()
426 error = xfs_da3_node_split(state, oldblk, newblk, addblk, in xfs_da3_split()
444 xfs_da3_fixhashpath(state, &state->path); in xfs_da3_split()
454 ASSERT(state->extravalid == 0 || in xfs_da3_split()
455 state->path.blk[max].magic == XFS_DIR2_LEAFN_MAGIC); in xfs_da3_split()
460 ASSERT(state->path.active == 0); in xfs_da3_split()
461 oldblk = &state->path.blk[0]; in xfs_da3_split()
462 error = xfs_da3_root_split(state, oldblk, addblk); in xfs_da3_split()
484 xfs_trans_log_buf(state->args->trans, addblk->bp, in xfs_da3_split()
493 xfs_trans_log_buf(state->args->trans, addblk->bp, in xfs_da3_split()
508 struct xfs_da_state *state, in xfs_da3_root_split() argument
526 trace_xfs_da_root_split(state->args); in xfs_da3_root_split()
532 args = state->args; in xfs_da3_root_split()
639 struct xfs_da_state *state, in xfs_da3_node_split() argument
652 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_split()
654 trace_xfs_da_node_split(state->args); in xfs_da3_node_split()
662 useextra = state->extravalid && state->args->whichfork == XFS_ATTR_FORK; in xfs_da3_node_split()
667 if (nodehdr.count + newcount > state->args->geo->node_ents) { in xfs_da3_node_split()
672 error = xfs_da_grow_inode(state->args, &blkno); in xfs_da3_node_split()
676 error = xfs_da3_node_create(state->args, blkno, treelevel, in xfs_da3_node_split()
677 &newblk->bp, state->args->whichfork); in xfs_da3_node_split()
682 xfs_da3_node_rebalance(state, oldblk, newblk); in xfs_da3_node_split()
683 error = xfs_da3_blk_link(state, oldblk, newblk); in xfs_da3_node_split()
707 xfs_da3_node_add(state, oldblk, addblk); in xfs_da3_node_split()
709 if (state->extraafter) in xfs_da3_node_split()
711 xfs_da3_node_add(state, oldblk, &state->extrablk); in xfs_da3_node_split()
712 state->extravalid = 0; in xfs_da3_node_split()
716 xfs_da3_node_add(state, newblk, addblk); in xfs_da3_node_split()
718 if (state->extraafter) in xfs_da3_node_split()
720 xfs_da3_node_add(state, newblk, &state->extrablk); in xfs_da3_node_split()
721 state->extravalid = 0; in xfs_da3_node_split()
736 struct xfs_da_state *state, in xfs_da3_node_rebalance() argument
753 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_rebalance()
755 trace_xfs_da_node_rebalance(state->args); in xfs_da3_node_rebalance()
785 tp = state->args->trans; in xfs_da3_node_rebalance()
879 struct xfs_da_state *state, in xfs_da3_node_add() argument
887 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_add()
889 trace_xfs_da_node_add(state->args); in xfs_da3_node_add()
897 if (state->args->whichfork == XFS_DATA_FORK) in xfs_da3_node_add()
898 ASSERT(newblk->blkno >= state->args->geo->leafblk && in xfs_da3_node_add()
899 newblk->blkno < state->args->geo->freeblk); in xfs_da3_node_add()
911 xfs_trans_log_buf(state->args->trans, oldblk->bp, in xfs_da3_node_add()
917 xfs_trans_log_buf(state->args->trans, oldblk->bp, in xfs_da3_node_add()
936 struct xfs_da_state *state) in xfs_da3_join() argument
943 trace_xfs_da_join(state->args); in xfs_da3_join()
945 drop_blk = &state->path.blk[ state->path.active-1 ]; in xfs_da3_join()
946 save_blk = &state->altpath.blk[ state->path.active-1 ]; in xfs_da3_join()
947 ASSERT(state->path.blk[0].magic == XFS_DA_NODE_MAGIC); in xfs_da3_join()
955 for ( ; state->path.active >= 2; drop_blk--, save_blk--, in xfs_da3_join()
956 state->path.active--) { in xfs_da3_join()
965 error = xfs_attr3_leaf_toosmall(state, &action); in xfs_da3_join()
970 xfs_attr3_leaf_unbalance(state, drop_blk, save_blk); in xfs_da3_join()
973 error = xfs_dir2_leafn_toosmall(state, &action); in xfs_da3_join()
978 xfs_dir2_leafn_unbalance(state, drop_blk, save_blk); in xfs_da3_join()
985 xfs_da3_node_remove(state, drop_blk); in xfs_da3_join()
986 xfs_da3_fixhashpath(state, &state->path); in xfs_da3_join()
987 error = xfs_da3_node_toosmall(state, &action); in xfs_da3_join()
992 xfs_da3_node_unbalance(state, drop_blk, save_blk); in xfs_da3_join()
995 xfs_da3_fixhashpath(state, &state->altpath); in xfs_da3_join()
996 error = xfs_da3_blk_unlink(state, drop_blk, save_blk); in xfs_da3_join()
997 xfs_da_state_kill_altpath(state); in xfs_da3_join()
1000 error = xfs_da_shrink_inode(state->args, drop_blk->blkno, in xfs_da3_join()
1011 xfs_da3_node_remove(state, drop_blk); in xfs_da3_join()
1012 xfs_da3_fixhashpath(state, &state->path); in xfs_da3_join()
1013 error = xfs_da3_root_join(state, &state->path.blk[0]); in xfs_da3_join()
1045 struct xfs_da_state *state, in xfs_da3_root_join() argument
1055 struct xfs_inode *dp = state->args->dp; in xfs_da3_root_join()
1057 trace_xfs_da_root_join(state->args); in xfs_da3_root_join()
1061 args = state->args; in xfs_da3_root_join()
1117 struct xfs_da_state *state, in xfs_da3_node_toosmall() argument
1131 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_toosmall()
1133 trace_xfs_da_node_toosmall(state->args); in xfs_da3_node_toosmall()
1140 blk = &state->path.blk[ state->path.active-1 ]; in xfs_da3_node_toosmall()
1144 if (nodehdr.count > (state->args->geo->node_ents >> 1)) { in xfs_da3_node_toosmall()
1161 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_da3_node_toosmall()
1162 error = xfs_da3_path_shift(state, &state->altpath, forward, in xfs_da3_node_toosmall()
1181 count = state->args->geo->node_ents; in xfs_da3_node_toosmall()
1182 count -= state->args->geo->node_ents >> 2; in xfs_da3_node_toosmall()
1195 error = xfs_da3_node_read(state->args->trans, dp, in xfs_da3_node_toosmall()
1196 blkno, -1, &bp, state->args->whichfork); in xfs_da3_node_toosmall()
1202 xfs_trans_brelse(state->args->trans, bp); in xfs_da3_node_toosmall()
1216 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_da3_node_toosmall()
1218 error = xfs_da3_path_shift(state, &state->altpath, forward, in xfs_da3_node_toosmall()
1221 error = xfs_da3_path_shift(state, &state->path, forward, in xfs_da3_node_toosmall()
1263 struct xfs_da_state *state, in xfs_da3_fixhashpath() argument
1272 struct xfs_inode *dp = state->args->dp; in xfs_da3_fixhashpath()
1274 trace_xfs_da_fixhashpath(state->args); in xfs_da3_fixhashpath()
1305 xfs_trans_log_buf(state->args->trans, blk->bp, in xfs_da3_fixhashpath()
1318 struct xfs_da_state *state, in xfs_da3_node_remove() argument
1326 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_remove()
1328 trace_xfs_da_node_remove(state->args); in xfs_da3_node_remove()
1344 xfs_trans_log_buf(state->args->trans, drop_blk->bp, in xfs_da3_node_remove()
1349 xfs_trans_log_buf(state->args->trans, drop_blk->bp, in xfs_da3_node_remove()
1353 xfs_trans_log_buf(state->args->trans, drop_blk->bp, in xfs_da3_node_remove()
1368 struct xfs_da_state *state, in xfs_da3_node_unbalance() argument
1381 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_unbalance()
1383 trace_xfs_da_node_unbalance(state->args); in xfs_da3_node_unbalance()
1391 tp = state->args->trans; in xfs_da3_node_unbalance()
1452 struct xfs_da_state *state, in xfs_da3_node_lookup_int() argument
1469 struct xfs_inode *dp = state->args->dp; in xfs_da3_node_lookup_int()
1471 args = state->args; in xfs_da3_node_lookup_int()
1478 for (blk = &state->path.blk[0], state->path.active = 1; in xfs_da3_node_lookup_int()
1479 state->path.active <= XFS_DA_NODE_MAXDEPTH; in xfs_da3_node_lookup_int()
1480 blk++, state->path.active++) { in xfs_da3_node_lookup_int()
1489 state->path.active--; in xfs_da3_node_lookup_int()
1576 &blk->index, state); in xfs_da3_node_lookup_int()
1587 error = xfs_da3_path_shift(state, &state->path, 1, 1, in xfs_da3_node_lookup_int()
1645 struct xfs_da_state *state, in xfs_da3_blk_link() argument
1656 struct xfs_inode *dp = state->args->dp; in xfs_da3_blk_link()
1661 args = state->args; in xfs_da3_blk_link()
1738 struct xfs_da_state *state, in xfs_da3_blk_unlink() argument
1752 args = state->args; in xfs_da3_blk_unlink()
1818 struct xfs_da_state *state, in xfs_da3_path_shift() argument
1834 struct xfs_inode *dp = state->args->dp; in xfs_da3_path_shift()
1836 trace_xfs_da_path_shift(state->args); in xfs_da3_path_shift()
1843 args = state->args; in xfs_da3_path_shift()