Lines Matching refs:args

27 static int xfs_dir2_leaf_lookup_int(xfs_da_args_t *args, struct xfs_buf **lbpp,
30 static void xfs_dir3_leaf_log_bests(struct xfs_da_args *args,
32 static void xfs_dir3_leaf_log_tail(struct xfs_da_args *args,
358 struct xfs_da_args *args, in xfs_dir3_leaf_init() argument
362 struct xfs_mount *mp = args->dp->i_mount; in xfs_dir3_leaf_init()
363 struct xfs_trans *tp = args->trans; in xfs_dir3_leaf_init()
377 leaf3->info.owner = cpu_to_be64(args->owner); in xfs_dir3_leaf_init()
403 xfs_da_args_t *args, in xfs_dir3_leaf_get_buf() argument
408 struct xfs_inode *dp = args->dp; in xfs_dir3_leaf_get_buf()
409 struct xfs_trans *tp = args->trans; in xfs_dir3_leaf_get_buf()
414 ASSERT(bno >= xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET) && in xfs_dir3_leaf_get_buf()
415 bno < xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET)); in xfs_dir3_leaf_get_buf()
417 error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, bno), in xfs_dir3_leaf_get_buf()
422 xfs_dir3_leaf_init(args, bp, magic); in xfs_dir3_leaf_get_buf()
423 xfs_dir3_leaf_log_header(args, bp); in xfs_dir3_leaf_get_buf()
425 xfs_dir3_leaf_log_tail(args, bp); in xfs_dir3_leaf_get_buf()
435 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_block_to_leaf() argument
455 trace_xfs_dir2_block_to_leaf(args); in xfs_dir2_block_to_leaf()
457 dp = args->dp; in xfs_dir2_block_to_leaf()
458 tp = args->trans; in xfs_dir2_block_to_leaf()
464 if ((error = xfs_da_grow_inode(args, &blkno))) { in xfs_dir2_block_to_leaf()
467 ldb = xfs_dir2_da_to_db(args->geo, blkno); in xfs_dir2_block_to_leaf()
468 ASSERT(ldb == xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET)); in xfs_dir2_block_to_leaf()
472 error = xfs_dir3_leaf_get_buf(args, ldb, &lbp, XFS_DIR2_LEAF1_MAGIC); in xfs_dir2_block_to_leaf()
479 btp = xfs_dir2_block_tail_p(args->geo, hdr); in xfs_dir2_block_to_leaf()
490 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_block_to_leaf()
498 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
505 xfs_dir2_data_make_free(args, dbp, in xfs_dir2_block_to_leaf()
507 (xfs_dir2_data_aoff_t)((char *)hdr + args->geo->blksize - in xfs_dir2_block_to_leaf()
525 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_block_to_leaf()
533 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_block_to_leaf()
536 xfs_dir3_leaf_log_bests(args, lbp, 0, 0); in xfs_dir2_block_to_leaf()
666 struct xfs_da_args *args) /* operation arguments */ in xfs_dir2_leaf_addname() argument
669 struct xfs_trans *tp = args->trans; in xfs_dir2_leaf_addname()
675 struct xfs_inode *dp = args->dp; /* incore directory inode */ in xfs_dir2_leaf_addname()
698 trace_xfs_dir2_leaf_addname(args); in xfs_dir2_leaf_addname()
700 error = xfs_dir3_leaf_read(tp, dp, args->owner, args->geo->leafblk, in xfs_dir2_leaf_addname()
711 index = xfs_dir2_leaf_search_hash(args, lbp); in xfs_dir2_leaf_addname()
713 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_addname()
717 length = xfs_dir2_data_entsize(dp->i_mount, args->namelen); in xfs_dir2_leaf_addname()
726 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_addname()
730 i = xfs_dir2_dataptr_to_db(args->geo, be32_to_cpu(lep->address)); in xfs_dir2_leaf_addname()
786 if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || in xfs_dir2_leaf_addname()
787 args->total == 0) { in xfs_dir2_leaf_addname()
794 error = xfs_dir2_leaf_to_node(args, lbp); in xfs_dir2_leaf_addname()
800 return xfs_dir2_node_addname(args); in xfs_dir2_leaf_addname()
811 if (args->op_flags & XFS_DA_OP_JUSTCHECK) { in xfs_dir2_leaf_addname()
819 if (args->total == 0 && use_block == -1) { in xfs_dir2_leaf_addname()
849 if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, in xfs_dir2_leaf_addname()
857 if ((error = xfs_dir3_data_init(args, use_block, &dbp))) { in xfs_dir2_leaf_addname()
870 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_addname()
871 xfs_dir3_leaf_log_bests(args, lbp, 0, in xfs_dir2_leaf_addname()
878 xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); in xfs_dir2_leaf_addname()
888 error = xfs_dir3_data_read(tp, dp, args->owner, in xfs_dir2_leaf_addname()
889 xfs_dir2_db_to_da(args->geo, use_block), 0, in xfs_dir2_leaf_addname()
908 error = xfs_dir2_data_use_free(args, dbp, dup, in xfs_dir2_leaf_addname()
919 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_leaf_addname()
920 dep->namelen = args->namelen; in xfs_dir2_leaf_addname()
921 memcpy(dep->name, args->name, dep->namelen); in xfs_dir2_leaf_addname()
922 xfs_dir2_data_put_ftype(dp->i_mount, dep, args->filetype); in xfs_dir2_leaf_addname()
934 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leaf_addname()
935 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_leaf_addname()
943 xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); in xfs_dir2_leaf_addname()
952 lep->hashval = cpu_to_be32(args->hashval); in xfs_dir2_leaf_addname()
954 xfs_dir2_db_off_to_dataptr(args->geo, use_block, in xfs_dir2_leaf_addname()
960 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_addname()
961 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, lfloglow, lfloghigh); in xfs_dir2_leaf_addname()
973 xfs_da_args_t *args, /* operation arguments */ in xfs_dir3_leaf_compact() argument
981 struct xfs_inode *dp = args->dp; in xfs_dir3_leaf_compact()
1012 xfs_dir3_leaf_log_header(args, bp); in xfs_dir3_leaf_compact()
1014 xfs_dir3_leaf_log_ents(args, leafhdr, bp, loglow, to - 1); in xfs_dir3_leaf_compact()
1116 struct xfs_da_args *args, in xfs_dir3_leaf_log_bests() argument
1129 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_bests()
1132 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_bests()
1142 struct xfs_da_args *args, in xfs_dir3_leaf_log_ents() argument
1159 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_ents()
1169 struct xfs_da_args *args, in xfs_dir3_leaf_log_header() argument
1179 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_header()
1181 args->geo->leaf_hdr_size - 1); in xfs_dir3_leaf_log_header()
1189 struct xfs_da_args *args, in xfs_dir3_leaf_log_tail() argument
1200 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_tail()
1201 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf), in xfs_dir3_leaf_log_tail()
1202 (uint)(args->geo->blksize - 1)); in xfs_dir3_leaf_log_tail()
1212 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_lookup() argument
1224 trace_xfs_dir2_leaf_lookup(args); in xfs_dir2_leaf_lookup()
1229 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_lookup()
1233 tp = args->trans; in xfs_dir2_leaf_lookup()
1234 dp = args->dp; in xfs_dir2_leaf_lookup()
1247 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_lookup()
1251 args->inumber = be64_to_cpu(dep->inumber); in xfs_dir2_leaf_lookup()
1252 args->filetype = xfs_dir2_data_get_ftype(dp->i_mount, dep); in xfs_dir2_leaf_lookup()
1253 error = xfs_dir_cilookup_result(args, dep->name, dep->namelen); in xfs_dir2_leaf_lookup()
1267 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_lookup_int() argument
1288 dp = args->dp; in xfs_dir2_leaf_lookup_int()
1289 tp = args->trans; in xfs_dir2_leaf_lookup_int()
1292 error = xfs_dir3_leaf_read(tp, dp, args->owner, args->geo->leafblk, in xfs_dir2_leaf_lookup_int()
1305 index = xfs_dir2_leaf_search_hash(args, lbp); in xfs_dir2_leaf_lookup_int()
1312 be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_lookup_int()
1322 newdb = xfs_dir2_dataptr_to_db(args->geo, in xfs_dir2_leaf_lookup_int()
1331 error = xfs_dir3_data_read(tp, dp, args->owner, in xfs_dir2_leaf_lookup_int()
1332 xfs_dir2_db_to_da(args->geo, newdb), 0, in xfs_dir2_leaf_lookup_int()
1344 xfs_dir2_dataptr_to_off(args->geo, in xfs_dir2_leaf_lookup_int()
1351 cmp = xfs_dir2_compname(args, dep->name, dep->namelen); in xfs_dir2_leaf_lookup_int()
1352 if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { in xfs_dir2_leaf_lookup_int()
1353 args->cmpresult = cmp; in xfs_dir2_leaf_lookup_int()
1363 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); in xfs_dir2_leaf_lookup_int()
1369 if (args->cmpresult == XFS_CMP_CASE) { in xfs_dir2_leaf_lookup_int()
1373 error = xfs_dir3_data_read(tp, dp, args->owner, in xfs_dir2_leaf_lookup_int()
1374 xfs_dir2_db_to_da(args->geo, cidb), 0, in xfs_dir2_leaf_lookup_int()
1399 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_removename() argument
1401 struct xfs_da_geometry *geo = args->geo; in xfs_dir2_leaf_removename()
1421 trace_xfs_dir2_leaf_removename(args); in xfs_dir2_leaf_removename()
1426 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_removename()
1430 dp = args->dp; in xfs_dir2_leaf_removename()
1449 xfs_da_mark_sick(args); in xfs_dir2_leaf_removename()
1456 xfs_dir2_data_make_free(args, dbp, in xfs_dir2_leaf_removename()
1465 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_removename()
1468 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, index, index); in xfs_dir2_leaf_removename()
1477 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leaf_removename()
1484 xfs_dir3_leaf_log_bests(args, lbp, db, db); in xfs_dir2_leaf_removename()
1493 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { in xfs_dir2_leaf_removename()
1500 if (error == -ENOSPC && args->total == 0) in xfs_dir2_leaf_removename()
1525 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_removename()
1526 xfs_dir3_leaf_log_bests(args, lbp, 0, in xfs_dir2_leaf_removename()
1541 return xfs_dir2_leaf_to_block(args, lbp, dbp); in xfs_dir2_leaf_removename()
1549 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_replace() argument
1561 trace_xfs_dir2_leaf_replace(args); in xfs_dir2_leaf_replace()
1566 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_replace()
1570 dp = args->dp; in xfs_dir2_leaf_replace()
1580 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_replace()
1581 ASSERT(args->inumber != be64_to_cpu(dep->inumber)); in xfs_dir2_leaf_replace()
1585 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_leaf_replace()
1586 xfs_dir2_data_put_ftype(dp->i_mount, dep, args->filetype); in xfs_dir2_leaf_replace()
1587 tp = args->trans; in xfs_dir2_leaf_replace()
1588 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_leaf_replace()
1601 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_search_hash() argument
1612 xfs_dir2_leaf_hdr_from_disk(args->dp->i_mount, &leafhdr, lbp->b_addr); in xfs_dir2_leaf_search_hash()
1619 hashwant = args->hashval; in xfs_dir2_leaf_search_hash()
1651 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_trim_data() argument
1655 struct xfs_da_geometry *geo = args->geo; in xfs_dir2_leaf_trim_data()
1664 dp = args->dp; in xfs_dir2_leaf_trim_data()
1665 tp = args->trans; in xfs_dir2_leaf_trim_data()
1669 error = xfs_dir3_data_read(tp, dp, args->owner, in xfs_dir2_leaf_trim_data()
1694 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { in xfs_dir2_leaf_trim_data()
1705 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_trim_data()
1706 xfs_dir3_leaf_log_bests(args, lbp, 0, be32_to_cpu(ltp->bestcount) - 1); in xfs_dir2_leaf_trim_data()
1739 xfs_da_args_t *args; /* operation arguments */ in xfs_dir2_node_to_leaf() local
1759 args = state->args; in xfs_dir2_node_to_leaf()
1761 trace_xfs_dir2_node_to_leaf(args); in xfs_dir2_node_to_leaf()
1764 dp = args->dp; in xfs_dir2_node_to_leaf()
1765 tp = args->trans; in xfs_dir2_node_to_leaf()
1772 fo -= args->geo->fsbcount; in xfs_dir2_node_to_leaf()
1779 while (fo > args->geo->freeblk) { in xfs_dir2_node_to_leaf()
1780 if ((error = xfs_dir2_node_trim_free(args, fo, &rval))) { in xfs_dir2_node_to_leaf()
1784 fo -= args->geo->fsbcount; in xfs_dir2_node_to_leaf()
1797 if (XFS_FSB_TO_B(mp, fo) > XFS_DIR2_LEAF_OFFSET + args->geo->blksize) in xfs_dir2_node_to_leaf()
1809 error = xfs_dir2_free_read(tp, dp, args->owner, args->geo->freeblk, in xfs_dir2_node_to_leaf()
1821 if (xfs_dir3_leaf_size(&leafhdr, freehdr.nvalid) > args->geo->blksize) { in xfs_dir2_node_to_leaf()
1830 xfs_dir3_leaf_compact(args, &leafhdr, lbp); in xfs_dir2_node_to_leaf()
1841 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_node_to_leaf()
1851 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_node_to_leaf()
1852 xfs_dir3_leaf_log_bests(args, lbp, 0, be32_to_cpu(ltp->bestcount) - 1); in xfs_dir2_node_to_leaf()
1853 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_node_to_leaf()
1859 error = xfs_dir2_shrink_inode(args, in xfs_dir2_node_to_leaf()
1860 xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET), in xfs_dir2_node_to_leaf()
1878 error = xfs_dir2_leaf_to_block(args, lbp, NULL); in xfs_dir2_node_to_leaf()