Matthew Wilcox f6bb2a2c0b xarray: add the xa_lock to the radix_tree_root
This results in no change in structure size on 64-bit machines as it
fits in the padding between the gfp_t and the void *.  32-bit machines
will grow the structure from 8 to 12 bytes.  Almost all radix trees are
protected with (at least) a spinlock, so as they are converted from
radix trees to xarrays, the data structures will shrink again.

Initialising the spinlock requires a name for the benefit of lockdep, so
RADIX_TREE_INIT() now needs to know the name of the radix tree it's
initialising, and so do IDR_INIT() and IDA_INIT().

Also add the xa_lock() and xa_unlock() family of wrappers to make it
easier to use the lock.  If we could rely on -fplan9-extensions in the
compiler, we could avoid all of this syntactic sugar, but that wasn't
added until gcc 4.6.

Link: http://lkml.kernel.org/r/20180313132639.17387-8-willy@infradead.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-11 10:28:39 -07:00
..
2018-02-14 09:43:22 -08:00
2017-11-14 16:49:31 -08:00
2017-11-28 16:30:38 +01:00
2018-02-01 09:51:57 -08:00
2018-01-01 22:54:42 -08:00
2018-04-10 10:22:27 -07:00
2018-04-04 22:11:36 +02:00
2018-02-20 11:34:54 +00:00
2018-03-08 13:56:24 +05:30
2018-03-29 14:29:55 -04:00
2018-04-07 12:08:19 -07:00
2018-04-05 21:29:35 -07:00
2018-04-05 10:42:07 -07:00
2018-04-11 10:28:37 -07:00
2018-03-16 10:56:13 +01:00
2018-03-31 02:15:18 +02:00
2018-03-31 02:16:26 +02:00
2018-03-31 02:14:44 +02:00
2018-02-04 11:16:35 -08:00
2017-11-15 18:21:04 -08:00
2017-12-19 16:35:34 -08:00
2018-01-03 14:03:48 +01:00
2018-03-16 10:55:47 +01:00
2018-03-26 15:09:38 +02:00
2017-11-13 21:05:31 -08:00
2018-04-04 19:41:45 -07:00
2017-11-27 16:19:56 -05:00
2018-04-05 10:23:24 -07:00
2018-04-05 14:21:13 -07:00
2018-03-12 10:05:01 +01:00
2018-01-01 12:40:27 -07:00
2018-03-26 15:56:44 +02:00
2018-03-31 02:15:18 +02:00
2017-11-13 01:41:20 +01:00
2018-04-10 10:25:57 -07:00
2018-01-29 09:08:34 -08:00
2018-02-26 09:48:42 -07:00
2017-11-15 18:21:06 -08:00
2018-04-09 11:42:31 -07:00
2018-04-05 14:27:02 -07:00
2018-02-22 21:13:03 +01:00
2018-03-26 08:53:43 -06:00
2018-01-17 11:30:16 +00:00
2017-11-17 09:51:57 -08:00
2018-01-29 09:08:34 -08:00
2018-04-11 10:28:35 -07:00
2018-04-11 10:28:38 -07:00
2017-11-15 18:21:01 -08:00
2018-02-24 01:43:47 +01:00
2018-03-13 13:29:10 -07:00
2017-12-01 13:09:40 -08:00
2017-10-07 10:45:02 -06:00
2018-01-03 11:00:22 -05:00
2018-04-07 12:08:19 -07:00
2018-04-11 10:28:32 -07:00
2018-04-11 10:28:39 -07:00
2017-11-15 13:46:33 -08:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-30 12:56:22 -04:00
2017-11-17 14:18:00 -08:00
2017-11-17 14:18:00 -08:00
2017-11-17 16:10:00 -08:00
2018-01-28 22:17:24 -05:00
2017-11-15 15:01:28 -08:00
2018-01-08 08:22:45 -06:00
2018-02-01 10:57:45 -08:00
2018-01-17 15:25:50 +01:00
2018-01-08 08:22:45 -06:00
2017-12-14 16:00:49 -08:00
2017-11-15 18:21:06 -08:00
2018-01-31 17:18:37 -08:00
2017-11-09 10:23:28 +01:00
2018-04-06 18:31:06 -07:00
2018-04-06 18:31:06 -07:00
2018-01-19 16:50:53 -08:00
2017-11-17 16:10:04 -08:00
2017-11-17 16:10:04 -08:00
2017-11-13 01:33:48 +01:00
2017-12-16 02:05:48 +01:00
2018-02-20 16:12:26 -08:00
2017-12-11 14:37:11 -07:00
2018-03-17 14:20:55 +01:00
2018-03-01 08:33:05 -07:00
2017-11-07 12:22:21 +01:00
2018-04-05 14:27:02 -07:00
2018-01-29 12:02:54 -05:00
2018-04-05 21:36:24 -07:00
2018-04-05 21:36:27 -07:00
2018-01-18 11:56:49 +01:00
2018-01-15 12:07:46 -08:00
2018-02-06 09:59:40 -08:00
2018-02-06 18:32:47 -08:00
2018-01-09 16:27:43 +01:00
2018-04-10 11:27:30 -07:00
2018-02-20 16:10:25 -08:00
2017-10-11 22:36:54 -04:00
2018-02-06 18:32:44 -08:00
2017-12-20 09:53:54 -07:00
2017-10-04 10:29:22 +02:00