Lines Matching defs:args
30 static int xfs_dir2_block_lookup_int(xfs_da_args_t *args, struct xfs_buf **bpp,
300 struct xfs_da_args *args,
333 xfs_dir2_data_make_free(args, bp,
343 xfs_dir2_data_freescan(args->dp->i_mount, hdr, needlog);
351 xfs_da_args_t *args) /* directory op arguments */
377 trace_xfs_dir2_block_addname(args);
379 dp = args->dp;
380 tp = args->trans;
387 len = xfs_dir2_data_entsize(dp->i_mount, args->namelen);
393 btp = xfs_dir2_block_tail_p(args->geo, hdr);
406 if (args->op_flags & XFS_DA_OP_JUSTCHECK) {
418 if (args->total == 0)
424 error = xfs_dir2_block_to_leaf(args, bp);
427 return xfs_dir2_leaf_addname(args);
436 xfs_dir2_block_compact(args, bp, hdr, btp, blp, &needlog,
454 if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval)
456 if (hash < args->hashval)
461 while (mid >= 0 && be32_to_cpu(blp[mid].hashval) >= args->hashval) {
475 error = xfs_dir2_data_use_free(args, bp, enddup, aoff,
555 blp[mid].hashval = cpu_to_be32(args->hashval);
562 error = xfs_dir2_data_use_free(args, bp, dup,
570 dep->inumber = cpu_to_be64(args->inumber);
571 dep->namelen = args->namelen;
572 memcpy(dep->name, args->name, args->namelen);
573 xfs_dir2_data_put_ftype(dp->i_mount, dep, args->filetype);
582 xfs_dir2_data_log_header(args, bp);
584 xfs_dir2_data_log_entry(args, bp, dep);
631 xfs_da_args_t *args) /* dir lookup arguments */
642 trace_xfs_dir2_block_lookup(args);
648 if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent)))
650 dp = args->dp;
653 btp = xfs_dir2_block_tail_p(args->geo, hdr);
659 xfs_dir2_dataptr_to_off(args->geo,
664 args->inumber = be64_to_cpu(dep->inumber);
665 args->filetype = xfs_dir2_data_get_ftype(dp->i_mount, dep);
666 error = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
667 xfs_trans_brelse(args->trans, bp);
676 xfs_da_args_t *args, /* dir lookup arguments */
695 dp = args->dp;
696 tp = args->trans;
704 btp = xfs_dir2_block_tail_p(args->geo, hdr);
713 if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval)
715 if (hash < args->hashval)
720 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
728 while (mid > 0 && be32_to_cpu(blp[mid - 1].hashval) == args->hashval) {
742 ((char *)hdr + xfs_dir2_dataptr_to_off(args->geo, addr));
748 cmp = xfs_dir2_compname(args, dep->name, dep->namelen);
749 if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
750 args->cmpresult = cmp;
759 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
764 if (args->cmpresult == XFS_CMP_CASE)
779 xfs_da_args_t *args) /* directory operation args */
795 trace_xfs_dir2_block_removename(args);
801 if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent))) {
804 dp = args->dp;
805 tp = args->trans;
807 btp = xfs_dir2_block_tail_p(args->geo, hdr);
813 xfs_dir2_dataptr_to_off(args->geo,
819 xfs_dir2_data_make_free(args, bp,
839 xfs_dir2_data_log_header(args, bp);
851 return xfs_dir2_block_to_sf(args, bp, size, &sfh);
860 xfs_da_args_t *args) /* directory operation args */
871 trace_xfs_dir2_block_replace(args);
877 if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent))) {
880 dp = args->dp;
882 btp = xfs_dir2_block_tail_p(args->geo, hdr);
888 xfs_dir2_dataptr_to_off(args->geo,
890 ASSERT(be64_to_cpu(dep->inumber) != args->inumber);
894 dep->inumber = cpu_to_be64(args->inumber);
895 xfs_dir2_data_put_ftype(dp->i_mount, dep, args->filetype);
896 xfs_dir2_data_log_entry(args, bp, dep);
923 xfs_da_args_t *args, /* operation arguments */
947 trace_xfs_dir2_leaf_to_block(args);
949 dp = args->dp;
950 tp = args->trans;
954 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
964 while (dp->i_d.di_size > args->geo->blksize) {
967 hdrsz = args->geo->data_entry_offset;
970 args->geo->blksize - hdrsz) {
972 xfs_dir2_leaf_trim_data(args, lbp,
982 error = xfs_dir3_data_read(tp, dp, args->geo->datablk, 0, &dbp);
998 tagp = (__be16 *)((char *)hdr + args->geo->blksize) - 1;
1017 error = xfs_dir2_data_use_free(args, dbp, dup,
1018 args->geo->blksize - size, size, &needlog, &needscan);
1024 btp = xfs_dir2_block_tail_p(args->geo, hdr);
1046 xfs_dir2_data_log_header(args, dbp);
1050 error = xfs_da_shrink_inode(args, args->geo->leafblk, lbp);
1061 return xfs_dir2_block_to_sf(args, dbp, size, &sfh);
1069 struct xfs_da_args *args)
1071 struct xfs_trans *tp = args->trans;
1072 struct xfs_inode *dp = args->dp;
1075 struct xfs_da_geometry *geo = args->geo;
1097 trace_xfs_dir2_sf_to_block(args);
1123 error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, &blkno);
1129 error = xfs_dir3_data_init(args, blkno, &bp);
1146 error = xfs_dir2_data_use_free(args, bp, dup, args->geo->blksize - i,
1154 btp = xfs_dir2_block_tail_p(args->geo, hdr);
1162 error = xfs_dir2_data_use_free(args, bp, dup,
1178 xfs_dir2_data_log_entry(args, bp, dep);
1193 xfs_dir2_data_log_entry(args, bp, dep);
1227 xfs_dir2_data_log_unused(args, bp, dup);
1245 xfs_dir2_data_log_entry(args, bp, dep);