Commit 54ff675c authored by Bagas Sanjaya's avatar Bagas Sanjaya Committed by Jonathan Corbet
Browse files

Documentation: assoc_array: Indent function explanation text



Paragraphs of function explanation are currently not indented following
their appropriate numbered list item, which causes only the first
paragraph and function prototype code blocks to be indented in the
numbered list in htmldocs output.

Indent the explanation.

Reviewed-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarBagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
Message-ID: <20251013095630.34235-3-bagasdotme@gmail.com>
parent 04623798
Loading
Loading
Loading
Loading
+84 −83
Original line number Diff line number Diff line
@@ -94,15 +94,15 @@ There are two functions for dealing with the script:

   This will perform the edit functions, interpolating various write barriers
   to permit accesses under the RCU read lock to continue.  The edit script
will then be passed to ``call_rcu()`` to free it and any dead stuff it points
to.
   will then be passed to ``call_rcu()`` to free it and any dead stuff it
   points to.

2. Cancel an edit script::

    void assoc_array_cancel_edit(struct assoc_array_edit *edit);

   This frees the edit script and all preallocated memory immediately. If
this was for insertion, the new object is _not_ released by this function,
   this was for insertion, the new object is *not* released by this function,
   but must rather be released by the caller.

These functions are guaranteed not to fail.
@@ -141,8 +141,8 @@ rather than from a caller-supplied index key.

    bool (*compare_object)(const void *object, const void *index_key);

Compare the object against an index key and return ``true`` if it matches and
``false`` if it doesn't.
   Compare the object against an index key and return ``true`` if it matches
   and ``false`` if it doesn't.


4. Diff the index keys of two objects::
@@ -158,8 +158,8 @@ differs from the given index key or -1 if they are the same.
    void (*free_object)(void *object);

   Free the specified object.  Note that this may be called an RCU grace period
after ``assoc_array_apply_edit()`` was called, so ``synchronize_rcu()`` may be
necessary on module unloading.
   after ``assoc_array_apply_edit()`` was called, so ``synchronize_rcu()`` may
   be necessary on module unloading.


Manipulation Functions
@@ -213,8 +213,8 @@ passed to the methods in the ops table when they are called.

   This function makes no alteration to the array itself, but rather returns
   an edit script that must be applied.  ``-ENOMEM`` is returned in the case of
an out-of-memory error.  ``NULL`` will be returned if the specified object is
not found within the array.
   an out-of-memory error.  ``NULL`` will be returned if the specified object
   is not found within the array.

The caller should lock exclusively against other modifiers of the array.

@@ -257,11 +257,11 @@ of the array.
                       bool (*iterator)(void *object, void *iterator_data),
                       void *iterator_data);

This iterates over the objects in an associative array and passes each one to
``iterator()``.  If ``iterator()`` returns ``true``, the object is kept.  If it
returns ``false``, the object will be freed.  If the ``iterator()`` function
returns ``true``, it must perform any appropriate refcount incrementing on the
object before returning.
   This iterates over the objects in an associative array and passes each one
   to ``iterator()``.  If ``iterator()`` returns ``true``, the object is kept.
   If it returns ``false``, the object will be freed.  If the ``iterator()``
   function returns ``true``, it must perform any appropriate refcount
   incrementing on the object before returning.

   The internal tree will be packed down if possible as part of the iteration
   to reduce the number of nodes in it.
@@ -298,10 +298,10 @@ it is possible for the iteration function to see some objects twice. If
   this is a problem, then modification should be locked against.  The
   iteration algorithm should not, however, miss any objects.

The function will return ``0`` if no objects were in the array or else it will
return the result of the last iterator function called.  Iteration stops
immediately if any call to the iteration function results in a non-zero
return.
   The function will return ``0`` if no objects were in the array or else it
   will return the result of the last iterator function called.  Iteration
   stops immediately if any call to the iteration function results in a
   non-zero return.


2. Find an object in an associative array::
@@ -311,12 +311,13 @@ return.
                           const void *index_key);

   This walks through the array's internal tree directly to the object
specified by the index key..
   specified by the index key.

   This may be used on an array at the same time as the array is being
   modified, provided the RCU read lock is held.

The function will return the object if found (and set ``*_type`` to the object
   The function will return the object if found (and set ``*_type`` to the
   object
   type) or will return ``NULL`` if the object was not found.