]> git.ipfire.org Git - thirdparty/linux.git/commit
xarray: Document necessary flag in alloc functions
authorPhilipp Stanner <pstanner@redhat.com>
Mon, 21 Aug 2023 08:21:29 +0000 (10:21 +0200)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 5 Sep 2023 23:01:38 +0000 (19:01 -0400)
commite7716c74e3882405f9eca16faa6cb1bf19995399
tree13fcc03b9751bd875fb3c67ac1002118a27d1566
parentcbc02854331edc6dc22d8b77b6e22e38ebc7dd51
xarray: Document necessary flag in alloc functions

Adds a new line to the docstrings of functions wrapping __xa_alloc() and
__xa_alloc_cyclic(), informing about the necessity of flag XA_FLAGS_ALLOC
being set previously.

The documentation so far says that functions wrapping __xa_alloc() and
__xa_alloc_cyclic() are supposed to return either -ENOMEM or -EBUSY in
case of an error. If the xarray has been initialized without the flag
XA_FLAGS_ALLOC, however, they fail with a different, undocumented error
code.

As hinted at in Documentation/core-api/xarray.rst, wrappers around these
functions should only be invoked when the flag has been set. The
functions' documentation should reflect that as well.

Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/xarray.h
lib/xarray.c