diff options
author | 2018-11-05 16:37:15 -0500 | |
---|---|---|
committer | 2018-11-05 16:38:10 -0500 | |
commit | 804dfaf01bcc9daa4298c608ba9018abf616ec48 (patch) | |
tree | 6980e540f3043fb47016c3ff6259caaee44bb689 /Documentation | |
parent | XArray: Handle NULL pointers differently for allocation (diff) | |
download | linux-804dfaf01bcc9daa4298c608ba9018abf616ec48.tar.gz linux-804dfaf01bcc9daa4298c608ba9018abf616ec48.tar.bz2 linux-804dfaf01bcc9daa4298c608ba9018abf616ec48.zip |
XArray: Fix Documentation
Minor fixes.
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/core-api/xarray.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst index 616ac406bf86..dbe96cb5558e 100644 --- a/Documentation/core-api/xarray.rst +++ b/Documentation/core-api/xarray.rst @@ -74,7 +74,8 @@ using :c:func:`xa_load`. xa_store will overwrite any entry with the new entry and return the previous entry stored at that index. You can use :c:func:`xa_erase` instead of calling :c:func:`xa_store` with a ``NULL`` entry. There is no difference between an entry that has never -been stored to and one that has most recently had ``NULL`` stored to it. +been stored to, one that has been erased and one that has most recently +had ``NULL`` stored to it. You can conditionally replace an entry at an index by using :c:func:`xa_cmpxchg`. Like :c:func:`cmpxchg`, it will only succeed if @@ -114,6 +115,9 @@ unused entry. If another user has stored to the entry in the meantime, :c:func:`xa_release` will do nothing; if instead you want the entry to become ``NULL``, you should use :c:func:`xa_erase`. +If all entries in the array are ``NULL``, the :c:func:`xa_empty` function +will return ``true``. + Finally, you can remove all entries from an XArray by calling :c:func:`xa_destroy`. If the XArray entries are pointers, you may wish to free the entries first. You can do this by iterating over all present |