Re: [PATCH 14/29] xfs: remove ATTR_ALLOC and XFS_DA_OP_ALLOCVAL

Christoph Hellwig
2020-01-23T22:40:55Z

On Tue, Jan 21, 2020 at 10:17:52AM -0800, Darrick J. Wong wrote:
> > + * If args->value is NULL but args->valuelen is non-zero, allocate the buffer
> > + * for the value after existence of the attribute has been determined. The
> > + * caller always has to free args->value if it is set, no matter if this
> > + * function was successful or not.
>
> /me wonders if the "null value means alloc buffer internally" (and the
> "zero valuelen means return only the value size") behaviors ought to be
> documented in the struct xfs_da_args definition?

Well, that behavior only exists for attr_get, so documenting it there
make sense, not on the data structure that is used differently for
the set and remove side.