]> www.infradead.org Git - users/willy/xarray.git/log
users/willy/xarray.git
5 years agomm: Microoptimise truncate xarray calls xarray-conv
Matthew Wilcox [Tue, 12 Mar 2019 18:52:01 +0000 (14:52 -0400)]
mm: Microoptimise truncate xarray calls

By passing the xa_state to __clear_shadow_entry(), we can set up the
xa_state once per batch instead of once per shadow entry.  This only
has a tiny effect on Jan's benchmark, but it has no downside.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agocoresight: Convert etr_bufs to XArray
Matthew Wilcox (Oracle) [Wed, 7 Aug 2019 12:48:51 +0000 (08:48 -0400)]
coresight: Convert etr_bufs to XArray

Use an XArray instead of an IDR to hold the etr_bufs.  The cmpxchg
operator leads to simpler code than the prior allocation code.  We don't
need the mutex any more as the XArray contains its own spinlock to
protect against simultaneous modifications.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
5 years agoxilinx_sdfec: Convert to IDA
Matthew Wilcox (Oracle) [Wed, 7 Aug 2019 01:54:02 +0000 (21:54 -0400)]
xilinx_sdfec: Convert to IDA

This driver does not use the lookup abilities of the IDR, so convert it
to the more space-efficient IDA.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
5 years agofastrpc: Convert ctxt_idr to XArray
Matthew Wilcox [Fri, 15 Mar 2019 12:50:56 +0000 (08:50 -0400)]
fastrpc: Convert ctxt_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agohabanalabs: Convert phys_pg_pack_handles to XArray
Matthew Wilcox [Fri, 15 Mar 2019 12:37:16 +0000 (08:37 -0400)]
habanalabs: Convert phys_pg_pack_handles to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agohabanalabs: Convert ctx_handles to XArray
Matthew Wilcox [Fri, 15 Mar 2019 12:21:44 +0000 (08:21 -0400)]
habanalabs: Convert ctx_handles to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agohabanalabs: Convert cb_handles to XArray
Matthew Wilcox [Fri, 15 Mar 2019 12:15:52 +0000 (08:15 -0400)]
habanalabs: Convert cb_handles to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agohabanalabs: Convert hl_devs_idr to XArray
Matthew Wilcox [Fri, 15 Mar 2019 03:06:24 +0000 (23:06 -0400)]
habanalabs: Convert hl_devs_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomps2-uart: Convert ports_idr to XArray
Matthew Wilcox [Thu, 14 Mar 2019 22:33:15 +0000 (18:33 -0400)]
mps2-uart: Convert ports_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agointerconnect: Convert icc_idr to XArray
Matthew Wilcox [Thu, 14 Mar 2019 22:11:57 +0000 (18:11 -0400)]
interconnect: Convert icc_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoXArray: Remove xa_reserve & xa_release
Matthew Wilcox [Tue, 12 Mar 2019 18:56:00 +0000 (14:56 -0400)]
XArray: Remove xa_reserve & xa_release

These turned out not to be needed.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix-tree, idr: Remove IDR
Matthew Wilcox [Tue, 19 Feb 2019 03:38:55 +0000 (22:38 -0500)]
radix-tree, idr: Remove IDR

All users are gone.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomtty: Remove unused IDR
Matthew Wilcox [Tue, 19 Feb 2019 00:30:28 +0000 (19:30 -0500)]
mtty: Remove unused IDR

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agochtls: Remove unused IDRs
Matthew Wilcox [Tue, 19 Feb 2019 00:28:59 +0000 (19:28 -0500)]
chtls: Remove unused IDRs

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agovfio: Convert group_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 23:59:04 +0000 (18:59 -0500)]
vfio: Convert group_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agouio: Convert uio_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:47:01 +0000 (17:47 -0500)]
uio: Convert uio_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agooptee: Convert supp to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:43:00 +0000 (17:43 -0500)]
optee: Convert supp to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agobcm2835-camera: Convert context_map to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:36:36 +0000 (17:36 -0500)]
bcm2835-camera: Convert context_map to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopi433: Convert pi433_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:29:10 +0000 (17:29 -0500)]
pi433: Convert pi433_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agogreybus: Convert uart tty_minors to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:21:05 +0000 (17:21 -0500)]
greybus: Convert uart tty_minors to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agospi: Convert spi_master_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:17:56 +0000 (17:17 -0500)]
spi: Convert spi_master_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agosoc/qcom: Convert svcs_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 22:08:02 +0000 (17:08 -0500)]
soc/qcom: Convert svcs_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agorpmsg: Convert endpoints to XArray
Matthew Wilcox [Mon, 18 Feb 2019 21:56:39 +0000 (16:56 -0500)]
rpmsg: Convert endpoints to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoreset: Convert reset-ti-sci to XArray
Matthew Wilcox [Mon, 18 Feb 2019 21:49:49 +0000 (16:49 -0500)]
reset: Convert reset-ti-sci to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoremoteproc: Convert notifyids to XArray
Matthew Wilcox [Mon, 18 Feb 2019 21:43:36 +0000 (16:43 -0500)]
remoteproc: Convert notifyids to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopps: Convert pps_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 21:29:20 +0000 (16:29 -0500)]
pps: Convert pps_idr to XArray

The pps_idr_lock mutex is unnecessary thanks to the included xa_lock.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopowercap: Convert IDRs to IDAs
Matthew Wilcox [Mon, 18 Feb 2019 21:23:11 +0000 (16:23 -0500)]
powercap: Convert IDRs to IDAs

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopower: Convert ds2782_battery to IDA
Matthew Wilcox [Mon, 18 Feb 2019 21:16:25 +0000 (16:16 -0500)]
power: Convert ds2782_battery to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopower: Convert bq27xxx_battery to IDA
Matthew Wilcox [Mon, 18 Feb 2019 21:15:02 +0000 (16:15 -0500)]
power: Convert bq27xxx_battery to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopower: Convert bq2415x_charger to IDA
Matthew Wilcox [Mon, 18 Feb 2019 21:13:37 +0000 (16:13 -0500)]
power: Convert bq2415x_charger to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopci: Convert endpoint functions_idr to IDA
Matthew Wilcox [Mon, 18 Feb 2019 21:11:16 +0000 (16:11 -0500)]
pci: Convert endpoint functions_idr to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoof: Convert ovcs_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 21:09:14 +0000 (16:09 -0500)]
of: Convert ovcs_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoubiblock: Convert ubiblock_minor_idr to IDA
Matthew Wilcox [Mon, 18 Feb 2019 20:30:42 +0000 (15:30 -0500)]
ubiblock: Convert ubiblock_minor_idr to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomtdcore: Convert mtd_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 20:27:48 +0000 (15:27 -0500)]
mtdcore: Convert mtd_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoscif: Convert scif_ports to XArray
Matthew Wilcox [Mon, 18 Feb 2019 19:23:02 +0000 (14:23 -0500)]
scif: Convert scif_ports to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomei: Convert mei_idr to IDA
Matthew Wilcox [Mon, 18 Feb 2019 19:08:36 +0000 (14:08 -0500)]
mei: Convert mei_idr to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoi3c: Convert i3c_bus_idr to IDA
Matthew Wilcox [Mon, 18 Feb 2019 18:41:32 +0000 (13:41 -0500)]
i3c: Convert i3c_bus_idr to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoi2c: Convert i2c_adapter_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 18:39:27 +0000 (13:39 -0500)]
i2c: Convert i2c_adapter_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoevents: Convert pmu_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 15:08:06 +0000 (10:08 -0500)]
events: Convert pmu_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoworkqueue: Convert to XArray
Matthew Wilcox [Mon, 18 Feb 2019 14:58:53 +0000 (09:58 -0500)]
workqueue: Convert to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoac97: Convert ac97_adapter_idr to XArray
Matthew Wilcox [Mon, 18 Feb 2019 14:49:21 +0000 (09:49 -0500)]
ac97: Convert ac97_adapter_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agofpga: Convert dfl idrs to IDA
Matthew Wilcox [Sat, 16 Feb 2019 02:28:08 +0000 (21:28 -0500)]
fpga: Convert dfl idrs to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agofirewire: Convert firewire_idr to XArray
Matthew Wilcox [Fri, 15 Feb 2019 22:39:57 +0000 (17:39 -0500)]
firewire: Convert firewire_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agonicstar: Convert to XArray
Matthew Wilcox [Fri, 15 Feb 2019 21:01:15 +0000 (16:01 -0500)]
nicstar: Convert to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoarm_scmi: Convert scmi_protocols to XArray
Matthew Wilcox [Fri, 15 Feb 2019 20:38:03 +0000 (15:38 -0500)]
arm_scmi: Convert scmi_protocols to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoidr: Handle integer overflow correctly
Matthew Wilcox [Fri, 15 Feb 2019 20:08:36 +0000 (15:08 -0500)]
idr: Handle integer overflow correctly

If there is an entry at INT_MAX then idr_for_each_entry() will increment
id after handling it.  This is undefined behaviour, and is caught by
UBSAN.  Adding 1U to id forces the operation to be carried out as an
unsigned addition which (when assigned to id) will result in INT_MIN.
Since there is never an entry stored at INT_MIN, idr_get_next() will
return NULL, ending the loop as expected.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoRemove idr_for_each()
Matthew Wilcox [Fri, 15 Feb 2019 19:54:00 +0000 (14:54 -0500)]
Remove idr_for_each()

With no more users remaining, delete the function.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoarm_scmi: Convert tx_idr to XArray
Matthew Wilcox [Fri, 15 Feb 2019 18:42:08 +0000 (13:42 -0500)]
arm_scmi: Convert tx_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agotarget_core_user: Convert comamnds IDR to XArray
Matthew Wilcox [Fri, 15 Feb 2019 14:56:21 +0000 (09:56 -0500)]
target_core_user: Convert comamnds IDR to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoRemove idr_preload
Matthew Wilcox [Fri, 15 Feb 2019 13:16:26 +0000 (08:16 -0500)]
Remove idr_preload

With all users gone, we can delete the implementation and various pieces
of infrastructure that it used.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agovisorhba: Convert to XArray
Matthew Wilcox [Fri, 15 Feb 2019 13:06:23 +0000 (08:06 -0500)]
visorhba: Convert to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoidr: Remove idr_replace()
Matthew Wilcox [Thu, 14 Feb 2019 21:46:47 +0000 (16:46 -0500)]
idr: Remove idr_replace()

All users are now converted.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agotifm: Convert to IDA
Matthew Wilcox [Tue, 12 Feb 2019 21:20:07 +0000 (16:20 -0500)]
tifm: Convert to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agocxl: Convert adapter_idr to XArray
Matthew Wilcox [Tue, 12 Feb 2019 21:17:48 +0000 (16:17 -0500)]
cxl: Convert adapter_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agocxl: Convert contexts_idr to XArray
Matthew Wilcox [Tue, 12 Feb 2019 21:11:40 +0000 (16:11 -0500)]
cxl: Convert contexts_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agortsx_pcr: Convert to IDA
Matthew Wilcox [Tue, 12 Feb 2019 18:48:38 +0000 (13:48 -0500)]
rtsx_pcr: Convert to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoirq: Convert timings to XArray
Matthew Wilcox [Tue, 12 Feb 2019 14:36:36 +0000 (09:36 -0500)]
irq: Convert timings to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agotpm: Convert dev_nums to XArray
Matthew Wilcox [Tue, 12 Feb 2019 13:47:51 +0000 (08:47 -0500)]
tpm: Convert dev_nums to XArray

Also fix a couple of memory leaks on allocation failure.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agovmscan: Convert shrinker_idr to XArray
Matthew Wilcox [Tue, 12 Feb 2019 13:35:25 +0000 (08:35 -0500)]
vmscan: Convert shrinker_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomemcontrol: Convert mem_cgroup IDR to XArray
Matthew Wilcox [Tue, 12 Feb 2019 04:19:18 +0000 (23:19 -0500)]
memcontrol: Convert mem_cgroup IDR to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoc2port: Convert IDR to IDA
Matthew Wilcox [Mon, 11 Feb 2019 21:56:34 +0000 (16:56 -0500)]
c2port: Convert IDR to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agotee: Convert shm IDR to XArray
Matthew Wilcox [Mon, 11 Feb 2019 21:38:45 +0000 (16:38 -0500)]
tee: Convert shm IDR to XArray

Also remove the unused shm_list

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomspro_block: Convert disks IDR to IDA
Matthew Wilcox [Mon, 11 Feb 2019 21:13:59 +0000 (16:13 -0500)]
mspro_block: Convert disks IDR to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoms_block: Convert disk IDR to IDA
Matthew Wilcox [Mon, 11 Feb 2019 21:12:20 +0000 (16:12 -0500)]
ms_block: Convert disk IDR to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agomemstick: Convert host IDR to IDA
Matthew Wilcox [Mon, 11 Feb 2019 21:09:07 +0000 (16:09 -0500)]
memstick: Convert host IDR to IDA

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoiscsi_target: Convert g_tiqn_list and tiqn_idr to XArray
Matthew Wilcox [Mon, 11 Feb 2019 21:04:04 +0000 (16:04 -0500)]
iscsi_target: Convert g_tiqn_list and tiqn_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoiommu: Convert intel_pasid to XArray
Matthew Wilcox [Mon, 11 Feb 2019 20:42:19 +0000 (15:42 -0500)]
iommu: Convert intel_pasid to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoidr: Remove idr_alloc_u32
Matthew Wilcox [Sun, 10 Feb 2019 04:14:03 +0000 (23:14 -0500)]
idr: Remove idr_alloc_u32

The last user is now gone, so remove the export of this function.
It reamins as a static function as it is used by idr_alloc(), and it's not
worth simplifying the source code since idr_alloc should be removed soon.
Also remove idr_get_next_ul() and idr_for_each_entry_ul().

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoapparmor: Convert aa_secids to XArray
Matthew Wilcox [Thu, 7 Feb 2019 13:33:47 +0000 (08:33 -0500)]
apparmor: Convert aa_secids to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoIDR: Remove idr_alloc_cyclic
Matthew Wilcox [Wed, 16 Jan 2019 19:31:52 +0000 (14:31 -0500)]
IDR: Remove idr_alloc_cyclic

With all users now converted to XArray, remove this API.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agobpf: Convert map & prog IDRs to XArray
Matthew Wilcox [Wed, 16 Jan 2019 19:24:15 +0000 (14:24 -0500)]
bpf: Convert map & prog IDRs to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agobpf: Convert btf_idr to XArray
Matthew Wilcox [Fri, 11 Jan 2019 20:41:39 +0000 (15:41 -0500)]
bpf: Convert btf_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agotarget: Convert devices_idr to XArray
Matthew Wilcox [Wed, 9 Jan 2019 13:34:37 +0000 (08:34 -0500)]
target: Convert devices_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agosoc: qcom: Convert txns to XArray
Matthew Wilcox [Tue, 8 Jan 2019 20:31:13 +0000 (15:31 -0500)]
soc: qcom: Convert txns to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoslimbus: Convert tid_idr to XArray
Matthew Wilcox [Tue, 8 Jan 2019 20:16:04 +0000 (15:16 -0500)]
slimbus: Convert tid_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agorpmsg: Convert riids to XArray
Matthew Wilcox [Tue, 8 Jan 2019 18:38:28 +0000 (13:38 -0500)]
rpmsg: Convert riids to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agorpmsg; Convert liids to XArray
Matthew Wilcox [Tue, 8 Jan 2019 17:50:33 +0000 (12:50 -0500)]
rpmsg; Convert liids to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agorpmsg: Convert rcids to XArray
Matthew Wilcox [Tue, 8 Jan 2019 17:20:22 +0000 (12:20 -0500)]
rpmsg: Convert rcids to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agorpmsg: Convert lcids to XArray
Matthew Wilcox [Tue, 8 Jan 2019 17:07:21 +0000 (12:07 -0500)]
rpmsg: Convert lcids to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agorapidio: Convert ch_idr to XArray
Matthew Wilcox [Tue, 8 Jan 2019 15:05:31 +0000 (10:05 -0500)]
rapidio: Convert ch_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agox86,hyperv: Convert conn_to_evt to XArray
Matthew Wilcox [Sun, 6 Jan 2019 20:23:54 +0000 (15:23 -0500)]
x86,hyperv: Convert conn_to_evt to XArray

This IDR wasn't being used to allocate IDs, just as somewhere to store
pointers.  It moves out from under the protection of the mutex to its
own spinlock.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoscsi: Convert same_target_siblings to XArray
Matthew Wilcox [Thu, 15 Nov 2018 07:02:19 +0000 (02:02 -0500)]
scsi: Convert same_target_siblings to XArray

Generally each target has only one LUN, so the target will have a direct
pointer to the sdev.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agofirewire: Convert resource_idr to XArray
Matthew Wilcox [Sat, 3 Nov 2018 12:57:46 +0000 (08:57 -0400)]
firewire: Convert resource_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agodca: Convert dca_idr to IDA
Matthew Wilcox [Sat, 3 Nov 2018 03:17:29 +0000 (23:17 -0400)]
dca: Convert dca_idr to IDA

The DCA code never looks up the pointer it stores in the IDR, so it
can use the IDA which is more efficient and easier to use.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agodm: Convert _minor_idr to XArray
Matthew Wilcox [Fri, 2 Nov 2018 03:26:21 +0000 (23:26 -0400)]
dm: Convert _minor_idr to XArray

Drop the use of the custom MINOR_ALLOCATED define in favour of using the
ability to allocate an index for a NULL pointer.  Rename the structure
to dm_minors.

It's probably possible to replace the _minor_lock with the xa_lock, but
it might be better to separate out the multiple things which are being
protected.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agocgroup: Convert cgroup_hierarchy to XArray
Matthew Wilcox [Wed, 9 Jan 2019 18:31:15 +0000 (13:31 -0500)]
cgroup: Convert cgroup_hierarchy to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agocgroup: Convert css_idr to XArray
Matthew Wilcox [Sat, 3 Nov 2018 12:23:42 +0000 (08:23 -0400)]
cgroup: Convert css_idr to XArray

Remove the internal wrappers as the XArray behaves exactly how the
cgroup code wishes the IDR did.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agocgroup: Convert cgroup_idr to XArray
Matthew Wilcox [Sat, 27 Oct 2018 03:24:58 +0000 (23:24 -0400)]
cgroup: Convert cgroup_idr to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoipc: Convert ipcs_idr to XArray
Matthew Wilcox (Oracle) [Sun, 4 Aug 2019 11:20:30 +0000 (07:20 -0400)]
ipc: Convert ipcs_idr to XArray

The XArray has better loops than the IDR has, removing the need to
open-code them.  We also don't need to call idr_destroy() any more.
Allocating the ID is a little tricky due to needing to get 'seq'
correct.  Open-code a variant of __xa_alloc() which lets us set the
ID and the seq before depositing the pointer in the array.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix tree: Remove more unused functions
Matthew Wilcox [Mon, 29 Oct 2018 16:44:30 +0000 (12:44 -0400)]
radix tree: Remove more unused functions

radix_tree_insert, radix_tree_delete, radix_tree_tag_set and
radix_tree_tag_clear are all now unused.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix tree: Remove unused iteration code
Matthew Wilcox [Mon, 29 Oct 2018 16:26:24 +0000 (12:26 -0400)]
radix tree: Remove unused iteration code

The ability to iterate over tags or iterate contiguously,
radix_tree_iter_delete(), radix_tree_iter_resume(),
radix_tree_iter_retry() and radix_tree_iter_lookup() are all now unused.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix tree: Remove radix_tree_{insert,replace}_slot
Matthew Wilcox [Mon, 29 Oct 2018 16:10:21 +0000 (12:10 -0400)]
radix tree: Remove radix_tree_{insert,replace}_slot

Now unused.  Also radix_tree_deref_slot, radix_tree_deref_slot_protected,
radix_tree_deref_retry and radix_tree_exception.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix tree: Remove radix_tree_gang_lookup*
Matthew Wilcox [Mon, 29 Oct 2018 16:04:06 +0000 (12:04 -0400)]
radix tree: Remove radix_tree_gang_lookup*

Users of these functions have all been converted to use xa_extract().

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoXArray: Remove radix tree compatibility
Matthew Wilcox [Mon, 17 Dec 2018 23:05:18 +0000 (18:05 -0500)]
XArray: Remove radix tree compatibility

The xa_flags field in the XArray was compatible with the radix tree
in order to make conversion easier.  With the page cache converted,
all future conversions will be done one data structure at a time, so
there is no more need for this compatibility.  This reduces the header
dependencies of the XArray to not require gfp.h, which would otherwise
introduce a header loop in a later patch.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix tree test suite: Convert to XArray
Matthew Wilcox [Mon, 29 Oct 2018 15:20:35 +0000 (11:20 -0400)]
radix tree test suite: Convert to XArray

With only the IDR remaining as a user of the radix tree API, convert
the non-IDR pieces of the radix tree test suite to the XArray API.

5 years agoradix tree test suite: Convert regression4 to XArray
Matthew Wilcox [Fri, 14 Dec 2018 19:36:47 +0000 (14:36 -0500)]
radix tree test suite: Convert regression4 to XArray

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agoradix tree test suite: Convert regression3 to XArray
Matthew Wilcox [Fri, 26 Oct 2018 03:22:20 +0000 (23:22 -0400)]
radix tree test suite: Convert regression3 to XArray

Move the test to the in-kernel test suite

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopinctrl: Convert pin_desc_tree to XArray
Matthew Wilcox [Thu, 25 Oct 2018 20:50:34 +0000 (16:50 -0400)]
pinctrl: Convert pin_desc_tree to XArray

Straightforward conversion; no locking changes.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopinctrl: Convert pin_function_tree to XArray
Matthew Wilcox [Thu, 25 Oct 2018 20:42:48 +0000 (16:42 -0400)]
pinctrl: Convert pin_function_tree to XArray

Straightforward conversion; no locking changes.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
5 years agopinctrl: Convert pin_group_tree to XArray
Matthew Wilcox [Thu, 25 Oct 2018 20:36:55 +0000 (16:36 -0400)]
pinctrl: Convert pin_group_tree to XArray

Straightforward conversion; no locking changes.

Signed-off-by: Matthew Wilcox <willy@infradead.org>