Lines Matching refs:args
27 static int xfs_dir2_leafn_add(struct xfs_buf *bp, xfs_da_args_t *args,
32 static int xfs_dir2_leafn_remove(xfs_da_args_t *args, struct xfs_buf *bp,
318 xfs_da_args_t *args, in xfs_dir3_free_get_buf() argument
322 struct xfs_trans *tp = args->trans; in xfs_dir3_free_get_buf()
323 struct xfs_inode *dp = args->dp; in xfs_dir3_free_get_buf()
329 error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, fbno), in xfs_dir3_free_get_buf()
364 struct xfs_da_args *args, in xfs_dir2_free_log_bests() argument
374 xfs_trans_log_buf(args->trans, bp, in xfs_dir2_free_log_bests()
385 struct xfs_da_args *args, in xfs_dir2_free_log_header() argument
395 xfs_trans_log_buf(args->trans, bp, 0, in xfs_dir2_free_log_header()
396 args->geo->free_hdr_size - 1); in xfs_dir2_free_log_header()
406 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_to_node() argument
422 trace_xfs_dir2_leaf_to_node(args); in xfs_dir2_leaf_to_node()
424 dp = args->dp; in xfs_dir2_leaf_to_node()
425 tp = args->trans; in xfs_dir2_leaf_to_node()
429 if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fdb))) { in xfs_dir2_leaf_to_node()
432 ASSERT(fdb == xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET)); in xfs_dir2_leaf_to_node()
436 error = xfs_dir3_free_get_buf(args, fdb, &fbp); in xfs_dir2_leaf_to_node()
442 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_to_node()
444 (uint)dp->i_d.di_size / args->geo->blksize) { in xfs_dir2_leaf_to_node()
468 xfs_dir2_free_log_bests(args, &freehdr, fbp, 0, freehdr.nvalid - 1); in xfs_dir2_leaf_to_node()
469 xfs_dir2_free_log_header(args, fbp); in xfs_dir2_leaf_to_node()
483 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_to_node()
495 struct xfs_da_args *args, /* operation arguments */ in xfs_dir2_leafn_add() argument
499 struct xfs_inode *dp = args->dp; in xfs_dir2_leafn_add()
509 trace_xfs_dir2_leafn_add(args, index); in xfs_dir2_leafn_add()
530 if (leafhdr.count == args->geo->leaf_max_ents) { in xfs_dir2_leafn_add()
536 ASSERT(index == 0 || be32_to_cpu(ents[index - 1].hashval) <= args->hashval); in xfs_dir2_leafn_add()
538 be32_to_cpu(ents[index].hashval) >= args->hashval); in xfs_dir2_leafn_add()
540 if (args->op_flags & XFS_DA_OP_JUSTCHECK) in xfs_dir2_leafn_add()
564 lep->hashval = cpu_to_be32(args->hashval); in xfs_dir2_leafn_add()
565 lep->address = cpu_to_be32(xfs_dir2_db_off_to_dataptr(args->geo, in xfs_dir2_leafn_add()
566 args->blkno, args->index)); in xfs_dir2_leafn_add()
569 xfs_dir3_leaf_log_header(args, bp); in xfs_dir2_leafn_add()
570 xfs_dir3_leaf_log_ents(args, &leafhdr, bp, lfloglow, lfloghigh); in xfs_dir2_leafn_add()
627 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leafn_lookup_for_addname() argument
648 dp = args->dp; in xfs_dir2_leafn_lookup_for_addname()
649 tp = args->trans; in xfs_dir2_leafn_lookup_for_addname()
660 index = xfs_dir2_leaf_search_hash(args, bp); in xfs_dir2_leafn_lookup_for_addname()
672 length = xfs_dir2_data_entsize(mp, args->namelen); in xfs_dir2_leafn_lookup_for_addname()
677 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leafn_lookup_for_addname()
687 newdb = xfs_dir2_dataptr_to_db(args->geo, in xfs_dir2_leafn_lookup_for_addname()
705 newfdb = xfs_dir2_db_to_fdb(args->geo, newdb); in xfs_dir2_leafn_lookup_for_addname()
717 xfs_dir2_db_to_da(args->geo, in xfs_dir2_leafn_lookup_for_addname()
729 fi = xfs_dir2_db_to_fdindex(args->geo, curdb); in xfs_dir2_leafn_lookup_for_addname()
749 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); in xfs_dir2_leafn_lookup_for_addname()
780 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leafn_lookup_for_entry() argument
798 dp = args->dp; in xfs_dir2_leafn_lookup_for_entry()
799 tp = args->trans; in xfs_dir2_leafn_lookup_for_entry()
813 index = xfs_dir2_leaf_search_hash(args, bp); in xfs_dir2_leafn_lookup_for_entry()
825 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leafn_lookup_for_entry()
835 newdb = xfs_dir2_dataptr_to_db(args->geo, in xfs_dir2_leafn_lookup_for_entry()
848 if (curbp && (args->cmpresult == XFS_CMP_DIFFERENT || in xfs_dir2_leafn_lookup_for_entry()
855 if (args->cmpresult != XFS_CMP_DIFFERENT && in xfs_dir2_leafn_lookup_for_entry()
861 xfs_dir2_db_to_da(args->geo, in xfs_dir2_leafn_lookup_for_entry()
874 xfs_dir2_dataptr_to_off(args->geo, in xfs_dir2_leafn_lookup_for_entry()
881 cmp = xfs_dir2_compname(args, dep->name, dep->namelen); in xfs_dir2_leafn_lookup_for_entry()
882 if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { in xfs_dir2_leafn_lookup_for_entry()
884 if (args->cmpresult != XFS_CMP_DIFFERENT && in xfs_dir2_leafn_lookup_for_entry()
887 args->cmpresult = cmp; in xfs_dir2_leafn_lookup_for_entry()
888 args->inumber = be64_to_cpu(dep->inumber); in xfs_dir2_leafn_lookup_for_entry()
889 args->filetype = xfs_dir2_data_get_ftype(mp, dep); in xfs_dir2_leafn_lookup_for_entry()
903 ASSERT(index == leafhdr.count || (args->op_flags & XFS_DA_OP_OKNOENT)); in xfs_dir2_leafn_lookup_for_entry()
905 if (args->cmpresult == XFS_CMP_DIFFERENT) { in xfs_dir2_leafn_lookup_for_entry()
934 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leafn_lookup_int() argument
938 if (args->op_flags & XFS_DA_OP_ADDNAME) in xfs_dir2_leafn_lookup_int()
939 return xfs_dir2_leafn_lookup_for_addname(bp, args, indexp, in xfs_dir2_leafn_lookup_int()
941 return xfs_dir2_leafn_lookup_for_entry(bp, args, indexp, state); in xfs_dir2_leafn_lookup_int()
950 xfs_da_args_t *args, /* operation arguments */ in xfs_dir3_leafn_moveents() argument
963 trace_xfs_dir2_leafn_moveents(args, start_s, start_d, count); in xfs_dir3_leafn_moveents()
979 xfs_dir3_leaf_log_ents(args, dhdr, bp_d, start_d + count, in xfs_dir3_leafn_moveents()
1001 xfs_dir3_leaf_log_ents(args, dhdr, bp_d, start_d, start_d + count - 1); in xfs_dir3_leafn_moveents()
1010 xfs_dir3_leaf_log_ents(args, shdr, bp_s, start_s, in xfs_dir3_leafn_moveents()
1066 xfs_da_args_t *args; /* operation arguments */ in xfs_dir2_leafn_rebalance() local
1081 struct xfs_inode *dp = state->args->dp; in xfs_dir2_leafn_rebalance()
1083 args = state->args; in xfs_dir2_leafn_rebalance()
1115 isleft = args->hashval <= midhash; in xfs_dir2_leafn_rebalance()
1130 xfs_dir3_leafn_moveents(args, blk1->bp, &hdr1, ents1, in xfs_dir2_leafn_rebalance()
1134 xfs_dir3_leafn_moveents(args, blk2->bp, &hdr2, ents2, 0, in xfs_dir2_leafn_rebalance()
1144 xfs_dir3_leaf_log_header(args, blk1->bp); in xfs_dir2_leafn_rebalance()
1145 xfs_dir3_leaf_log_header(args, blk2->bp); in xfs_dir2_leafn_rebalance()
1180 xfs_da_args_t *args, in xfs_dir3_data_block_free() argument
1190 struct xfs_inode *dp = args->dp; in xfs_dir3_data_block_free()
1199 xfs_dir2_free_log_bests(args, &freehdr, fbp, findex, findex); in xfs_dir3_data_block_free()
1227 xfs_dir2_free_log_header(args, fbp); in xfs_dir3_data_block_free()
1236 error = xfs_dir2_shrink_inode(args, fdb, fbp); in xfs_dir3_data_block_free()
1240 } else if (error != -ENOSPC || args->total != 0) in xfs_dir3_data_block_free()
1251 xfs_dir2_free_log_bests(args, &freehdr, fbp, findex, findex); in xfs_dir3_data_block_free()
1262 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leafn_remove() argument
1268 struct xfs_da_geometry *geo = args->geo; in xfs_dir2_leafn_remove()
1284 trace_xfs_dir2_leafn_remove(args, index); in xfs_dir2_leafn_remove()
1286 dp = args->dp; in xfs_dir2_leafn_remove()
1287 tp = args->trans; in xfs_dir2_leafn_remove()
1310 xfs_dir3_leaf_log_header(args, bp); in xfs_dir2_leafn_remove()
1313 xfs_dir3_leaf_log_ents(args, &leafhdr, bp, index, index); in xfs_dir2_leafn_remove()
1325 xfs_dir2_data_make_free(args, dbp, off, in xfs_dir2_leafn_remove()
1335 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leafn_remove()
1380 error = xfs_dir2_shrink_inode(args, db, dbp); in xfs_dir2_leafn_remove()
1390 else if (!(error == -ENOSPC && args->total == 0)) in xfs_dir2_leafn_remove()
1397 error = xfs_dir3_data_block_free(args, hdr, free, in xfs_dir2_leafn_remove()
1423 xfs_da_args_t *args; /* operation arguments */ in xfs_dir2_leafn_split() local
1431 args = state->args; in xfs_dir2_leafn_split()
1432 dp = args->dp; in xfs_dir2_leafn_split()
1434 error = xfs_da_grow_inode(args, &blkno); in xfs_dir2_leafn_split()
1441 error = xfs_dir3_leaf_get_buf(args, xfs_dir2_da_to_db(args->geo, blkno), in xfs_dir2_leafn_split()
1461 error = xfs_dir2_leafn_add(oldblk->bp, args, oldblk->index); in xfs_dir2_leafn_split()
1463 error = xfs_dir2_leafn_add(newblk->bp, args, newblk->index); in xfs_dir2_leafn_split()
1500 struct xfs_inode *dp = state->args->dp; in xfs_dir2_leafn_toosmall()
1514 bytes = state->args->geo->leaf_hdr_size + count * sizeof(ents[0]); in xfs_dir2_leafn_toosmall()
1515 if (bytes > (state->args->geo->blksize >> 1)) { in xfs_dir2_leafn_toosmall()
1559 error = xfs_dir3_leafn_read(state->args->trans, dp, blkno, &bp); in xfs_dir2_leafn_toosmall()
1567 bytes = state->args->geo->blksize - in xfs_dir2_leafn_toosmall()
1568 (state->args->geo->blksize >> 2); in xfs_dir2_leafn_toosmall()
1581 xfs_trans_brelse(state->args->trans, bp); in xfs_dir2_leafn_toosmall()
1619 xfs_da_args_t *args; /* operation arguments */ in xfs_dir2_leafn_unbalance() local
1626 struct xfs_inode *dp = state->args->dp; in xfs_dir2_leafn_unbalance()
1628 args = state->args; in xfs_dir2_leafn_unbalance()
1644 xfs_dir3_leaf_compact(args, &drophdr, drop_blk->bp); in xfs_dir2_leafn_unbalance()
1646 xfs_dir3_leaf_compact(args, &savehdr, save_blk->bp); in xfs_dir2_leafn_unbalance()
1653 xfs_dir3_leafn_moveents(args, drop_blk->bp, &drophdr, dents, 0, in xfs_dir2_leafn_unbalance()
1657 xfs_dir3_leafn_moveents(args, drop_blk->bp, &drophdr, dents, 0, in xfs_dir2_leafn_unbalance()
1665 xfs_dir3_leaf_log_header(args, save_blk->bp); in xfs_dir2_leafn_unbalance()
1666 xfs_dir3_leaf_log_header(args, drop_blk->bp); in xfs_dir2_leafn_unbalance()
1678 struct xfs_da_args *args, in xfs_dir2_node_add_datablk() argument
1686 struct xfs_inode *dp = args->dp; in xfs_dir2_node_add_datablk()
1687 struct xfs_trans *tp = args->trans; in xfs_dir2_node_add_datablk()
1696 if (args->total == 0) in xfs_dir2_node_add_datablk()
1700 error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, dbno); in xfs_dir2_node_add_datablk()
1703 error = xfs_dir3_data_init(args, *dbno, &dbp); in xfs_dir2_node_add_datablk()
1711 fbno = xfs_dir2_db_to_fdb(args->geo, *dbno); in xfs_dir2_node_add_datablk()
1713 xfs_dir2_db_to_da(args->geo, fbno), &fbp); in xfs_dir2_node_add_datablk()
1722 error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fbno); in xfs_dir2_node_add_datablk()
1727 xfs_dir2_db_to_fdb(args->geo, *dbno) != in xfs_dir2_node_add_datablk()
1732 (long long)xfs_dir2_db_to_fdb(args->geo, *dbno), in xfs_dir2_node_add_datablk()
1746 error = xfs_dir3_free_get_buf(args, fbno, &fbp); in xfs_dir2_node_add_datablk()
1752 hdr->firstdb = (fbno - xfs_dir2_byte_to_db(args->geo, in xfs_dir2_node_add_datablk()
1754 args->geo->free_max_bests; in xfs_dir2_node_add_datablk()
1760 *findex = xfs_dir2_db_to_fdindex(args->geo, *dbno); in xfs_dir2_node_add_datablk()
1764 ASSERT(*findex < args->geo->free_max_bests); in xfs_dir2_node_add_datablk()
1776 xfs_dir2_free_log_header(args, fbp); in xfs_dir2_node_add_datablk()
1790 struct xfs_da_args *args, in xfs_dir2_node_find_freeblk() argument
1798 struct xfs_inode *dp = args->dp; in xfs_dir2_node_find_freeblk()
1799 struct xfs_trans *tp = args->trans; in xfs_dir2_node_find_freeblk()
1845 lastfbno = xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)fo); in xfs_dir2_node_find_freeblk()
1846 firstfbno = xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET); in xfs_dir2_node_find_freeblk()
1859 xfs_dir2_db_to_da(args->geo, fbno), in xfs_dir2_node_find_freeblk()
1895 struct xfs_da_args *args, /* operation arguments */ in xfs_dir2_node_addname_int() argument
1902 struct xfs_trans *tp = args->trans; in xfs_dir2_node_addname_int()
1903 struct xfs_inode *dp = args->dp; in xfs_dir2_node_addname_int()
1917 length = xfs_dir2_data_entsize(dp->i_mount, args->namelen); in xfs_dir2_node_addname_int()
1918 error = xfs_dir2_node_find_freeblk(args, fblk, &dbno, &fbp, &freehdr, in xfs_dir2_node_addname_int()
1927 if (args->op_flags & XFS_DA_OP_JUSTCHECK) { in xfs_dir2_node_addname_int()
1940 error = xfs_dir2_node_add_datablk(args, fblk, &dbno, &dbp, &fbp, in xfs_dir2_node_addname_int()
1945 xfs_dir2_db_to_da(args->geo, dbno), in xfs_dir2_node_addname_int()
1962 error = xfs_dir2_data_use_free(args, dbp, dup, aoff, length, in xfs_dir2_node_addname_int()
1971 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_node_addname_int()
1972 dep->namelen = args->namelen; in xfs_dir2_node_addname_int()
1973 memcpy(dep->name, args->name, dep->namelen); in xfs_dir2_node_addname_int()
1974 xfs_dir2_data_put_ftype(dp->i_mount, dep, args->filetype); in xfs_dir2_node_addname_int()
1977 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_node_addname_int()
1983 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_node_addname_int()
1993 xfs_dir2_free_log_bests(args, &freehdr, fbp, findex, findex); in xfs_dir2_node_addname_int()
1996 args->blkno = (xfs_dablk_t)dbno; in xfs_dir2_node_addname_int()
1997 args->index = be16_to_cpu(*tagp); in xfs_dir2_node_addname_int()
2006 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_node_addname() argument
2013 trace_xfs_dir2_node_addname(args); in xfs_dir2_node_addname()
2018 state = xfs_da_state_alloc(args); in xfs_dir2_node_addname()
2033 rval = xfs_dir2_node_addname_int(args, in xfs_dir2_node_addname()
2043 rval = xfs_dir2_leafn_add(blk->bp, args, blk->index); in xfs_dir2_node_addname()
2048 if (!(args->op_flags & XFS_DA_OP_JUSTCHECK)) in xfs_dir2_node_addname()
2054 if (args->total == 0) { in xfs_dir2_node_addname()
2075 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_node_lookup() argument
2082 trace_xfs_dir2_node_lookup(args); in xfs_dir2_node_lookup()
2087 state = xfs_da_state_alloc(args); in xfs_dir2_node_lookup()
2095 else if (rval == -ENOENT && args->cmpresult == XFS_CMP_CASE) { in xfs_dir2_node_lookup()
2102 rval = xfs_dir_cilookup_result(args, dep->name, dep->namelen); in xfs_dir2_node_lookup()
2108 xfs_trans_brelse(args->trans, state->path.blk[i].bp); in xfs_dir2_node_lookup()
2115 xfs_trans_brelse(args->trans, state->extrablk.bp); in xfs_dir2_node_lookup()
2127 struct xfs_da_args *args) /* operation arguments */ in xfs_dir2_node_removename() argument
2134 trace_xfs_dir2_node_removename(args); in xfs_dir2_node_removename()
2139 state = xfs_da_state_alloc(args); in xfs_dir2_node_removename()
2159 error = xfs_dir2_leafn_remove(args, blk->bp, blk->index, in xfs_dir2_node_removename()
2187 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_node_replace() argument
2199 trace_xfs_dir2_node_replace(args); in xfs_dir2_node_replace()
2204 state = xfs_da_state_alloc(args); in xfs_dir2_node_replace()
2210 inum = args->inumber; in xfs_dir2_node_replace()
2211 ftype = args->filetype; in xfs_dir2_node_replace()
2244 xfs_dir2_dataptr_to_off(args->geo, in xfs_dir2_node_replace()
2252 xfs_dir2_data_log_entry(args, state->extrablk.bp, dep); in xfs_dir2_node_replace()
2259 xfs_trans_brelse(args->trans, state->extrablk.bp); in xfs_dir2_node_replace()
2266 xfs_trans_brelse(args->trans, state->path.blk[i].bp); in xfs_dir2_node_replace()
2279 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_node_trim_free() argument
2290 dp = args->dp; in xfs_dir2_node_trim_free()
2291 tp = args->trans; in xfs_dir2_node_trim_free()
2320 error = xfs_dir2_shrink_inode(args, in xfs_dir2_node_trim_free()
2321 xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)fo), bp); in xfs_dir2_node_trim_free()