@@ -642,9 +642,11 @@ xfs_attr_rmtval_alloc(
goto out;
}
- error = xfs_attr_rmtval_set_value(args);
- if (error)
- return error;
+ if (!(args->op_flags & XFS_DA_OP_EMPTY)) {
+ error = xfs_attr_rmtval_set_value(args);
+ if (error)
+ return error;
+ }
attr->xattri_dela_state = xfs_attr_complete_op(attr,
++attr->xattri_dela_state);
@@ -97,6 +97,7 @@ typedef struct xfs_da_args {
#define XFS_DA_OP_CILOOKUP (1u << 4) /* lookup returns CI name if found */
#define XFS_DA_OP_RECOVERY (1u << 5) /* Log recovery operation */
#define XFS_DA_OP_LOGGED (1u << 6) /* Use intent items to track op */
+#define XFS_DA_OP_EMPTY (1u << 7) /* Don't copy any data but alloc blks */
#define XFS_DA_OP_FLAGS \
{ XFS_DA_OP_JUSTCHECK, "JUSTCHECK" }, \
@@ -105,7 +106,8 @@ typedef struct xfs_da_args {
{ XFS_DA_OP_OKNOENT, "OKNOENT" }, \
{ XFS_DA_OP_CILOOKUP, "CILOOKUP" }, \
{ XFS_DA_OP_RECOVERY, "RECOVERY" }, \
- { XFS_DA_OP_LOGGED, "LOGGED" }
+ { XFS_DA_OP_LOGGED, "LOGGED" }, \
+ { XFS_DA_OP_EMPTY, "EMPTY" }
/*
* Storage for holding state during Btree searches and split/join ops.
Allocate blocks but don't copy data into the attribute. Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org> --- fs/xfs/libxfs/xfs_attr.c | 8 +++++--- fs/xfs/libxfs/xfs_da_btree.h | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-)