if (error != -ENOSPC)
return error;
+ /*
+ * Promote the attribute list to the Btree format.
+ */
+ error = xfs_attr3_leaf_to_node(args);
+ if (error)
+ return error;
+
/*
* Finish any deferred work items and roll the transaction once
* more. The goal here is to call node_addname with the inode
struct xfs_da_args *args,
struct xfs_buf *bp)
{
- int retval, error;
+ int retval;
/*
* Look up the given attribute in the leaf block. Figure out if
}
/*
- * Add the attribute to the leaf block, transitioning to a Btree
- * if required.
+ * Add the attribute to the leaf block
*/
- retval = xfs_attr3_leaf_add(bp, args);
- if (retval == -ENOSPC) {
- /*
- * Promote the attribute list to the Btree format. Unless an
- * error occurs, retain the -ENOSPC retval
- */
- error = xfs_attr3_leaf_to_node(args);
- if (error)
- return error;
- }
- return retval;
+ return xfs_attr3_leaf_add(bp, args);
+
out_brelse:
xfs_trans_brelse(args->trans, bp);
return retval;