XArray: minor documentation improvements
Subsystems (3)
PATCH 1/1 XArray: minor documentation improvements
- 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.
--- Documentation/core-api/xarray.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Documentation/core-api/xarray.rst +5 -5
@@ -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 use 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
Signature · 1 line
2.47.0
Quoted 17 lines · Tamir Duberstein
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Use "erasing" rather than "storingNULL" 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 <[email protected]>--- Documentation/core-api/xarray.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)Documentation/core-api/xarray.rst +0
-0
Documentation/core-api/xarray.rst call xa_tag_pointer() to create an entry with a tag, xa_untag_pointer() · line 45
Quoted 6 lines
Documentation/core-api/xarray.rst +1
-2@@ -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 use want to store value entries or tagged pointers in any
"...so you must decide if *you* want to store value entries or..."
Documentation/core-api/xarray.rst An unusual feature of the XArray is the ability to create entries which · line 56
Quoted 12 lines
Documentation/core-api/xarray.rst +3
-2+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.
n00b question: is xa_store(..., NULL) the same as xa_erase?
If it is, then should the documentation mention that xa_store(NULL) is the same as xa_erase, and that both of these operations will cause the xarray to forget about that range?
--D
Quoted 15 lines
Documentation/core-api/xarray.rst +1
-1Normal 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 neverSignature · 1 line
2.47.0
Quoted 6 lines · Darrick J. Wong
n00b question: is
xa_store(..., NULL)the same asxa_erase?If it is, then should the documentation mention that
xa_store(NULL)is the same asxa_erase, and that both of these operations will cause the xarray to forget about that range?
They're not quite the same in the presence of XA_FLAGS_ALLOC. Per the docs:
Quoted 1 line
Unlike a normal XArray, storing NULL will mark the entry as being in use [...]
See https://docs.kernel.org/core-api/xarray.html#allocating-xarrays.
PATCH v2 1/1 XArray: minor documentation improvements
- 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.
---
V1 -> V2: s/use/you/ (Darrick J. Wong)
Documentation/core-api/xarray.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Documentation/core-api/xarray.rst +5 -5
@@ -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
Signature · 1 line
2.47.0
Quoted 8 lines · Tamir Duberstein
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Use "erasing" rather than "storingNULL" 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 <[email protected]>
/me reads about XA_FLAGS_ALLOC and is ok with this now.
--D
Quoted 45 lines
---
V1 -> V2: s/use/you/ (Darrick J. Wong)Documentation/core-api/xarray.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)Documentation/core-api/xarray.rst +5
-5@@ -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 neverSignature · 1 line
2.47.0
Jonathan Corbet
maintainerQuoted 7 lines · Tamir Duberstein
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Use "erasing" rather than "storingNULL" when describing multi-index entries. Split this into a separate sentence.
- Add "call" parentheses on "xa_store" for consistency and linkification.
Quoted 6 lines
Signed-off-by Tamir Duberstein <[email protected]>---
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...:)
Quoted 16 lines
Documentation/core-api/xarray.rst +2
-2@@ -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.
Documentation/core-api/xarray.rst An unusual feature of the XArray is the ability to create entries which · line 56
Quoted 7 lines
Documentation/core-api/xarray.rst +2
-2@@ -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
Quoted 4 lines · Jonathan Corbet
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
Randy Dunlap
reviewerQuoted 20 lines · Tamir Duberstein
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Use "erasing" rather than "storingNULL" 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 <[email protected]>---
V1 -> V2: s/use/you/ (Darrick J. Wong)Documentation/core-api/xarray.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)Documentation/core-api/xarray.rst +0
-0
Documentation/core-api/xarray.rst An unusual feature of the XArray is the ability to create entries which · line 55
Quoted 4 lines
Documentation/core-api/xarray.rst +0
-1@@ -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;
?
Documentation/core-api/xarray.rst An unusual feature of the XArray is the ability to create entries which · line 56
Quoted 3 lines
Documentation/core-api/xarray.rst +2
-1-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.
Quoted 3 lines
Documentation/core-api/xarray.rst +0
-0Normal API ==========
Signature · 1 line
~Randy
Quoted 5 lines · Randy Dunlap
Is storing %NULL does by making a function call or just by doing
*xa1 = NULL;?
No, you cannot interact with XArray this way.
Quoted 5 lines
Documentation/core-api/xarray.rst An unusual feature of the XArray is the ability to create entries which · line 56
Quoted 3 lines
Documentation/core-api/xarray.rst +2
-1-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.
PATCH v3 1/1 XArray: minor documentation improvements
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Mention xa_erase in discussion of multi-index entries. Split this into a separate sentence.
- Add "call" parentheses on "xa_store" for consistency and linkification.
- Add caveat that xa_store and xa_erase are not equivalent in the presence of XA_FLAGS_ALLOC.
---
V2 -> V3:
- metion xa_erase/xa_store(NULL) in multi-index entry discussion.
- mention non-equivalent of xa_erase/xa_store(NULL) in the presence of XA_FLAGS_ALLOC.
V1 -> V2: s/use/you/ (Darrick J. Wong)
Documentation/core-api/xarray.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
Documentation/core-api/xarray.rst +12 -10
@@ -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,9 @@ 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. Unsetting (using +xa_erase() or xa_store() with ``NULL``) any entry will cause the XArray +to forget about the range. Normal API ==========
@@ -63,13 +64,14 @@ for statically allocated XArrays or xa_init() for dynamically 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 -new entry and return the previous entry stored at that index. You can -use xa_erase() instead of calling xa_store() with a +You can then set entries using xa_store() and get entries using +xa_load(). xa_store() will overwrite any entry with the new entry and +return the previous entry stored at that index. You can unset entries +using xa_erase() or by setting the entry to ``NULL`` using xa_store(). ``NULL`` entry. There is no difference between an entry that has never -been stored to, one that has been erased and one that has most recently -had ``NULL`` stored to it. +been stored to and one that has been erased with xa_erase(); an entry +that has most recently had ``NULL`` stored to it is also equivalent +except if the XArray was initialized with ``XA_FLAGS_ALLOC``. You can conditionally replace an entry at an index by using xa_cmpxchg(). Like cmpxchg(), it will only succeed if
Signature · 1 line
2.47.0
Randy Dunlap
reviewerHi Tamir,
Quoted 5 lines · Tamir Duberstein
Normal API
==========Documentation/core-api/xarray.rst +0
-0@@ -63,13 +64,14 @@ for statically allocated XArrays or xa_init() for dynamically allocated ones. A freshly-initialised XArray contains a ``NULL`` pointer at every index.
Documentation/core-api/xarray.rst for statically allocated XArrays or xa_init() for dynamically · line 71
Quoted 10 lines
Documentation/core-api/xarray.rst +4
-4-You can then set entries using xa_store() and get entries -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 +You can then set entries using xa_store() and get entries using +xa_load(). xa_store() will overwrite any entry with the new entry and +return the previous entry stored at that index. You can unset entries +using xa_erase() or by setting the entry to ``NULL`` using xa_store(). ``NULL`` entry. There is no difference between an entry that has never
Is the line above supposed to be here?
Confusing to me.
Thanks.
Quoted 5 lines
Documentation/core-api/xarray.rst +3
-2-been stored to, one that has been erased and one that has most recently -had ``NULL`` stored to it. +been stored to and one that has been erased with xa_erase(); an entry +that has most recently had ``NULL`` stored to it is also equivalent +except if the XArray was initialized with ``XA_FLAGS_ALLOC``.
Signature · 1 line
~Randy
Hi Randy!
Quoted 5 lines · Randy Dunlap
Quoted 5 lines
Documentation/core-api/xarray.rst +1
-4-You can then set entries using xa_store() and get entries -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 +You can then set entries using xa_store() and get entries using
Quoted 8 lines
Documentation/core-api/xarray.rst for statically allocated XArrays or xa_init() for dynamically · line 71
Quoted 4 lines
Documentation/core-api/xarray.rst +3
-0+xa_load(). xa_store() will overwrite any entry with the new entry and +return the previous entry stored at that index. You can unset entries +using xa_erase() or by setting the entry to ``NULL`` using xa_store(). ``NULL`` entry. There is no difference between an entry that has neverIs the line above supposed to be here?
Confusing to me.
Thanks.
Ah I think there's a latent sentence fragment there.
PATCH v4 1/1 XArray: minor documentation improvements
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Mention xa_erase in discussion of multi-index entries. Split this into a separate sentence.
- Add "call" parentheses on "xa_store" for consistency and linkification.
- Add caveat that xa_store and xa_erase are not equivalent in the presence of XA_FLAGS_ALLOC.
---
V3 -> V4: Remove latent sentence fragment.
V2 -> V3:
- metion xa_erase/xa_store(NULL) in multi-index entry discussion.
- mention non-equivalent of xa_erase/xa_store(NULL) in the presence of XA_FLAGS_ALLOC.
V1 -> V2: s/use/you/ (Darrick J. Wong)
Documentation/core-api/xarray.rst | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
Documentation/core-api/xarray.rst +13 -11
@@ -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,9 @@ 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. Unsetting (using +xa_erase() or xa_store() with ``NULL``) any entry will cause the XArray +to forget about the range. Normal API ==========
@@ -63,13 +64,14 @@ for statically allocated XArrays or xa_init() for dynamically 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 -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 -been stored to, one that has been erased and one that has most recently -had ``NULL`` stored to it. +You can then set entries using xa_store() and get entries using +xa_load(). xa_store() will overwrite any entry with the new entry and +return the previous entry stored at that index. You can unset entries +using xa_erase() or by setting the entry to ``NULL`` using xa_store(). +There is no difference between an entry that has never been stored to +and one that has been erased with xa_erase(); an entry that has most +recently had ``NULL`` stored to it is also equivalent except if the +XArray was initialized with ``XA_FLAGS_ALLOC``. You can conditionally replace an entry at an index by using xa_cmpxchg(). Like cmpxchg(), it will only succeed if
Signature · 1 line
2.47.0
Quoted 18 lines · Tamir Duberstein
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Mentionxa_erasein discussion of multi-index entries. Split this into a separate sentence.
- Add "call" parentheses on "xa_store" for consistency and linkification.
- Add caveat thatxa_storeandxa_eraseare not equivalent in the presence ofXA_FLAGS_ALLOC.Signed-off-by Tamir Duberstein <[email protected]>---
V3 -> V4: Remove latent sentence fragment.
V2 -> V3:
- metionxa_erase/xa_store(NULL)in multi-index entry discussion.
- mention non-equivalent ofxa_erase/xa_store(NULL)in the presence ofXA_FLAGS_ALLOC.
V1 -> V2: s/use/you/ (Darrick J. Wong)
Quoted 3 lines
Documentation/core-api/xarray.rst | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
I'm satisfied with this change although obviously it's up to Matthew. Thanks.
Signature · 1 line
~Randy
Matthew Wilcox
maintainerQuoted 1 line · Randy Dunlap
I'm satisfied with this change although obviously it's up to Matthew.
Matthew's on holiday and will be back on Tuesday, thanks.
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Randy Dunlap
I'm satisfied with this change although obviously it's up to Matthew.
Matthew's on holiday and will be back on Tuesday, thanks.
Hi Matthew, could you give this a look please? Thank you.
Quoted 9 lines · Tamir Duberstein
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Randy Dunlap
I'm satisfied with this change although obviously it's up to Matthew.
Matthew's on holiday and will be back on Tuesday, thanks.
Hi Matthew, could you give this a look please? Thank you.
Hi Matthew, could you please have a look at this?
Quoted 9 lines · Tamir Duberstein
- Replace "they" with "you" where "you" is used in the preceding sentence fragment.
- Mentionxa_erasein discussion of multi-index entries. Split this into a separate sentence.
- Add "call" parentheses on "xa_store" for consistency and linkification.
- Add caveat thatxa_storeandxa_eraseare not equivalent in the presence ofXA_FLAGS_ALLOC.
LGTM, thanks!
Signature · 1 line
An old man doll... just what I always wanted! - Clara