|
@@ -220,7 +220,6 @@ xfs_attr_set(
|
|
args.value = value;
|
|
args.value = value;
|
|
args.valuelen = valuelen;
|
|
args.valuelen = valuelen;
|
|
args.firstblock = &firstblock;
|
|
args.firstblock = &firstblock;
|
|
- args.dfops = &dfops;
|
|
|
|
args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
|
|
args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
|
|
args.total = xfs_attr_calc_size(&args, &local);
|
|
args.total = xfs_attr_calc_size(&args, &local);
|
|
|
|
|
|
@@ -407,7 +406,6 @@ xfs_attr_remove(
|
|
return error;
|
|
return error;
|
|
|
|
|
|
args.firstblock = &firstblock;
|
|
args.firstblock = &firstblock;
|
|
- args.dfops = &dfops;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
* we have no control over the attribute names that userspace passes us
|
|
* we have no control over the attribute names that userspace passes us
|
|
@@ -539,11 +537,12 @@ xfs_attr_shortform_addname(xfs_da_args_t *args)
|
|
* if bmap_one_block() says there is only one block (ie: no remote blks).
|
|
* if bmap_one_block() says there is only one block (ie: no remote blks).
|
|
*/
|
|
*/
|
|
STATIC int
|
|
STATIC int
|
|
-xfs_attr_leaf_addname(xfs_da_args_t *args)
|
|
|
|
|
|
+xfs_attr_leaf_addname(
|
|
|
|
+ struct xfs_da_args *args)
|
|
{
|
|
{
|
|
- xfs_inode_t *dp;
|
|
|
|
- struct xfs_buf *bp;
|
|
|
|
- int retval, error, forkoff;
|
|
|
|
|
|
+ struct xfs_inode *dp;
|
|
|
|
+ struct xfs_buf *bp;
|
|
|
|
+ int retval, error, forkoff;
|
|
|
|
|
|
trace_xfs_attr_leaf_addname(args);
|
|
trace_xfs_attr_leaf_addname(args);
|
|
|
|
|
|
@@ -601,12 +600,12 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
|
|
* Commit that transaction so that the node_addname() call
|
|
* Commit that transaction so that the node_addname() call
|
|
* can manage its own transactions.
|
|
* can manage its own transactions.
|
|
*/
|
|
*/
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_attr3_leaf_to_node(args);
|
|
error = xfs_attr3_leaf_to_node(args);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
|
|
|
|
@@ -690,13 +689,13 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
|
|
* If the result is small enough, shrink it all into the inode.
|
|
* If the result is small enough, shrink it all into the inode.
|
|
*/
|
|
*/
|
|
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
|
|
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
|
|
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
|
|
/* bp is gone due to xfs_da_shrink_inode */
|
|
/* bp is gone due to xfs_da_shrink_inode */
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
}
|
|
}
|
|
@@ -714,7 +713,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
|
|
}
|
|
}
|
|
return error;
|
|
return error;
|
|
out_defer_cancel:
|
|
out_defer_cancel:
|
|
- xfs_defer_cancel(args->dfops);
|
|
|
|
|
|
+ xfs_defer_cancel(args->trans->t_dfops);
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -725,11 +724,12 @@ out_defer_cancel:
|
|
* if bmap_one_block() says there is only one block (ie: no remote blks).
|
|
* if bmap_one_block() says there is only one block (ie: no remote blks).
|
|
*/
|
|
*/
|
|
STATIC int
|
|
STATIC int
|
|
-xfs_attr_leaf_removename(xfs_da_args_t *args)
|
|
|
|
|
|
+xfs_attr_leaf_removename(
|
|
|
|
+ struct xfs_da_args *args)
|
|
{
|
|
{
|
|
- xfs_inode_t *dp;
|
|
|
|
- struct xfs_buf *bp;
|
|
|
|
- int error, forkoff;
|
|
|
|
|
|
+ struct xfs_inode *dp;
|
|
|
|
+ struct xfs_buf *bp;
|
|
|
|
+ int error, forkoff;
|
|
|
|
|
|
trace_xfs_attr_leaf_removename(args);
|
|
trace_xfs_attr_leaf_removename(args);
|
|
|
|
|
|
@@ -754,19 +754,19 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
|
|
* If the result is small enough, shrink it all into the inode.
|
|
* If the result is small enough, shrink it all into the inode.
|
|
*/
|
|
*/
|
|
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
|
|
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
|
|
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
|
|
/* bp is gone due to xfs_da_shrink_inode */
|
|
/* bp is gone due to xfs_da_shrink_inode */
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
out_defer_cancel:
|
|
out_defer_cancel:
|
|
- xfs_defer_cancel(args->dfops);
|
|
|
|
|
|
+ xfs_defer_cancel(args->trans->t_dfops);
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -817,13 +817,14 @@ xfs_attr_leaf_get(xfs_da_args_t *args)
|
|
* add a whole extra layer of confusion on top of that.
|
|
* add a whole extra layer of confusion on top of that.
|
|
*/
|
|
*/
|
|
STATIC int
|
|
STATIC int
|
|
-xfs_attr_node_addname(xfs_da_args_t *args)
|
|
|
|
|
|
+xfs_attr_node_addname(
|
|
|
|
+ struct xfs_da_args *args)
|
|
{
|
|
{
|
|
- xfs_da_state_t *state;
|
|
|
|
- xfs_da_state_blk_t *blk;
|
|
|
|
- xfs_inode_t *dp;
|
|
|
|
- xfs_mount_t *mp;
|
|
|
|
- int retval, error;
|
|
|
|
|
|
+ struct xfs_da_state *state;
|
|
|
|
+ struct xfs_da_state_blk *blk;
|
|
|
|
+ struct xfs_inode *dp;
|
|
|
|
+ struct xfs_mount *mp;
|
|
|
|
+ int retval, error;
|
|
|
|
|
|
trace_xfs_attr_node_addname(args);
|
|
trace_xfs_attr_node_addname(args);
|
|
|
|
|
|
@@ -882,12 +883,13 @@ restart:
|
|
*/
|
|
*/
|
|
xfs_da_state_free(state);
|
|
xfs_da_state_free(state);
|
|
state = NULL;
|
|
state = NULL;
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_attr3_leaf_to_node(args);
|
|
error = xfs_attr3_leaf_to_node(args);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans,
|
|
|
|
+ args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
|
|
|
|
@@ -908,12 +910,12 @@ restart:
|
|
* in the index/blkno/rmtblkno/rmtblkcnt fields and
|
|
* in the index/blkno/rmtblkno/rmtblkcnt fields and
|
|
* in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields.
|
|
* in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields.
|
|
*/
|
|
*/
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_da3_split(state);
|
|
error = xfs_da3_split(state);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
} else {
|
|
} else {
|
|
@@ -1006,12 +1008,12 @@ restart:
|
|
* Check to see if the tree needs to be collapsed.
|
|
* Check to see if the tree needs to be collapsed.
|
|
*/
|
|
*/
|
|
if (retval && (state->path.active > 1)) {
|
|
if (retval && (state->path.active > 1)) {
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_da3_join(state);
|
|
error = xfs_da3_join(state);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
}
|
|
}
|
|
@@ -1040,7 +1042,7 @@ out:
|
|
return error;
|
|
return error;
|
|
return retval;
|
|
return retval;
|
|
out_defer_cancel:
|
|
out_defer_cancel:
|
|
- xfs_defer_cancel(args->dfops);
|
|
|
|
|
|
+ xfs_defer_cancel(args->trans->t_dfops);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1052,13 +1054,14 @@ out_defer_cancel:
|
|
* the root node (a special case of an intermediate node).
|
|
* the root node (a special case of an intermediate node).
|
|
*/
|
|
*/
|
|
STATIC int
|
|
STATIC int
|
|
-xfs_attr_node_removename(xfs_da_args_t *args)
|
|
|
|
|
|
+xfs_attr_node_removename(
|
|
|
|
+ struct xfs_da_args *args)
|
|
{
|
|
{
|
|
- xfs_da_state_t *state;
|
|
|
|
- xfs_da_state_blk_t *blk;
|
|
|
|
- xfs_inode_t *dp;
|
|
|
|
- struct xfs_buf *bp;
|
|
|
|
- int retval, error, forkoff;
|
|
|
|
|
|
+ struct xfs_da_state *state;
|
|
|
|
+ struct xfs_da_state_blk *blk;
|
|
|
|
+ struct xfs_inode *dp;
|
|
|
|
+ struct xfs_buf *bp;
|
|
|
|
+ int retval, error, forkoff;
|
|
|
|
|
|
trace_xfs_attr_node_removename(args);
|
|
trace_xfs_attr_node_removename(args);
|
|
|
|
|
|
@@ -1130,12 +1133,12 @@ xfs_attr_node_removename(xfs_da_args_t *args)
|
|
* Check to see if the tree needs to be collapsed.
|
|
* Check to see if the tree needs to be collapsed.
|
|
*/
|
|
*/
|
|
if (retval && (state->path.active > 1)) {
|
|
if (retval && (state->path.active > 1)) {
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_da3_join(state);
|
|
error = xfs_da3_join(state);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
/*
|
|
/*
|
|
@@ -1162,13 +1165,13 @@ xfs_attr_node_removename(xfs_da_args_t *args)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
|
|
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
|
|
- xfs_defer_init(args->dfops, args->firstblock);
|
|
|
|
|
|
+ xfs_defer_init(args->trans->t_dfops, args->firstblock);
|
|
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
|
|
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
|
|
/* bp is gone due to xfs_da_shrink_inode */
|
|
/* bp is gone due to xfs_da_shrink_inode */
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
- xfs_defer_ijoin(args->dfops, dp);
|
|
|
|
- error = xfs_defer_finish(&args->trans, args->dfops);
|
|
|
|
|
|
+ xfs_defer_ijoin(args->trans->t_dfops, dp);
|
|
|
|
+ error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
|
|
if (error)
|
|
if (error)
|
|
goto out_defer_cancel;
|
|
goto out_defer_cancel;
|
|
} else
|
|
} else
|
|
@@ -1180,7 +1183,7 @@ out:
|
|
xfs_da_state_free(state);
|
|
xfs_da_state_free(state);
|
|
return error;
|
|
return error;
|
|
out_defer_cancel:
|
|
out_defer_cancel:
|
|
- xfs_defer_cancel(args->dfops);
|
|
|
|
|
|
+ xfs_defer_cancel(args->trans->t_dfops);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|