Lines Matching refs:args

40 static int xfs_dir2_leaf_lookup_int(xfs_da_args_t *args, struct xfs_buf **lbpp,
42 static void xfs_dir3_leaf_log_bests(struct xfs_da_args *args,
44 static void xfs_dir3_leaf_log_tail(struct xfs_da_args *args,
338 xfs_da_args_t *args, in xfs_dir3_leaf_get_buf() argument
343 struct xfs_inode *dp = args->dp; in xfs_dir3_leaf_get_buf()
344 struct xfs_trans *tp = args->trans; in xfs_dir3_leaf_get_buf()
350 ASSERT(bno >= xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET) && in xfs_dir3_leaf_get_buf()
351 bno < xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET)); in xfs_dir3_leaf_get_buf()
353 error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, bno), in xfs_dir3_leaf_get_buf()
359 xfs_dir3_leaf_log_header(args, bp); in xfs_dir3_leaf_get_buf()
361 xfs_dir3_leaf_log_tail(args, bp); in xfs_dir3_leaf_get_buf()
371 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_block_to_leaf() argument
392 trace_xfs_dir2_block_to_leaf(args); in xfs_dir2_block_to_leaf()
394 dp = args->dp; in xfs_dir2_block_to_leaf()
395 tp = args->trans; in xfs_dir2_block_to_leaf()
401 if ((error = xfs_da_grow_inode(args, &blkno))) { in xfs_dir2_block_to_leaf()
404 ldb = xfs_dir2_da_to_db(args->geo, blkno); in xfs_dir2_block_to_leaf()
405 ASSERT(ldb == xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET)); in xfs_dir2_block_to_leaf()
409 error = xfs_dir3_leaf_get_buf(args, ldb, &lbp, XFS_DIR2_LEAF1_MAGIC); in xfs_dir2_block_to_leaf()
416 btp = xfs_dir2_block_tail_p(args->geo, hdr); in xfs_dir2_block_to_leaf()
428 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_block_to_leaf()
435 xfs_dir3_leaf_log_ents(args, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
442 xfs_dir2_data_make_free(args, dbp, in xfs_dir2_block_to_leaf()
444 (xfs_dir2_data_aoff_t)((char *)hdr + args->geo->blksize - in xfs_dir2_block_to_leaf()
462 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_block_to_leaf()
470 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_block_to_leaf()
473 xfs_dir3_leaf_log_bests(args, lbp, 0, 0); in xfs_dir2_block_to_leaf()
603 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_addname() argument
635 trace_xfs_dir2_leaf_addname(args); in xfs_dir2_leaf_addname()
637 dp = args->dp; in xfs_dir2_leaf_addname()
638 tp = args->trans; in xfs_dir2_leaf_addname()
640 error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); in xfs_dir2_leaf_addname()
650 index = xfs_dir2_leaf_search_hash(args, lbp); in xfs_dir2_leaf_addname()
652 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_addname()
656 length = dp->d_ops->data_entsize(args->namelen); in xfs_dir2_leaf_addname()
665 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_addname()
669 i = xfs_dir2_dataptr_to_db(args->geo, be32_to_cpu(lep->address)); in xfs_dir2_leaf_addname()
725 if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || in xfs_dir2_leaf_addname()
726 args->total == 0) { in xfs_dir2_leaf_addname()
733 error = xfs_dir2_leaf_to_node(args, lbp); in xfs_dir2_leaf_addname()
739 return xfs_dir2_node_addname(args); in xfs_dir2_leaf_addname()
750 if (args->op_flags & XFS_DA_OP_JUSTCHECK) { in xfs_dir2_leaf_addname()
758 if (args->total == 0 && use_block == -1) { in xfs_dir2_leaf_addname()
788 if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, in xfs_dir2_leaf_addname()
796 if ((error = xfs_dir3_data_init(args, use_block, &dbp))) { in xfs_dir2_leaf_addname()
809 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_addname()
810 xfs_dir3_leaf_log_bests(args, lbp, 0, in xfs_dir2_leaf_addname()
817 xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); in xfs_dir2_leaf_addname()
828 xfs_dir2_db_to_da(args->geo, use_block), in xfs_dir2_leaf_addname()
848 xfs_dir2_data_use_free(args, dbp, dup, in xfs_dir2_leaf_addname()
855 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_leaf_addname()
856 dep->namelen = args->namelen; in xfs_dir2_leaf_addname()
857 memcpy(dep->name, args->name, dep->namelen); in xfs_dir2_leaf_addname()
858 dp->d_ops->data_put_ftype(dep, args->filetype); in xfs_dir2_leaf_addname()
870 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leaf_addname()
871 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_leaf_addname()
879 xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); in xfs_dir2_leaf_addname()
888 lep->hashval = cpu_to_be32(args->hashval); in xfs_dir2_leaf_addname()
890 xfs_dir2_db_off_to_dataptr(args->geo, use_block, in xfs_dir2_leaf_addname()
896 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_addname()
897 xfs_dir3_leaf_log_ents(args, lbp, lfloglow, lfloghigh); in xfs_dir2_leaf_addname()
909 xfs_da_args_t *args, /* operation arguments */ in xfs_dir3_leaf_compact() argument
918 struct xfs_inode *dp = args->dp; in xfs_dir3_leaf_compact()
949 xfs_dir3_leaf_log_header(args, bp); in xfs_dir3_leaf_compact()
951 xfs_dir3_leaf_log_ents(args, bp, loglow, to - 1); in xfs_dir3_leaf_compact()
1053 struct xfs_da_args *args, in xfs_dir3_leaf_log_bests() argument
1066 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_bests()
1069 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_bests()
1079 struct xfs_da_args *args, in xfs_dir3_leaf_log_ents() argument
1094 ents = args->dp->d_ops->leaf_ents_p(leaf); in xfs_dir3_leaf_log_ents()
1097 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_ents()
1107 struct xfs_da_args *args, in xfs_dir3_leaf_log_header() argument
1117 xfs_trans_log_buf(args->trans, bp, in xfs_dir3_leaf_log_header()
1119 args->dp->d_ops->leaf_hdr_size - 1); in xfs_dir3_leaf_log_header()
1127 struct xfs_da_args *args, in xfs_dir3_leaf_log_tail() argument
1138 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_tail()
1139 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf), in xfs_dir3_leaf_log_tail()
1140 (uint)(args->geo->blksize - 1)); in xfs_dir3_leaf_log_tail()
1150 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_lookup() argument
1163 trace_xfs_dir2_leaf_lookup(args); in xfs_dir2_leaf_lookup()
1168 if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) { in xfs_dir2_leaf_lookup()
1171 tp = args->trans; in xfs_dir2_leaf_lookup()
1172 dp = args->dp; in xfs_dir2_leaf_lookup()
1186 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_lookup()
1190 args->inumber = be64_to_cpu(dep->inumber); in xfs_dir2_leaf_lookup()
1191 args->filetype = dp->d_ops->data_get_ftype(dep); in xfs_dir2_leaf_lookup()
1192 error = xfs_dir_cilookup_result(args, dep->name, dep->namelen); in xfs_dir2_leaf_lookup()
1206 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_lookup_int() argument
1228 dp = args->dp; in xfs_dir2_leaf_lookup_int()
1229 tp = args->trans; in xfs_dir2_leaf_lookup_int()
1232 error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp); in xfs_dir2_leaf_lookup_int()
1245 index = xfs_dir2_leaf_search_hash(args, lbp); in xfs_dir2_leaf_lookup_int()
1251 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_lookup_int()
1261 newdb = xfs_dir2_dataptr_to_db(args->geo, in xfs_dir2_leaf_lookup_int()
1271 xfs_dir2_db_to_da(args->geo, newdb), in xfs_dir2_leaf_lookup_int()
1283 xfs_dir2_dataptr_to_off(args->geo, in xfs_dir2_leaf_lookup_int()
1290 cmp = mp->m_dirnameops->compname(args, dep->name, dep->namelen); in xfs_dir2_leaf_lookup_int()
1291 if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { in xfs_dir2_leaf_lookup_int()
1292 args->cmpresult = cmp; in xfs_dir2_leaf_lookup_int()
1302 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); in xfs_dir2_leaf_lookup_int()
1308 if (args->cmpresult == XFS_CMP_CASE) { in xfs_dir2_leaf_lookup_int()
1313 xfs_dir2_db_to_da(args->geo, cidb), in xfs_dir2_leaf_lookup_int()
1338 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_removename() argument
1360 trace_xfs_dir2_leaf_removename(args); in xfs_dir2_leaf_removename()
1365 if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) { in xfs_dir2_leaf_removename()
1368 dp = args->dp; in xfs_dir2_leaf_removename()
1379 db = xfs_dir2_dataptr_to_db(args->geo, be32_to_cpu(lep->address)); in xfs_dir2_leaf_removename()
1381 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_removename()
1384 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_removename()
1390 xfs_dir2_data_make_free(args, dbp, in xfs_dir2_leaf_removename()
1398 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_leaf_removename()
1401 xfs_dir3_leaf_log_ents(args, lbp, index, index); in xfs_dir2_leaf_removename()
1410 xfs_dir2_data_log_header(args, dbp); in xfs_dir2_leaf_removename()
1417 xfs_dir3_leaf_log_bests(args, lbp, db, db); in xfs_dir2_leaf_removename()
1424 args->geo->blksize - dp->d_ops->data_entry_offset) { in xfs_dir2_leaf_removename()
1425 ASSERT(db != args->geo->datablk); in xfs_dir2_leaf_removename()
1426 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { in xfs_dir2_leaf_removename()
1433 if (error == -ENOSPC && args->total == 0) in xfs_dir2_leaf_removename()
1458 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_removename()
1459 xfs_dir3_leaf_log_bests(args, lbp, 0, in xfs_dir2_leaf_removename()
1467 else if (db != args->geo->datablk) in xfs_dir2_leaf_removename()
1474 return xfs_dir2_leaf_to_block(args, lbp, dbp); in xfs_dir2_leaf_removename()
1482 xfs_da_args_t *args) /* operation arguments */ in xfs_dir2_leaf_replace() argument
1495 trace_xfs_dir2_leaf_replace(args); in xfs_dir2_leaf_replace()
1500 if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) { in xfs_dir2_leaf_replace()
1503 dp = args->dp; in xfs_dir2_leaf_replace()
1515 xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address))); in xfs_dir2_leaf_replace()
1516 ASSERT(args->inumber != be64_to_cpu(dep->inumber)); in xfs_dir2_leaf_replace()
1520 dep->inumber = cpu_to_be64(args->inumber); in xfs_dir2_leaf_replace()
1521 dp->d_ops->data_put_ftype(dep, args->filetype); in xfs_dir2_leaf_replace()
1522 tp = args->trans; in xfs_dir2_leaf_replace()
1523 xfs_dir2_data_log_entry(args, dbp, dep); in xfs_dir2_leaf_replace()
1536 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_search_hash() argument
1550 ents = args->dp->d_ops->leaf_ents_p(leaf); in xfs_dir2_leaf_search_hash()
1551 args->dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_leaf_search_hash()
1558 hashwant = args->hashval; in xfs_dir2_leaf_search_hash()
1590 xfs_da_args_t *args, /* operation arguments */ in xfs_dir2_leaf_trim_data() argument
1602 dp = args->dp; in xfs_dir2_leaf_trim_data()
1603 tp = args->trans; in xfs_dir2_leaf_trim_data()
1607 error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(args->geo, db), in xfs_dir2_leaf_trim_data()
1613 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_trim_data()
1623 args->geo->blksize - dp->d_ops->data_entry_offset); in xfs_dir2_leaf_trim_data()
1631 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { in xfs_dir2_leaf_trim_data()
1642 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_leaf_trim_data()
1643 xfs_dir3_leaf_log_bests(args, lbp, 0, be32_to_cpu(ltp->bestcount) - 1); in xfs_dir2_leaf_trim_data()
1676 xfs_da_args_t *args; /* operation arguments */ in xfs_dir2_node_to_leaf() local
1697 args = state->args; in xfs_dir2_node_to_leaf()
1699 trace_xfs_dir2_node_to_leaf(args); in xfs_dir2_node_to_leaf()
1702 dp = args->dp; in xfs_dir2_node_to_leaf()
1703 tp = args->trans; in xfs_dir2_node_to_leaf()
1710 fo -= args->geo->fsbcount; in xfs_dir2_node_to_leaf()
1717 while (fo > args->geo->freeblk) { in xfs_dir2_node_to_leaf()
1718 if ((error = xfs_dir2_node_trim_free(args, fo, &rval))) { in xfs_dir2_node_to_leaf()
1722 fo -= args->geo->fsbcount; in xfs_dir2_node_to_leaf()
1735 if (XFS_FSB_TO_B(mp, fo) > XFS_DIR2_LEAF_OFFSET + args->geo->blksize) in xfs_dir2_node_to_leaf()
1747 error = xfs_dir2_free_read(tp, dp, args->geo->freeblk, &fbp); in xfs_dir2_node_to_leaf()
1759 if (xfs_dir3_leaf_size(&leafhdr, freehdr.nvalid) > args->geo->blksize) { in xfs_dir2_node_to_leaf()
1768 xfs_dir3_leaf_compact(args, &leafhdr, lbp); in xfs_dir2_node_to_leaf()
1779 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_node_to_leaf()
1789 xfs_dir3_leaf_log_header(args, lbp); in xfs_dir2_node_to_leaf()
1790 xfs_dir3_leaf_log_bests(args, lbp, 0, be32_to_cpu(ltp->bestcount) - 1); in xfs_dir2_node_to_leaf()
1791 xfs_dir3_leaf_log_tail(args, lbp); in xfs_dir2_node_to_leaf()
1797 error = xfs_dir2_shrink_inode(args, in xfs_dir2_node_to_leaf()
1798 xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET), in xfs_dir2_node_to_leaf()
1816 error = xfs_dir2_leaf_to_block(args, lbp, NULL); in xfs_dir2_node_to_leaf()