Lines Matching refs:args
41 static int xfs_dir2_leaf_lookup_int(xfs_da_args_t *args, struct xfs_buf **lbpp,
43 static void xfs_dir3_leaf_log_bests(struct xfs_da_args *args,
45 static void xfs_dir3_leaf_log_tail(struct xfs_da_args *args,
343 xfs_da_args_t *args, in xfs_dir3_leaf_get_buf() argument
348 struct xfs_inode *dp = args->dp; in xfs_dir3_leaf_get_buf()
349 struct xfs_trans *tp = args->trans; in xfs_dir3_leaf_get_buf()
355 ASSERT(bno >= xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET) && in xfs_dir3_leaf_get_buf()
356 bno < xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET)); in xfs_dir3_leaf_get_buf()
358 error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, bno), in xfs_dir3_leaf_get_buf()
364 xfs_dir3_leaf_log_header(args, bp); in xfs_dir3_leaf_get_buf()
366 xfs_dir3_leaf_log_tail(args, bp); in xfs_dir3_leaf_get_buf()
376 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_block_to_leaf() argument
397 trace_xfs_dir2_block_to_leaf(args); in xfs_dir2_block_to_leaf()
399 dp = args->dp; in xfs_dir2_block_to_leaf()
400 tp = args->trans; in xfs_dir2_block_to_leaf()
406 if ((error = xfs_da_grow_inode(args, &blkno))) { in xfs_dir2_block_to_leaf()
409 ldb = xfs_dir2_da_to_db(args->geo, blkno); in xfs_dir2_block_to_leaf()
410 ASSERT(ldb == xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET)); in xfs_dir2_block_to_leaf()
414 error = xfs_dir3_leaf_get_buf(args, ldb, &lbp, XFS_DIR2_LEAF1_MAGIC); in xfs_dir2_block_to_leaf()
421 btp = xfs_dir2_block_tail_p(args->geo, hdr); in xfs_dir2_block_to_leaf()
433 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_block_to_leaf()
440 xfs_dir3_leaf_log_ents(args, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
447 xfs_dir2_data_make_free(args, dbp, in xfs_dir2_block_to_leaf()
449 (xfs_dir2_data_aoff_t)((char *)hdr + args->geo->blksize - in xfs_dir2_block_to_leaf()
467 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_block_to_leaf()
475 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_block_to_leaf()
478 xfs_dir3_leaf_log_bests(args, lbp, 0, 0); in xfs_dir2_block_to_leaf()
608 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_addname() argument
640 trace_xfs_dir2_leaf_addname(args); in xfs_dir2_leaf_addname()
642 dp = args->dp; in xfs_dir2_leaf_addname()
643 tp = args->trans; in xfs_dir2_leaf_addname()
645 error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); in xfs_dir2_leaf_addname()
655 index = xfs_dir2_leaf_search_hash(args, lbp); in xfs_dir2_leaf_addname()
657 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_addname()
661 length = dp->d_ops->data_entsize(args->namelen); in xfs_dir2_leaf_addname()
670 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_addname()
674 i = xfs_dir2_dataptr_to_db(args->geo, be32_to_cpu(lep->address)); in xfs_dir2_leaf_addname()
730 if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || in xfs_dir2_leaf_addname()
731 args->total == 0) { in xfs_dir2_leaf_addname()
738 error = xfs_dir2_leaf_to_node(args, lbp); in xfs_dir2_leaf_addname()
744 return xfs_dir2_node_addname(args); in xfs_dir2_leaf_addname()
755 if (args->op_flags & XFS_DA_OP_JUSTCHECK) { in xfs_dir2_leaf_addname()
763 if (args->total == 0 && use_block == -1) { in xfs_dir2_leaf_addname()
793 if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, in xfs_dir2_leaf_addname()
801 if ((error = xfs_dir3_data_init(args, use_block, &dbp))) { in xfs_dir2_leaf_addname()
814 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_addname()
815 xfs_dir3_leaf_log_bests(args, lbp, 0, in xfs_dir2_leaf_addname()
822 xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); in xfs_dir2_leaf_addname()
833 xfs_dir2_db_to_da(args->geo, use_block), in xfs_dir2_leaf_addname()
853 xfs_dir2_data_use_free(args, dbp, dup, in xfs_dir2_leaf_addname()
860 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_leaf_addname()
861 dep->namelen = args->namelen; in xfs_dir2_leaf_addname()
862 memcpy(dep->name, args->name, dep->namelen); in xfs_dir2_leaf_addname()
863 dp->d_ops->data_put_ftype(dep, args->filetype); in xfs_dir2_leaf_addname()
875 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leaf_addname()
876 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_leaf_addname()
884 xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); in xfs_dir2_leaf_addname()
893 lep->hashval = cpu_to_be32(args->hashval); in xfs_dir2_leaf_addname()
895 xfs_dir2_db_off_to_dataptr(args->geo, use_block, in xfs_dir2_leaf_addname()
901 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_addname()
902 xfs_dir3_leaf_log_ents(args, lbp, lfloglow, lfloghigh); in xfs_dir2_leaf_addname()
914 xfs_da_args_t *args, /* operation arguments */ in xfs_dir3_leaf_compact() argument
923 struct xfs_inode *dp = args->dp; in xfs_dir3_leaf_compact()
954 xfs_dir3_leaf_log_header(args, bp); in xfs_dir3_leaf_compact()
956 xfs_dir3_leaf_log_ents(args, bp, loglow, to - 1); in xfs_dir3_leaf_compact()
1058 struct xfs_da_args *args, in xfs_dir3_leaf_log_bests() argument
1071 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_bests()
1074 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_bests()
1084 struct xfs_da_args *args, in xfs_dir3_leaf_log_ents() argument
1099 ents = args->dp->d_ops->leaf_ents_p(leaf); in xfs_dir3_leaf_log_ents()
1102 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_ents()
1112 struct xfs_da_args *args, in xfs_dir3_leaf_log_header() argument
1122 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_header()
1124 args->dp->d_ops->leaf_hdr_size - 1); in xfs_dir3_leaf_log_header()
1132 struct xfs_da_args *args, in xfs_dir3_leaf_log_tail() argument
1143 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_tail()
1144 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf), in xfs_dir3_leaf_log_tail()
1145 (uint)(args->geo->blksize - 1)); in xfs_dir3_leaf_log_tail()
1155 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_lookup() argument
1168 trace_xfs_dir2_leaf_lookup(args); in xfs_dir2_leaf_lookup()
1173 if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) { in xfs_dir2_leaf_lookup()
1176 tp = args->trans; in xfs_dir2_leaf_lookup()
1177 dp = args->dp; in xfs_dir2_leaf_lookup()
1191 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_lookup()
1195 args->inumber = be64_to_cpu(dep->inumber); in xfs_dir2_leaf_lookup()
1196 args->filetype = dp->d_ops->data_get_ftype(dep); in xfs_dir2_leaf_lookup()
1197 error = xfs_dir_cilookup_result(args, dep->name, dep->namelen); in xfs_dir2_leaf_lookup()
1211 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_lookup_int() argument
1233 dp = args->dp; in xfs_dir2_leaf_lookup_int()
1234 tp = args->trans; in xfs_dir2_leaf_lookup_int()
1237 error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); in xfs_dir2_leaf_lookup_int()
1250 index = xfs_dir2_leaf_search_hash(args, lbp); in xfs_dir2_leaf_lookup_int()
1256 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_lookup_int()
1266 newdb = xfs_dir2_dataptr_to_db(args->geo, in xfs_dir2_leaf_lookup_int()
1276 xfs_dir2_db_to_da(args->geo, newdb), in xfs_dir2_leaf_lookup_int()
1288 xfs_dir2_dataptr_to_off(args->geo, in xfs_dir2_leaf_lookup_int()
1295 cmp = mp->m_dirnameops->compname(args, dep->name, dep->namelen); in xfs_dir2_leaf_lookup_int()
1296 if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { in xfs_dir2_leaf_lookup_int()
1297 args->cmpresult = cmp; in xfs_dir2_leaf_lookup_int()
1307 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); in xfs_dir2_leaf_lookup_int()
1313 if (args->cmpresult == XFS_CMP_CASE) { in xfs_dir2_leaf_lookup_int()
1318 xfs_dir2_db_to_da(args->geo, cidb), in xfs_dir2_leaf_lookup_int()
1343 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_removename() argument
1365 trace_xfs_dir2_leaf_removename(args); in xfs_dir2_leaf_removename()
1370 if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) { in xfs_dir2_leaf_removename()
1373 dp = args->dp; in xfs_dir2_leaf_removename()
1384 db = xfs_dir2_dataptr_to_db(args->geo, be32_to_cpu(lep->address)); in xfs_dir2_leaf_removename()
1386 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_removename()
1389 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_removename()
1395 xfs_dir2_data_make_free(args, dbp, in xfs_dir2_leaf_removename()
1403 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_removename()
1406 xfs_dir3_leaf_log_ents(args, lbp, index, index); in xfs_dir2_leaf_removename()
1415 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leaf_removename()
1422 xfs_dir3_leaf_log_bests(args, lbp, db, db); in xfs_dir2_leaf_removename()
1429 args->geo->blksize - dp->d_ops->data_entry_offset) { in xfs_dir2_leaf_removename()
1430 ASSERT(db != args->geo->datablk); in xfs_dir2_leaf_removename()
1431 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { in xfs_dir2_leaf_removename()
1438 if (error == -ENOSPC && args->total == 0) in xfs_dir2_leaf_removename()
1463 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_removename()
1464 xfs_dir3_leaf_log_bests(args, lbp, 0, in xfs_dir2_leaf_removename()
1472 else if (db != args->geo->datablk) in xfs_dir2_leaf_removename()
1479 return xfs_dir2_leaf_to_block(args, lbp, dbp); in xfs_dir2_leaf_removename()
1487 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_replace() argument
1500 trace_xfs_dir2_leaf_replace(args); in xfs_dir2_leaf_replace()
1505 if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) { in xfs_dir2_leaf_replace()
1508 dp = args->dp; in xfs_dir2_leaf_replace()
1520 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_replace()
1521 ASSERT(args->inumber != be64_to_cpu(dep->inumber)); in xfs_dir2_leaf_replace()
1525 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_leaf_replace()
1526 dp->d_ops->data_put_ftype(dep, args->filetype); in xfs_dir2_leaf_replace()
1527 tp = args->trans; in xfs_dir2_leaf_replace()
1528 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_leaf_replace()
1541 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_search_hash() argument
1555 ents = args->dp->d_ops->leaf_ents_p(leaf); in xfs_dir2_leaf_search_hash()
1556 args->dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_leaf_search_hash()
1563 hashwant = args->hashval; in xfs_dir2_leaf_search_hash()
1595 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_trim_data() argument
1607 dp = args->dp; in xfs_dir2_leaf_trim_data()
1608 tp = args->trans; in xfs_dir2_leaf_trim_data()
1612 error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(args->geo, db), in xfs_dir2_leaf_trim_data()
1618 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_trim_data()
1628 args->geo->blksize - dp->d_ops->data_entry_offset); in xfs_dir2_leaf_trim_data()
1636 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { in xfs_dir2_leaf_trim_data()
1647 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_trim_data()
1648 xfs_dir3_leaf_log_bests(args, lbp, 0, be32_to_cpu(ltp->bestcount) - 1); in xfs_dir2_leaf_trim_data()
1681 xfs_da_args_t *args; /* operation arguments */ in xfs_dir2_node_to_leaf() local
1702 args = state->args; in xfs_dir2_node_to_leaf()
1704 trace_xfs_dir2_node_to_leaf(args); in xfs_dir2_node_to_leaf()
1707 dp = args->dp; in xfs_dir2_node_to_leaf()
1708 tp = args->trans; in xfs_dir2_node_to_leaf()
1715 fo -= args->geo->fsbcount; in xfs_dir2_node_to_leaf()
1722 while (fo > args->geo->freeblk) { in xfs_dir2_node_to_leaf()
1723 if ((error = xfs_dir2_node_trim_free(args, fo, &rval))) { in xfs_dir2_node_to_leaf()
1727 fo -= args->geo->fsbcount; in xfs_dir2_node_to_leaf()
1740 if (XFS_FSB_TO_B(mp, fo) > XFS_DIR2_LEAF_OFFSET + args->geo->blksize) in xfs_dir2_node_to_leaf()
1752 error = xfs_dir2_free_read(tp, dp, args->geo->freeblk, &fbp); in xfs_dir2_node_to_leaf()
1764 if (xfs_dir3_leaf_size(&leafhdr, freehdr.nvalid) > args->geo->blksize) { in xfs_dir2_node_to_leaf()
1773 xfs_dir3_leaf_compact(args, &leafhdr, lbp); in xfs_dir2_node_to_leaf()
1784 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_node_to_leaf()
1794 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_node_to_leaf()
1795 xfs_dir3_leaf_log_bests(args, lbp, 0, be32_to_cpu(ltp->bestcount) - 1); in xfs_dir2_node_to_leaf()
1796 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_node_to_leaf()
1802 error = xfs_dir2_shrink_inode(args, in xfs_dir2_node_to_leaf()
1803 xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET), in xfs_dir2_node_to_leaf()
1821 error = xfs_dir2_leaf_to_block(args, lbp, NULL); in xfs_dir2_node_to_leaf()