Lines Matching refs:args
47 STATIC int xfs_attr3_leaf_create(struct xfs_da_args *args,
51 struct xfs_da_args *args, int freemap_index);
52 STATIC void xfs_attr3_leaf_compact(struct xfs_da_args *args,
69 STATIC void xfs_attr3_leaf_moveents(struct xfs_da_args *args,
476 struct xfs_da_args *args, in xfs_attr_match() argument
482 if (args->namelen != namelen) in xfs_attr_match()
484 if (memcmp(args->name, name, namelen) != 0) in xfs_attr_match()
488 if ((args->op_flags & XFS_DA_OP_RECOVERY) && in xfs_attr_match()
489 args->attr_filter == (flags & XFS_ATTR_NSP_ONDISK_MASK)) in xfs_attr_match()
493 if (args->attr_filter != in xfs_attr_match()
501 struct xfs_da_args *args, in xfs_attr_copy_value() argument
508 if (!args->valuelen) { in xfs_attr_copy_value()
509 args->valuelen = valuelen; in xfs_attr_copy_value()
516 if (args->valuelen < valuelen) { in xfs_attr_copy_value()
517 args->valuelen = valuelen; in xfs_attr_copy_value()
521 if (!args->value) { in xfs_attr_copy_value()
522 args->value = kvmalloc(valuelen, GFP_KERNEL | __GFP_NOLOCKDEP); in xfs_attr_copy_value()
523 if (!args->value) in xfs_attr_copy_value()
526 args->valuelen = valuelen; in xfs_attr_copy_value()
529 if (args->rmtblkno) in xfs_attr_copy_value()
530 return xfs_attr_rmtval_get(args); in xfs_attr_copy_value()
540 memcpy(args->value, value, valuelen); in xfs_attr_copy_value()
682 struct xfs_da_args *args) in xfs_attr_shortform_create() argument
684 struct xfs_inode *dp = args->dp; in xfs_attr_shortform_create()
688 trace_xfs_attr_sf_create(args); in xfs_attr_shortform_create()
697 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); in xfs_attr_shortform_create()
711 struct xfs_da_args *args, in xfs_attr_sf_findname() argument
722 sf = (struct xfs_attr_shortform *)args->dp->i_afp->if_u1.if_data; in xfs_attr_sf_findname()
728 if (!xfs_attr_match(args, sfe->namelen, sfe->nameval, in xfs_attr_sf_findname()
751 struct xfs_da_args *args, in xfs_attr_shortform_add() argument
761 trace_xfs_attr_sf_add(args); in xfs_attr_shortform_add()
763 dp = args->dp; in xfs_attr_shortform_add()
770 if (xfs_attr_sf_findname(args, &sfe, NULL) == -EEXIST) in xfs_attr_shortform_add()
774 size = xfs_attr_sf_entsize_byname(args->namelen, args->valuelen); in xfs_attr_shortform_add()
779 sfe->namelen = args->namelen; in xfs_attr_shortform_add()
780 sfe->valuelen = args->valuelen; in xfs_attr_shortform_add()
781 sfe->flags = args->attr_filter; in xfs_attr_shortform_add()
782 memcpy(sfe->nameval, args->name, args->namelen); in xfs_attr_shortform_add()
783 memcpy(&sfe->nameval[args->namelen], args->value, args->valuelen); in xfs_attr_shortform_add()
786 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); in xfs_attr_shortform_add()
788 xfs_sbversion_add_attr2(mp, args->trans); in xfs_attr_shortform_add()
814 struct xfs_da_args *args) in xfs_attr_sf_removename() argument
824 trace_xfs_attr_sf_remove(args); in xfs_attr_sf_removename()
826 dp = args->dp; in xfs_attr_sf_removename()
830 error = xfs_attr_sf_findname(args, &sfe, &base); in xfs_attr_sf_removename()
837 if (error == -ENOATTR && (args->op_flags & XFS_DA_OP_RECOVERY)) in xfs_attr_sf_removename()
859 !(args->op_flags & (XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE))) { in xfs_attr_sf_removename()
860 xfs_attr_fork_remove(dp, args->trans); in xfs_attr_sf_removename()
866 (args->op_flags & XFS_DA_OP_ADDNAME) || in xfs_attr_sf_removename()
869 xfs_trans_log_inode(args->trans, dp, in xfs_attr_sf_removename()
873 xfs_sbversion_add_attr2(mp, args->trans); in xfs_attr_sf_removename()
883 xfs_attr_shortform_lookup(xfs_da_args_t *args) in xfs_attr_shortform_lookup() argument
890 trace_xfs_attr_sf_lookup(args); in xfs_attr_shortform_lookup()
892 ifp = args->dp->i_afp; in xfs_attr_shortform_lookup()
898 if (xfs_attr_match(args, sfe->namelen, sfe->nameval, in xfs_attr_shortform_lookup()
914 struct xfs_da_args *args) in xfs_attr_shortform_getvalue() argument
920 ASSERT(args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_attr_shortform_getvalue()
921 sf = (struct xfs_attr_shortform *)args->dp->i_afp->if_u1.if_data; in xfs_attr_shortform_getvalue()
925 if (xfs_attr_match(args, sfe->namelen, sfe->nameval, in xfs_attr_shortform_getvalue()
927 return xfs_attr_copy_value(args, in xfs_attr_shortform_getvalue()
928 &sfe->nameval[args->namelen], sfe->valuelen); in xfs_attr_shortform_getvalue()
936 struct xfs_da_args *args) in xfs_attr_shortform_to_leaf() argument
948 trace_xfs_attr_sf_to_leaf(args); in xfs_attr_shortform_to_leaf()
950 dp = args->dp; in xfs_attr_shortform_to_leaf()
960 xfs_bmap_local_to_extents_empty(args->trans, dp, XFS_ATTR_FORK); in xfs_attr_shortform_to_leaf()
963 error = xfs_da_grow_inode(args, &blkno); in xfs_attr_shortform_to_leaf()
968 error = xfs_attr3_leaf_create(args, blkno, &bp); in xfs_attr_shortform_to_leaf()
974 nargs.geo = args->geo; in xfs_attr_shortform_to_leaf()
975 nargs.total = args->total; in xfs_attr_shortform_to_leaf()
977 nargs.trans = args->trans; in xfs_attr_shortform_to_leaf()
1127 struct xfs_da_args *args, in xfs_attr3_leaf_to_shortform() argument
1135 struct xfs_inode *dp = args->dp; in xfs_attr3_leaf_to_shortform()
1140 trace_xfs_attr_leaf_to_sf(args); in xfs_attr3_leaf_to_shortform()
1142 tmpbuffer = kmem_alloc(args->geo->blksize, 0); in xfs_attr3_leaf_to_shortform()
1146 memcpy(tmpbuffer, bp->b_addr, args->geo->blksize); in xfs_attr3_leaf_to_shortform()
1149 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
1153 memset(bp->b_addr, 0, args->geo->blksize); in xfs_attr3_leaf_to_shortform()
1158 error = xfs_da_shrink_inode(args, 0, bp); in xfs_attr3_leaf_to_shortform()
1169 if (!(args->op_flags & XFS_DA_OP_REPLACE)) { in xfs_attr3_leaf_to_shortform()
1172 xfs_attr_fork_remove(dp, args->trans); in xfs_attr3_leaf_to_shortform()
1177 xfs_attr_shortform_create(args); in xfs_attr3_leaf_to_shortform()
1183 nargs.geo = args->geo; in xfs_attr3_leaf_to_shortform()
1185 nargs.total = args->total; in xfs_attr3_leaf_to_shortform()
1187 nargs.trans = args->trans; in xfs_attr3_leaf_to_shortform()
1217 struct xfs_da_args *args) in xfs_attr3_leaf_to_node() argument
1224 struct xfs_inode *dp = args->dp; in xfs_attr3_leaf_to_node()
1231 trace_xfs_attr_leaf_to_node(args); in xfs_attr3_leaf_to_node()
1238 error = xfs_da_grow_inode(args, &blkno); in xfs_attr3_leaf_to_node()
1241 error = xfs_attr3_leaf_read(args->trans, dp, 0, &bp1); in xfs_attr3_leaf_to_node()
1245 error = xfs_da_get_buf(args->trans, dp, blkno, &bp2, XFS_ATTR_FORK); in xfs_attr3_leaf_to_node()
1250 xfs_trans_buf_set_type(args->trans, bp2, XFS_BLFT_ATTR_LEAF_BUF); in xfs_attr3_leaf_to_node()
1252 memcpy(bp2->b_addr, bp1->b_addr, args->geo->blksize); in xfs_attr3_leaf_to_node()
1257 xfs_trans_log_buf(args->trans, bp2, 0, args->geo->blksize - 1); in xfs_attr3_leaf_to_node()
1262 error = xfs_da3_node_create(args, 0, 1, &bp1, XFS_ATTR_FORK); in xfs_attr3_leaf_to_node()
1269 xfs_attr3_leaf_hdr_from_disk(args->geo, &icleafhdr, leaf); in xfs_attr3_leaf_to_node()
1277 xfs_trans_log_buf(args->trans, bp1, 0, args->geo->blksize - 1); in xfs_attr3_leaf_to_node()
1293 struct xfs_da_args *args, in xfs_attr3_leaf_create() argument
1299 struct xfs_inode *dp = args->dp; in xfs_attr3_leaf_create()
1304 trace_xfs_attr_leaf_create(args); in xfs_attr3_leaf_create()
1306 error = xfs_da_get_buf(args->trans, args->dp, blkno, &bp, in xfs_attr3_leaf_create()
1311 xfs_trans_buf_set_type(args->trans, bp, XFS_BLFT_ATTR_LEAF_BUF); in xfs_attr3_leaf_create()
1313 memset(leaf, 0, args->geo->blksize); in xfs_attr3_leaf_create()
1316 ichdr.firstused = args->geo->blksize; in xfs_attr3_leaf_create()
1334 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1335 xfs_trans_log_buf(args->trans, bp, 0, args->geo->blksize - 1); in xfs_attr3_leaf_create()
1353 trace_xfs_attr_leaf_split(state->args); in xfs_attr3_leaf_split()
1359 error = xfs_da_grow_inode(state->args, &blkno); in xfs_attr3_leaf_split()
1362 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp); in xfs_attr3_leaf_split()
1385 trace_xfs_attr_leaf_add_old(state->args); in xfs_attr3_leaf_split()
1386 error = xfs_attr3_leaf_add(oldblk->bp, state->args); in xfs_attr3_leaf_split()
1388 trace_xfs_attr_leaf_add_new(state->args); in xfs_attr3_leaf_split()
1389 error = xfs_attr3_leaf_add(newblk->bp, state->args); in xfs_attr3_leaf_split()
1406 struct xfs_da_args *args) in xfs_attr3_leaf_add() argument
1416 trace_xfs_attr_leaf_add(args); in xfs_attr3_leaf_add()
1419 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1420 ASSERT(args->index >= 0 && args->index <= ichdr.count); in xfs_attr3_leaf_add()
1421 entsize = xfs_attr_leaf_newentsize(args, NULL); in xfs_attr3_leaf_add()
1440 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i); in xfs_attr3_leaf_add()
1458 xfs_attr3_leaf_compact(args, &ichdr, bp); in xfs_attr3_leaf_add()
1469 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0); in xfs_attr3_leaf_add()
1472 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1473 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_add()
1486 struct xfs_da_args *args, in xfs_attr3_leaf_add_work() argument
1497 trace_xfs_attr_leaf_add_work(args); in xfs_attr3_leaf_add_work()
1501 ASSERT(args->index >= 0 && args->index <= ichdr->count); in xfs_attr3_leaf_add_work()
1506 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_add_work()
1507 if (args->index < ichdr->count) { in xfs_attr3_leaf_add_work()
1508 tmp = ichdr->count - args->index; in xfs_attr3_leaf_add_work()
1511 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_add_work()
1519 mp = args->trans->t_mountp; in xfs_attr3_leaf_add_work()
1520 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize); in xfs_attr3_leaf_add_work()
1523 xfs_attr_leaf_newentsize(args, NULL)); in xfs_attr3_leaf_add_work()
1524 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize); in xfs_attr3_leaf_add_work()
1527 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp); in xfs_attr3_leaf_add_work()
1531 entry->hashval = cpu_to_be32(args->hashval); in xfs_attr3_leaf_add_work()
1532 entry->flags = args->attr_filter; in xfs_attr3_leaf_add_work()
1535 if (args->op_flags & XFS_DA_OP_REPLACE) { in xfs_attr3_leaf_add_work()
1536 if (!(args->op_flags & XFS_DA_OP_LOGGED)) in xfs_attr3_leaf_add_work()
1538 if ((args->blkno2 == args->blkno) && in xfs_attr3_leaf_add_work()
1539 (args->index2 <= args->index)) { in xfs_attr3_leaf_add_work()
1540 args->index2++; in xfs_attr3_leaf_add_work()
1543 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_add_work()
1545 ASSERT((args->index == 0) || in xfs_attr3_leaf_add_work()
1547 ASSERT((args->index == ichdr->count - 1) || in xfs_attr3_leaf_add_work()
1558 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_add_work()
1559 name_loc->namelen = args->namelen; in xfs_attr3_leaf_add_work()
1560 name_loc->valuelen = cpu_to_be16(args->valuelen); in xfs_attr3_leaf_add_work()
1561 memcpy((char *)name_loc->nameval, args->name, args->namelen); in xfs_attr3_leaf_add_work()
1562 memcpy((char *)&name_loc->nameval[args->namelen], args->value, in xfs_attr3_leaf_add_work()
1565 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_add_work()
1566 name_rmt->namelen = args->namelen; in xfs_attr3_leaf_add_work()
1567 memcpy((char *)name_rmt->name, args->name, args->namelen); in xfs_attr3_leaf_add_work()
1572 args->rmtblkno = 1; in xfs_attr3_leaf_add_work()
1573 args->rmtblkcnt = xfs_attr3_rmt_blocks(mp, args->valuelen); in xfs_attr3_leaf_add_work()
1574 args->rmtvaluelen = args->valuelen; in xfs_attr3_leaf_add_work()
1576 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_add_work()
1577 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_add_work()
1578 xfs_attr_leaf_entsize(leaf, args->index))); in xfs_attr3_leaf_add_work()
1599 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1608 struct xfs_da_args *args, in xfs_attr3_leaf_compact() argument
1615 struct xfs_trans *trans = args->trans; in xfs_attr3_leaf_compact()
1618 trace_xfs_attr_leaf_compact(args); in xfs_attr3_leaf_compact()
1620 tmpbuffer = kmem_alloc(args->geo->blksize, 0); in xfs_attr3_leaf_compact()
1621 memcpy(tmpbuffer, bp->b_addr, args->geo->blksize); in xfs_attr3_leaf_compact()
1622 memset(bp->b_addr, 0, args->geo->blksize); in xfs_attr3_leaf_compact()
1635 ichdr_dst->firstused = args->geo->blksize; in xfs_attr3_leaf_compact()
1644 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf_dst, ichdr_dst); in xfs_attr3_leaf_compact()
1650 xfs_attr3_leaf_moveents(args, leaf_src, &ichdr_src, 0, in xfs_attr3_leaf_compact()
1656 xfs_trans_log_buf(trans, bp, 0, args->geo->blksize - 1); in xfs_attr3_leaf_compact()
1719 struct xfs_da_args *args; in xfs_attr3_leaf_rebalance() local
1739 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr1, leaf1); in xfs_attr3_leaf_rebalance()
1740 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, leaf2); in xfs_attr3_leaf_rebalance()
1742 args = state->args; in xfs_attr3_leaf_rebalance()
1744 trace_xfs_attr_leaf_rebalance(args); in xfs_attr3_leaf_rebalance()
1796 xfs_attr3_leaf_compact(args, &ichdr2, blk2->bp); in xfs_attr3_leaf_rebalance()
1801 xfs_attr3_leaf_moveents(args, leaf1, &ichdr1, in xfs_attr3_leaf_rebalance()
1825 xfs_attr3_leaf_compact(args, &ichdr1, blk1->bp); in xfs_attr3_leaf_rebalance()
1830 xfs_attr3_leaf_moveents(args, leaf2, &ichdr2, 0, leaf1, &ichdr1, in xfs_attr3_leaf_rebalance()
1834 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf1, &ichdr1); in xfs_attr3_leaf_rebalance()
1835 xfs_attr3_leaf_hdr_to_disk(state->args->geo, leaf2, &ichdr2); in xfs_attr3_leaf_rebalance()
1836 xfs_trans_log_buf(args->trans, blk1->bp, 0, args->geo->blksize - 1); in xfs_attr3_leaf_rebalance()
1837 xfs_trans_log_buf(args->trans, blk2->bp, 0, args->geo->blksize - 1); in xfs_attr3_leaf_rebalance()
1862 args->index = args->index2 = blk2->index; in xfs_attr3_leaf_rebalance()
1863 args->blkno = args->blkno2 = blk2->blkno; in xfs_attr3_leaf_rebalance()
1866 args->index = blk1->index; in xfs_attr3_leaf_rebalance()
1867 args->blkno = blk1->blkno; in xfs_attr3_leaf_rebalance()
1868 args->index2 = 0; in xfs_attr3_leaf_rebalance()
1869 args->blkno2 = blk2->blkno; in xfs_attr3_leaf_rebalance()
1877 args->index = blk2->index; in xfs_attr3_leaf_rebalance()
1878 args->blkno = blk2->blkno; in xfs_attr3_leaf_rebalance()
1885 args->index2 = blk2->index; in xfs_attr3_leaf_rebalance()
1886 args->blkno2 = blk2->blkno; in xfs_attr3_leaf_rebalance()
1891 args->index = args->index2 = blk1->index; in xfs_attr3_leaf_rebalance()
1892 args->blkno = args->blkno2 = blk1->blkno; in xfs_attr3_leaf_rebalance()
1932 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1934 lastdelta = state->args->geo->blksize; in xfs_attr3_leaf_figure_balance()
1944 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
1980 xfs_attr_leaf_newentsize(state->args, NULL); in xfs_attr3_leaf_figure_balance()
2019 trace_xfs_attr_leaf_toosmall(state->args); in xfs_attr3_leaf_toosmall()
2028 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
2032 if (bytes > (state->args->geo->blksize >> 1)) { in xfs_attr3_leaf_toosmall()
2079 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp, in xfs_attr3_leaf_toosmall()
2084 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr2, bp->b_addr); in xfs_attr3_leaf_toosmall()
2086 bytes = state->args->geo->blksize - in xfs_attr3_leaf_toosmall()
2087 (state->args->geo->blksize >> 2) - in xfs_attr3_leaf_toosmall()
2093 xfs_trans_brelse(state->args->trans, bp); in xfs_attr3_leaf_toosmall()
2133 struct xfs_da_args *args) in xfs_attr3_leaf_remove() argument
2146 trace_xfs_attr_leaf_remove(args); in xfs_attr3_leaf_remove()
2149 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
2151 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_remove()
2152 ASSERT(args->index >= 0 && args->index < ichdr.count); in xfs_attr3_leaf_remove()
2156 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_remove()
2159 ASSERT(be16_to_cpu(entry->nameidx) < args->geo->blksize); in xfs_attr3_leaf_remove()
2172 entsize = xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_remove()
2174 ASSERT(ichdr.freemap[i].base < args->geo->blksize); in xfs_attr3_leaf_remove()
2175 ASSERT(ichdr.freemap[i].size < args->geo->blksize); in xfs_attr3_leaf_remove()
2230 memset(xfs_attr3_leaf_name(leaf, args->index), 0, entsize); in xfs_attr3_leaf_remove()
2232 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_remove()
2233 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_remove()
2236 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2239 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_remove()
2252 tmp = args->geo->blksize; in xfs_attr3_leaf_remove()
2256 ASSERT(be16_to_cpu(entry->nameidx) < args->geo->blksize); in xfs_attr3_leaf_remove()
2266 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2267 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_remove()
2278 return tmp < args->geo->magicpct; /* leaf is < 37% full */ in xfs_attr3_leaf_remove()
2296 trace_xfs_attr_leaf_unbalance(state->args); in xfs_attr3_leaf_unbalance()
2300 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &drophdr, drop_leaf); in xfs_attr3_leaf_unbalance()
2301 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &savehdr, save_leaf); in xfs_attr3_leaf_unbalance()
2321 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2326 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2339 tmp_leaf = kmem_zalloc(state->args->geo->blksize, 0); in xfs_attr3_leaf_unbalance()
2352 tmphdr.firstused = state->args->geo->blksize; in xfs_attr3_leaf_unbalance()
2355 xfs_attr3_leaf_hdr_to_disk(state->args->geo, tmp_leaf, &tmphdr); in xfs_attr3_leaf_unbalance()
2359 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2363 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2368 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2372 xfs_attr3_leaf_moveents(state->args, in xfs_attr3_leaf_unbalance()
2377 memcpy(save_leaf, tmp_leaf, state->args->geo->blksize); in xfs_attr3_leaf_unbalance()
2382 xfs_attr3_leaf_hdr_to_disk(state->args->geo, save_leaf, &savehdr); in xfs_attr3_leaf_unbalance()
2383 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0, in xfs_attr3_leaf_unbalance()
2384 state->args->geo->blksize - 1); in xfs_attr3_leaf_unbalance()
2413 struct xfs_da_args *args) in xfs_attr3_leaf_lookup_int() argument
2425 trace_xfs_attr_leaf_lookup(args); in xfs_attr3_leaf_lookup_int()
2428 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2430 if (ichdr.count >= args->geo->blksize / 8) { in xfs_attr3_leaf_lookup_int()
2438 hashval = args->hashval; in xfs_attr3_leaf_lookup_int()
2472 args->index = probe; in xfs_attr3_leaf_lookup_int()
2486 if (!xfs_attr_match(args, name_loc->namelen, in xfs_attr3_leaf_lookup_int()
2489 args->index = probe; in xfs_attr3_leaf_lookup_int()
2493 if (!xfs_attr_match(args, name_rmt->namelen, in xfs_attr3_leaf_lookup_int()
2496 args->index = probe; in xfs_attr3_leaf_lookup_int()
2497 args->rmtvaluelen = be32_to_cpu(name_rmt->valuelen); in xfs_attr3_leaf_lookup_int()
2498 args->rmtblkno = be32_to_cpu(name_rmt->valueblk); in xfs_attr3_leaf_lookup_int()
2499 args->rmtblkcnt = xfs_attr3_rmt_blocks( in xfs_attr3_leaf_lookup_int()
2500 args->dp->i_mount, in xfs_attr3_leaf_lookup_int()
2501 args->rmtvaluelen); in xfs_attr3_leaf_lookup_int()
2505 args->index = probe; in xfs_attr3_leaf_lookup_int()
2520 struct xfs_da_args *args) in xfs_attr3_leaf_getvalue() argument
2529 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2530 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_getvalue()
2531 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_getvalue()
2533 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_getvalue()
2535 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_getvalue()
2536 ASSERT(name_loc->namelen == args->namelen); in xfs_attr3_leaf_getvalue()
2537 ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) == 0); in xfs_attr3_leaf_getvalue()
2538 return xfs_attr_copy_value(args, in xfs_attr3_leaf_getvalue()
2539 &name_loc->nameval[args->namelen], in xfs_attr3_leaf_getvalue()
2543 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_getvalue()
2544 ASSERT(name_rmt->namelen == args->namelen); in xfs_attr3_leaf_getvalue()
2545 ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); in xfs_attr3_leaf_getvalue()
2546 args->rmtvaluelen = be32_to_cpu(name_rmt->valuelen); in xfs_attr3_leaf_getvalue()
2547 args->rmtblkno = be32_to_cpu(name_rmt->valueblk); in xfs_attr3_leaf_getvalue()
2548 args->rmtblkcnt = xfs_attr3_rmt_blocks(args->dp->i_mount, in xfs_attr3_leaf_getvalue()
2549 args->rmtvaluelen); in xfs_attr3_leaf_getvalue()
2550 return xfs_attr_copy_value(args, NULL, args->rmtvaluelen); in xfs_attr3_leaf_getvalue()
2564 struct xfs_da_args *args, in xfs_attr3_leaf_moveents() argument
2591 ASSERT(ichdr_s->count > 0 && ichdr_s->count < args->geo->blksize / 8); in xfs_attr3_leaf_moveents()
2594 ASSERT(ichdr_d->count < args->geo->blksize / 8); in xfs_attr3_leaf_moveents()
2646 <= args->geo->blksize); in xfs_attr3_leaf_moveents()
2650 <= args->geo->blksize); in xfs_attr3_leaf_moveents()
2671 ((char *)leaf_s + args->geo->blksize)); in xfs_attr3_leaf_moveents()
2686 ((char *)leaf_s + args->geo->blksize)); in xfs_attr3_leaf_moveents()
2756 struct xfs_da_args *args, in xfs_attr_leaf_newentsize() argument
2761 size = xfs_attr_leaf_entsize_local(args->namelen, args->valuelen); in xfs_attr_leaf_newentsize()
2762 if (size < xfs_attr_leaf_entsize_local_max(args->geo->blksize)) { in xfs_attr_leaf_newentsize()
2769 return xfs_attr_leaf_entsize_remote(args->namelen); in xfs_attr_leaf_newentsize()
2782 struct xfs_da_args *args) in xfs_attr3_leaf_clearflag() argument
2796 trace_xfs_attr_leaf_clearflag(args); in xfs_attr3_leaf_clearflag()
2800 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp); in xfs_attr3_leaf_clearflag()
2805 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_clearflag()
2809 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2810 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_clearflag()
2811 ASSERT(args->index >= 0); in xfs_attr3_leaf_clearflag()
2814 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_clearflag()
2818 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2822 ASSERT(be32_to_cpu(entry->hashval) == args->hashval); in xfs_attr3_leaf_clearflag()
2823 ASSERT(namelen == args->namelen); in xfs_attr3_leaf_clearflag()
2824 ASSERT(memcmp(name, args->name, namelen) == 0); in xfs_attr3_leaf_clearflag()
2828 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_clearflag()
2831 if (args->rmtblkno) { in xfs_attr3_leaf_clearflag()
2833 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2834 name_rmt->valueblk = cpu_to_be32(args->rmtblkno); in xfs_attr3_leaf_clearflag()
2835 name_rmt->valuelen = cpu_to_be32(args->rmtvaluelen); in xfs_attr3_leaf_clearflag()
2836 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_clearflag()
2848 struct xfs_da_args *args) in xfs_attr3_leaf_setflag() argument
2859 trace_xfs_attr_leaf_setflag(args); in xfs_attr3_leaf_setflag()
2864 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp); in xfs_attr3_leaf_setflag()
2870 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2871 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_setflag()
2872 ASSERT(args->index >= 0); in xfs_attr3_leaf_setflag()
2874 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_setflag()
2878 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_setflag()
2881 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_setflag()
2884 xfs_trans_log_buf(args->trans, bp, in xfs_attr3_leaf_setflag()
2900 struct xfs_da_args *args) in xfs_attr3_leaf_flipflags() argument
2918 trace_xfs_attr_leaf_flipflags(args); in xfs_attr3_leaf_flipflags()
2923 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp1); in xfs_attr3_leaf_flipflags()
2930 if (args->blkno2 != args->blkno) { in xfs_attr3_leaf_flipflags()
2931 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno2, in xfs_attr3_leaf_flipflags()
2940 entry1 = &xfs_attr3_leaf_entryp(leaf1)[args->index]; in xfs_attr3_leaf_flipflags()
2943 entry2 = &xfs_attr3_leaf_entryp(leaf2)[args->index2]; in xfs_attr3_leaf_flipflags()
2946 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr1, leaf1); in xfs_attr3_leaf_flipflags()
2947 ASSERT(args->index < ichdr1.count); in xfs_attr3_leaf_flipflags()
2948 ASSERT(args->index >= 0); in xfs_attr3_leaf_flipflags()
2950 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr2, leaf2); in xfs_attr3_leaf_flipflags()
2951 ASSERT(args->index2 < ichdr2.count); in xfs_attr3_leaf_flipflags()
2952 ASSERT(args->index2 >= 0); in xfs_attr3_leaf_flipflags()
2955 name_loc = xfs_attr3_leaf_name_local(leaf1, args->index); in xfs_attr3_leaf_flipflags()
2959 name_rmt = xfs_attr3_leaf_name_remote(leaf1, args->index); in xfs_attr3_leaf_flipflags()
2964 name_loc = xfs_attr3_leaf_name_local(leaf2, args->index2); in xfs_attr3_leaf_flipflags()
2968 name_rmt = xfs_attr3_leaf_name_remote(leaf2, args->index2); in xfs_attr3_leaf_flipflags()
2981 xfs_trans_log_buf(args->trans, bp1, in xfs_attr3_leaf_flipflags()
2983 if (args->rmtblkno) { in xfs_attr3_leaf_flipflags()
2985 name_rmt = xfs_attr3_leaf_name_remote(leaf1, args->index); in xfs_attr3_leaf_flipflags()
2986 name_rmt->valueblk = cpu_to_be32(args->rmtblkno); in xfs_attr3_leaf_flipflags()
2987 name_rmt->valuelen = cpu_to_be32(args->rmtvaluelen); in xfs_attr3_leaf_flipflags()
2988 xfs_trans_log_buf(args->trans, bp1, in xfs_attr3_leaf_flipflags()
2993 xfs_trans_log_buf(args->trans, bp2, in xfs_attr3_leaf_flipflags()
2996 name_rmt = xfs_attr3_leaf_name_remote(leaf2, args->index2); in xfs_attr3_leaf_flipflags()
2999 xfs_trans_log_buf(args->trans, bp2, in xfs_attr3_leaf_flipflags()