<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/xarray.h, branch v5.0.15</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.0.15</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.0.15'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-01-17T12:19:42+00:00</updated>
<entry>
<title>XArray: Fix an arithmetic error in xa_is_err</title>
<updated>2019-01-17T12:19:42+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-01-17T12:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=edcddd4c879af48ec922d680b2d56834c085683b'/>
<id>urn:sha1:edcddd4c879af48ec922d680b2d56834c085683b</id>
<content type='text'>
There is a math problem here which leads to a lot of static checker
warnings for me:

net/sunrpc/clnt.c:451 rpc_new_client() error: (-4096) too low for ERR_PTR

Error values are from -1 to -4095 or from 0xffffffff to 0xfffff001 in
hexadecimal.  (I am assuming a 32 bit system for simplicity).  We are
using the lowest two bits to hold some internal XArray data so the
error is shifted two spaces to the left.  0xfffff001 &lt;&lt; 2 is 0xffffc004.
And finally we want to check that BIT(1) is set so we add 2 which gives
us 0xffffc006.

In other words, we should be checking that "entry &gt;= 0xffffc006", but
the check is actually testing if "entry &gt;= 0xffffc002".

Fixes: 76b4e5299565 ("XArray: Permit storing 2-byte-aligned pointers")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
[Use xa_mk_internal() instead of changing the bracketing]
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Fix typo in comment</title>
<updated>2019-01-14T17:52:16+00:00</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@gmail.com</email>
</author>
<published>2019-01-14T08:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19ba9ecf24189bd74d070aa1b1c4bcb9fe4ae849'/>
<id>urn:sha1:19ba9ecf24189bd74d070aa1b1c4bcb9fe4ae849</id>
<content type='text'>
Seems copy and paste typo, not a big deal but still
for consistency sake better to fix.

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@gmail.com&gt;
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Honour reserved entries in xa_insert</title>
<updated>2019-01-07T03:12:58+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2019-01-02T18:57:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b0606fed6eece16a421034eca0bbea9a08b90e91'/>
<id>urn:sha1:b0606fed6eece16a421034eca0bbea9a08b90e91</id>
<content type='text'>
xa_insert() should treat reserved entries as occupied, not as available.
Also, it should treat requests to insert a NULL pointer as a request
to reserve the slot.  Add xa_insert_bh() and xa_insert_irq() for
completeness.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Permit storing 2-byte-aligned pointers</title>
<updated>2019-01-07T03:12:57+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-29T04:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=76b4e52995654af260f14558e0e07b5b039ae202'/>
<id>urn:sha1:76b4e52995654af260f14558e0e07b5b039ae202</id>
<content type='text'>
On m68k, statically allocated pointers may only be two-byte aligned.
This clashes with the XArray's method for tagging internal pointers.
Permit storing these pointers in single slots (ie not in multislots).

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Change xa_for_each iterator</title>
<updated>2019-01-07T02:24:43+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-17T19:45:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a31896c5b5a2715ecf4033426aa0a35066d92d6'/>
<id>urn:sha1:4a31896c5b5a2715ecf4033426aa0a35066d92d6</id>
<content type='text'>
There were three problems with this API:
1. It took too many arguments; almost all users wanted to iterate over
every element in the array rather than a subset.
2. It required that 'index' be initialised before use, and there's no
realistic way to make GCC catch that.
3. 'index' and 'entry' were the opposite way round from every other
member of the XArray APIs.

So split it into three different APIs:

xa_for_each(xa, index, entry)
xa_for_each_start(xa, index, entry, start)
xa_for_each_marked(xa, index, entry, filter)

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Turn xa_init_flags into a static inline</title>
<updated>2019-01-07T02:24:43+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-05T21:37:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02669b17a433c242a40f01f14b691c9c9d1f8a13'/>
<id>urn:sha1:02669b17a433c242a40f01f14b691c9c9d1f8a13</id>
<content type='text'>
A regular xa_init_flags() put all dynamically-initialised XArrays into
the same locking class.  That leads to lockdep believing that taking
one XArray lock while holding another is a deadlock.  It's possible to
work around some of these situations with separate locking classes for
irq/bh/regular XArrays, and SINGLE_DEPTH_NESTING, but that's ugly, and
it doesn't work for all situations (where we have completely unrelated
XArrays).

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Add xa_cmpxchg_irq and xa_cmpxchg_bh</title>
<updated>2018-12-06T13:26:17+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-26T21:08:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55f3f7eab75c10d9b33d122670b5935ab64db50f'/>
<id>urn:sha1:55f3f7eab75c10d9b33d122670b5935ab64db50f</id>
<content type='text'>
These convenience wrappers match the other _irq and _bh wrappers we
already have.  It turns out I'd already open-coded xa_cmpxchg_irq()
in the shmem code, so convert that.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Fix Documentation</title>
<updated>2018-11-05T21:38:10+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T21:37:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=804dfaf01bcc9daa4298c608ba9018abf616ec48'/>
<id>urn:sha1:804dfaf01bcc9daa4298c608ba9018abf616ec48</id>
<content type='text'>
Minor fixes.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Add xa_store_bh() and xa_store_irq()</title>
<updated>2018-11-05T21:38:09+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-10-26T18:41:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84e5acb76dacb8ebd648a86a53907ce0dd616534'/>
<id>urn:sha1:84e5acb76dacb8ebd648a86a53907ce0dd616534</id>
<content type='text'>
These convenience wrappers disable interrupts while taking the spinlock.
A number of drivers would otherwise have to open-code these functions.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Turn xa_erase into an exported function</title>
<updated>2018-11-05T21:38:09+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T20:48:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9c16bb88905456a9b1299338041f05fa7699971b'/>
<id>urn:sha1:9c16bb88905456a9b1299338041f05fa7699971b</id>
<content type='text'>
Make xa_erase() take the spinlock and then call __xa_erase(), but make
it out of line since it's such a common function.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
</feed>
