Message ID | 20241009205237.48881-2-tamird@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] XArray: minor documentation improvements | expand |
On Wed, Oct 09, 2024 at 04:52:38PM -0400, Tamir Duberstein wrote: > - Replace "they" with "you" where "you" is used in the preceding > sentence fragment. > - Use "erasing" rather than "storing `NULL`" when describing multi-index > entries. Split this into a separate sentence. > - Add "call" parentheses on "xa_store" for consistency and > linkification. > > Signed-off-by: Tamir Duberstein <tamird@gmail.com> /me reads about XA_FLAGS_ALLOC and is ok with this now. Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D > --- > V1 -> V2: s/use/you/ (Darrick J. Wong) > > Documentation/core-api/xarray.rst | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst > index 77e0ece2b1d6..75c83b37e88f 100644 > --- a/Documentation/core-api/xarray.rst > +++ b/Documentation/core-api/xarray.rst > @@ -42,8 +42,8 @@ call xa_tag_pointer() to create an entry with a tag, xa_untag_pointer() > to turn a tagged entry back into an untagged pointer and xa_pointer_tag() > to retrieve the tag of an entry. Tagged pointers use the same bits that > are used to distinguish value entries from normal pointers, so you must > -decide whether they want to store value entries or tagged pointers in > -any particular XArray. > +decide whether you want to store value entries or tagged pointers in any > +particular XArray. > > The XArray does not support storing IS_ERR() pointers as some > conflict with value entries or internal entries. > @@ -52,8 +52,8 @@ An unusual feature of the XArray is the ability to create entries which > occupy a range of indices. Once stored to, looking up any index in > the range will return the same entry as looking up any other index in > the range. Storing to any index will store to all of them. Multi-index > -entries can be explicitly split into smaller entries, or storing ``NULL`` > -into any entry will cause the XArray to forget about the range. > +entries can be explicitly split into smaller entries. Erasing any entry > +will cause the XArray to forget about the range. > > Normal API > ========== > @@ -64,7 +64,7 @@ allocated ones. A freshly-initialised XArray contains a ``NULL`` > pointer at every index. > > You can then set entries using xa_store() and get entries > -using xa_load(). xa_store will overwrite any entry with the > +using xa_load(). xa_store() will overwrite any entry with the > new entry and return the previous entry stored at that index. You can > use xa_erase() instead of calling xa_store() with a > ``NULL`` entry. There is no difference between an entry that has never > -- > 2.47.0 > >
Tamir Duberstein <tamird@gmail.com> writes: > - Replace "they" with "you" where "you" is used in the preceding > sentence fragment. > - Use "erasing" rather than "storing `NULL`" when describing multi-index > entries. Split this into a separate sentence. > - Add "call" parentheses on "xa_store" for consistency and > linkification. > > Signed-off-by: Tamir Duberstein <tamird@gmail.com> > --- > V1 -> V2: s/use/you/ (Darrick J. Wong) > > Documentation/core-api/xarray.rst | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) So sorry to pick nits, but it's that kind of patch...:) > diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst > index 77e0ece2b1d6..75c83b37e88f 100644 > --- a/Documentation/core-api/xarray.rst > +++ b/Documentation/core-api/xarray.rst > @@ -42,8 +42,8 @@ call xa_tag_pointer() to create an entry with a tag, xa_untag_pointer() > to turn a tagged entry back into an untagged pointer and xa_pointer_tag() > to retrieve the tag of an entry. Tagged pointers use the same bits that > are used to distinguish value entries from normal pointers, so you must > -decide whether they want to store value entries or tagged pointers in > -any particular XArray. > +decide whether you want to store value entries or tagged pointers in any > +particular XArray. > > The XArray does not support storing IS_ERR() pointers as some > conflict with value entries or internal entries. > @@ -52,8 +52,8 @@ An unusual feature of the XArray is the ability to create entries which > occupy a range of indices. Once stored to, looking up any index in > the range will return the same entry as looking up any other index in > the range. Storing to any index will store to all of them. Multi-index > -entries can be explicitly split into smaller entries, or storing ``NULL`` > -into any entry will cause the XArray to forget about the range. > +entries can be explicitly split into smaller entries. Erasing any entry > +will cause the XArray to forget about the range. I'm not convinced that this is better. This is programmer documentation, and "storing NULL" says exactly what is going on. "Erasing" is, IMO, less clear. Whatever; if Willy's happy I'll certainly apply this. Thanks, jon
On Wed, Oct 9, 2024 at 5:59 PM Jonathan Corbet <corbet@lwn.net> wrote: > > I'm not convinced that this is better. This is programmer > documentation, and "storing NULL" says exactly what is going on. > "Erasing" is, IMO, less clear. Both are verbs that appear in function names: "storing NULL" is to `xa_store(NULL)` as "erasing" is to `xa_erase()`. Cheers. Tamir
On 10/9/24 1:52 PM, Tamir Duberstein wrote: > - Replace "they" with "you" where "you" is used in the preceding > sentence fragment. > - Use "erasing" rather than "storing `NULL`" when describing multi-index > entries. Split this into a separate sentence. > - Add "call" parentheses on "xa_store" for consistency and > linkification. > > Signed-off-by: Tamir Duberstein <tamird@gmail.com> > --- > V1 -> V2: s/use/you/ (Darrick J. Wong) > > Documentation/core-api/xarray.rst | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst > index 77e0ece2b1d6..75c83b37e88f 100644 > --- a/Documentation/core-api/xarray.rst > +++ b/Documentation/core-api/xarray.rst > @@ -52,8 +52,8 @@ An unusual feature of the XArray is the ability to create entries which > occupy a range of indices. Once stored to, looking up any index in > the range will return the same entry as looking up any other index in > the range. Storing to any index will store to all of them. Multi-index > -entries can be explicitly split into smaller entries, or storing ``NULL`` Is storing %NULL does by making a function call or just by doing *xa1 = NULL; ? > -into any entry will cause the XArray to forget about the range. > +entries can be explicitly split into smaller entries. Erasing any entry > +will cause the XArray to forget about the range. Clearing any entry by calling xa_erase() will cause the XArray to forget about the range. > > Normal API > ==========
On Wed, Oct 9, 2024 at 6:22 PM Randy Dunlap <rdunlap@infradead.org> wrote: > > Is storing %NULL does by making a function call or just by doing > *xa1 = NULL; > > ? No, you cannot interact with XArray this way. > > -into any entry will cause the XArray to forget about the range. > > +entries can be explicitly split into smaller entries. Erasing any entry > > +will cause the XArray to forget about the range. > > Clearing any entry by calling xa_erase() will cause the XArray to forget about the range. Will send v3 in a moment with new phrasing.
diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst index 77e0ece2b1d6..75c83b37e88f 100644 --- a/Documentation/core-api/xarray.rst +++ b/Documentation/core-api/xarray.rst @@ -42,8 +42,8 @@ call xa_tag_pointer() to create an entry with a tag, xa_untag_pointer() to turn a tagged entry back into an untagged pointer and xa_pointer_tag() to retrieve the tag of an entry. Tagged pointers use the same bits that are used to distinguish value entries from normal pointers, so you must -decide whether they want to store value entries or tagged pointers in -any particular XArray. +decide whether you want to store value entries or tagged pointers in any +particular XArray. The XArray does not support storing IS_ERR() pointers as some conflict with value entries or internal entries. @@ -52,8 +52,8 @@ An unusual feature of the XArray is the ability to create entries which occupy a range of indices. Once stored to, looking up any index in the range will return the same entry as looking up any other index in the range. Storing to any index will store to all of them. Multi-index -entries can be explicitly split into smaller entries, or storing ``NULL`` -into any entry will cause the XArray to forget about the range. +entries can be explicitly split into smaller entries. Erasing any entry +will cause the XArray to forget about the range. Normal API ========== @@ -64,7 +64,7 @@ allocated ones. A freshly-initialised XArray contains a ``NULL`` pointer at every index. You can then set entries using xa_store() and get entries -using xa_load(). xa_store will overwrite any entry with the +using xa_load(). xa_store() will overwrite any entry with the new entry and return the previous entry stored at that index. You can use xa_erase() instead of calling xa_store() with a ``NULL`` entry. There is no difference between an entry that has never
- Replace "they" with "you" where "you" is used in the preceding sentence fragment. - Use "erasing" rather than "storing `NULL`" when describing multi-index entries. Split this into a separate sentence. - Add "call" parentheses on "xa_store" for consistency and linkification. Signed-off-by: Tamir Duberstein <tamird@gmail.com> --- V1 -> V2: s/use/you/ (Darrick J. Wong) Documentation/core-api/xarray.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)