<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/xarray.c, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-12-13T19:07:33Z</updated>
<entry>
<title>XArray: Fix xa_alloc when id exceeds max</title>
<updated>2018-12-13T19:07:33Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-13T18:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48483614de97c4f5219abeda630e62b2bebdce62'/>
<id>urn:sha1:48483614de97c4f5219abeda630e62b2bebdce62</id>
<content type='text'>
Specifying a starting ID greater than the maximum ID isn't something
attempted very often, but it should fail.  It was succeeding due to
xas_find_marked() returning the wrong error state, so add tests for
both xa_alloc() and xas_find_marked().

Fixes: b803b42823d0 ("xarray: Add XArray iterators")
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Correct xa_store_range</title>
<updated>2018-11-16T21:27:28Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T15:53:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=44a4a66b619a0a83a52e707ebcd80182207bd50e'/>
<id>urn:sha1:44a4a66b619a0a83a52e707ebcd80182207bd50e</id>
<content type='text'>
The explicit '64' should have been BITS_PER_LONG, but while looking at
this code I realised I meant to use __ffs(), not ilog2().

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Fix Documentation</title>
<updated>2018-11-05T21:38:10Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T21:37:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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: Handle NULL pointers differently for allocation</title>
<updated>2018-11-05T21:38:09Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T21:15:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d9c480435add8257f9069941f0e6196647f6d746'/>
<id>urn:sha1:d9c480435add8257f9069941f0e6196647f6d746</id>
<content type='text'>
For allocating XArrays, it makes sense to distinguish beteen erasing an
entry and storing NULL.  Storing NULL keeps the index allocated with a
NULL pointer associated with it while xa_erase() frees the index.  Some
existing IDR users rely on this ability.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Unify xa_store and __xa_store</title>
<updated>2018-11-05T21:38:09Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T20:56:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=611f318637daa5710a1d7a0e7dc6cda23914094a'/>
<id>urn:sha1:611f318637daa5710a1d7a0e7dc6cda23914094a</id>
<content type='text'>
Saves around 115 bytes on a tinyconfig build and reduces the amount
of code duplication in the XArray implementation.

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:09Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T20:48:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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>
<entry>
<title>XArray: Unify xa_cmpxchg and __xa_cmpxchg</title>
<updated>2018-11-05T21:38:08Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-10-31T18:39:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c5beb07e7a06b24f4f27304f6282b5dbd929543b'/>
<id>urn:sha1:c5beb07e7a06b24f4f27304f6282b5dbd929543b</id>
<content type='text'>
xa_cmpxchg() was one of the largest functions in the xarray
implementation.  By turning it into a wrapper and having the callers
take the lock (like several other functions), we save 160 bytes on a
tinyconfig build and reduce the duplication in xarray.c.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Regularise xa_reserve</title>
<updated>2018-11-05T21:38:08Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-10-30T13:45:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4c0608f4a0e76dfb82d3accd20081f4bf47ed143'/>
<id>urn:sha1:4c0608f4a0e76dfb82d3accd20081f4bf47ed143</id>
<content type='text'>
The xa_reserve() function was a little unusual in that it attempted to
be callable for all kinds of locking scenarios.  Make it look like the
other APIs with __xa_reserve, xa_reserve_bh and xa_reserve_irq variants.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Export __xa_foo to non-GPL modules</title>
<updated>2018-11-05T19:56:58Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-02T02:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9ee5a3b7eeb190eb413e0fac3246022bd1baa05d'/>
<id>urn:sha1:9ee5a3b7eeb190eb413e0fac3246022bd1baa05d</id>
<content type='text'>
Without this, it's not possible to use static inlines like xa_store_bh()
and xa_erase_irq().

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Fix xa_for_each with a single element at 0</title>
<updated>2018-11-05T19:56:46Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-01T20:55:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8229706e03e4147f3e22d1de0d30630cde6d18a9'/>
<id>urn:sha1:8229706e03e4147f3e22d1de0d30630cde6d18a9</id>
<content type='text'>
The following sequence of calls would result in an infinite loop in
xa_find_after():

	xa_store(xa, 0, x, GFP_KERNEL);
	index = 0;
	xa_for_each(xa, entry, index, ULONG_MAX, XA_PRESENT) { }

xa_find_after() was confusing the situation where we found no entry in
the tree with finding a multiorder entry, so it would look for the
successor entry forever.  Just check for this case explicitly.  Includes
a few new checks in the test suite to be sure this doesn't reappear.

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