• Home
  • Raw
  • Download

Lines Matching refs:state

56 static void xfs_dir2_leafn_rebalance(xfs_da_state_t *state,
398 xfs_da_state_t *state) /* state to fill in */ in xfs_dir2_leafn_lookup_for_addname() argument
432 if (state->extravalid) { in xfs_dir2_leafn_lookup_for_addname()
434 curbp = state->extrablk.bp; in xfs_dir2_leafn_lookup_for_addname()
435 curfdb = state->extrablk.blkno; in xfs_dir2_leafn_lookup_for_addname()
521 state->extravalid = 1; in xfs_dir2_leafn_lookup_for_addname()
522 state->extrablk.bp = curbp; in xfs_dir2_leafn_lookup_for_addname()
523 state->extrablk.index = fi; in xfs_dir2_leafn_lookup_for_addname()
524 state->extrablk.blkno = curfdb; in xfs_dir2_leafn_lookup_for_addname()
525 state->extrablk.magic = XFS_DIR2_FREE_MAGIC; in xfs_dir2_leafn_lookup_for_addname()
527 state->extravalid = 0; in xfs_dir2_leafn_lookup_for_addname()
545 xfs_da_state_t *state) /* state to fill in */ in xfs_dir2_leafn_lookup_for_entry() argument
576 if (state->extravalid) { in xfs_dir2_leafn_lookup_for_entry()
577 curbp = state->extrablk.bp; in xfs_dir2_leafn_lookup_for_entry()
578 curdb = state->extrablk.blkno; in xfs_dir2_leafn_lookup_for_entry()
607 curdb != state->extrablk.blkno)) in xfs_dir2_leafn_lookup_for_entry()
614 newdb == state->extrablk.blkno) { in xfs_dir2_leafn_lookup_for_entry()
615 ASSERT(state->extravalid); in xfs_dir2_leafn_lookup_for_entry()
616 curbp = state->extrablk.bp; in xfs_dir2_leafn_lookup_for_entry()
641 curdb != state->extrablk.blkno) in xfs_dir2_leafn_lookup_for_entry()
642 xfs_da_brelse(tp, state->extrablk.bp); in xfs_dir2_leafn_lookup_for_entry()
646 state->extravalid = 1; in xfs_dir2_leafn_lookup_for_entry()
647 state->extrablk.bp = curbp; in xfs_dir2_leafn_lookup_for_entry()
648 state->extrablk.blkno = curdb; in xfs_dir2_leafn_lookup_for_entry()
649 state->extrablk.index = (int)((char *)dep - in xfs_dir2_leafn_lookup_for_entry()
651 state->extrablk.magic = XFS_DIR2_DATA_MAGIC; in xfs_dir2_leafn_lookup_for_entry()
661 state->extravalid = 1; in xfs_dir2_leafn_lookup_for_entry()
662 state->extrablk.bp = curbp; in xfs_dir2_leafn_lookup_for_entry()
663 state->extrablk.index = -1; in xfs_dir2_leafn_lookup_for_entry()
664 state->extrablk.blkno = curdb; in xfs_dir2_leafn_lookup_for_entry()
665 state->extrablk.magic = XFS_DIR2_DATA_MAGIC; in xfs_dir2_leafn_lookup_for_entry()
668 if (state->extrablk.bp != curbp) in xfs_dir2_leafn_lookup_for_entry()
672 state->extravalid = 0; in xfs_dir2_leafn_lookup_for_entry()
688 xfs_da_state_t *state) /* state to fill in */ in xfs_dir2_leafn_lookup_int() argument
692 state); in xfs_dir2_leafn_lookup_int()
693 return xfs_dir2_leafn_lookup_for_entry(bp, args, indexp, state); in xfs_dir2_leafn_lookup_int()
812 xfs_da_state_t *state, /* btree cursor */ in xfs_dir2_leafn_rebalance() argument
828 args = state->args; in xfs_dir2_leafn_rebalance()
883 state->inleaf = swap; in xfs_dir2_leafn_rebalance()
885 state->inleaf = !swap; in xfs_dir2_leafn_rebalance()
887 state->inleaf = in xfs_dir2_leafn_rebalance()
892 if (!state->inleaf) in xfs_dir2_leafn_rebalance()
900 state->inleaf = 1; in xfs_dir2_leafn_rebalance()
1123 xfs_da_state_t *state, /* btree cursor */ in xfs_dir2_leafn_split() argument
1135 args = state->args; in xfs_dir2_leafn_split()
1157 xfs_dir2_leafn_rebalance(state, oldblk, newblk); in xfs_dir2_leafn_split()
1158 error = xfs_da_blk_link(state, oldblk, newblk); in xfs_dir2_leafn_split()
1165 if (state->inleaf) in xfs_dir2_leafn_split()
1190 xfs_da_state_t *state, /* btree cursor */ in xfs_dir2_leafn_toosmall() argument
1210 blk = &state->path.blk[state->path.active - 1]; in xfs_dir2_leafn_toosmall()
1216 if (bytes > (state->blocksize >> 1)) { in xfs_dir2_leafn_toosmall()
1235 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_dir2_leafn_toosmall()
1236 error = xfs_da_path_shift(state, &state->altpath, forward, 0, in xfs_dir2_leafn_toosmall()
1259 xfs_da_read_buf(state->args->trans, state->args->dp, blkno, in xfs_dir2_leafn_toosmall()
1269 bytes = state->blocksize - (state->blocksize >> 2); in xfs_dir2_leafn_toosmall()
1279 xfs_da_brelse(state->args->trans, bp); in xfs_dir2_leafn_toosmall()
1297 memcpy(&state->altpath, &state->path, sizeof(state->path)); in xfs_dir2_leafn_toosmall()
1299 error = xfs_da_path_shift(state, &state->altpath, forward, 0, in xfs_dir2_leafn_toosmall()
1302 error = xfs_da_path_shift(state, &state->path, forward, 0, in xfs_dir2_leafn_toosmall()
1317 xfs_da_state_t *state, /* cursor */ in xfs_dir2_leafn_unbalance() argument
1325 args = state->args; in xfs_dir2_leafn_unbalance()
1364 xfs_da_state_t *state; /* btree cursor */ in xfs_dir2_node_addname() local
1370 state = xfs_da_state_alloc(); in xfs_dir2_node_addname()
1371 state->args = args; in xfs_dir2_node_addname()
1372 state->mp = args->dp->i_mount; in xfs_dir2_node_addname()
1373 state->blocksize = state->mp->m_dirblksize; in xfs_dir2_node_addname()
1374 state->node_ents = state->mp->m_dir_node_ents; in xfs_dir2_node_addname()
1379 error = xfs_da_node_lookup_int(state, &rval); in xfs_dir2_node_addname()
1390 state->extravalid ? &state->extrablk : NULL); in xfs_dir2_node_addname()
1394 blk = &state->path.blk[state->path.active - 1]; in xfs_dir2_node_addname()
1405 xfs_da_fixhashpath(state, &state->path); in xfs_dir2_node_addname()
1417 rval = xfs_da_split(state); in xfs_dir2_node_addname()
1420 xfs_da_state_free(state); in xfs_dir2_node_addname()
1823 xfs_da_state_t *state; /* btree cursor */ in xfs_dir2_node_lookup() local
1829 state = xfs_da_state_alloc(); in xfs_dir2_node_lookup()
1830 state->args = args; in xfs_dir2_node_lookup()
1831 state->mp = args->dp->i_mount; in xfs_dir2_node_lookup()
1832 state->blocksize = state->mp->m_dirblksize; in xfs_dir2_node_lookup()
1833 state->node_ents = state->mp->m_dir_node_ents; in xfs_dir2_node_lookup()
1837 error = xfs_da_node_lookup_int(state, &rval); in xfs_dir2_node_lookup()
1844 dep = (xfs_dir2_data_entry_t *)((char *)state->extrablk.bp-> in xfs_dir2_node_lookup()
1845 data + state->extrablk.index); in xfs_dir2_node_lookup()
1851 for (i = 0; i < state->path.active; i++) { in xfs_dir2_node_lookup()
1852 xfs_da_brelse(args->trans, state->path.blk[i].bp); in xfs_dir2_node_lookup()
1853 state->path.blk[i].bp = NULL; in xfs_dir2_node_lookup()
1858 if (state->extravalid && state->extrablk.bp) { in xfs_dir2_node_lookup()
1859 xfs_da_brelse(args->trans, state->extrablk.bp); in xfs_dir2_node_lookup()
1860 state->extrablk.bp = NULL; in xfs_dir2_node_lookup()
1862 xfs_da_state_free(state); in xfs_dir2_node_lookup()
1876 xfs_da_state_t *state; /* btree cursor */ in xfs_dir2_node_removename() local
1882 state = xfs_da_state_alloc(); in xfs_dir2_node_removename()
1883 state->args = args; in xfs_dir2_node_removename()
1884 state->mp = args->dp->i_mount; in xfs_dir2_node_removename()
1885 state->blocksize = state->mp->m_dirblksize; in xfs_dir2_node_removename()
1886 state->node_ents = state->mp->m_dir_node_ents; in xfs_dir2_node_removename()
1890 error = xfs_da_node_lookup_int(state, &rval); in xfs_dir2_node_removename()
1897 xfs_da_state_free(state); in xfs_dir2_node_removename()
1900 blk = &state->path.blk[state->path.active - 1]; in xfs_dir2_node_removename()
1902 ASSERT(state->extravalid); in xfs_dir2_node_removename()
1908 &state->extrablk, &rval); in xfs_dir2_node_removename()
1914 xfs_da_fixhashpath(state, &state->path); in xfs_dir2_node_removename()
1918 if (rval && state->path.active > 1) in xfs_dir2_node_removename()
1919 error = xfs_da_join(state); in xfs_dir2_node_removename()
1924 error = xfs_dir2_node_to_leaf(state); in xfs_dir2_node_removename()
1925 xfs_da_state_free(state); in xfs_dir2_node_removename()
1945 xfs_da_state_t *state; /* btree cursor */ in xfs_dir2_node_replace() local
1951 state = xfs_da_state_alloc(); in xfs_dir2_node_replace()
1952 state->args = args; in xfs_dir2_node_replace()
1953 state->mp = args->dp->i_mount; in xfs_dir2_node_replace()
1954 state->blocksize = state->mp->m_dirblksize; in xfs_dir2_node_replace()
1955 state->node_ents = state->mp->m_dir_node_ents; in xfs_dir2_node_replace()
1960 error = xfs_da_node_lookup_int(state, &rval); in xfs_dir2_node_replace()
1972 blk = &state->path.blk[state->path.active - 1]; in xfs_dir2_node_replace()
1976 ASSERT(state->extravalid); in xfs_dir2_node_replace()
1980 data = state->extrablk.bp->data; in xfs_dir2_node_replace()
1984 xfs_dir2_dataptr_to_off(state->mp, be32_to_cpu(lep->address))); in xfs_dir2_node_replace()
1990 xfs_dir2_data_log_entry(args->trans, state->extrablk.bp, dep); in xfs_dir2_node_replace()
1996 else if (state->extravalid) { in xfs_dir2_node_replace()
1997 xfs_da_brelse(args->trans, state->extrablk.bp); in xfs_dir2_node_replace()
1998 state->extrablk.bp = NULL; in xfs_dir2_node_replace()
2003 for (i = 0; i < state->path.active; i++) { in xfs_dir2_node_replace()
2004 xfs_da_brelse(args->trans, state->path.blk[i].bp); in xfs_dir2_node_replace()
2005 state->path.blk[i].bp = NULL; in xfs_dir2_node_replace()
2007 xfs_da_state_free(state); in xfs_dir2_node_replace()