OSDN Git Service

XArray tests: Handle larger indices more elegantly
authorMatthew Wilcox <willy@infradead.org>
Mon, 5 Nov 2018 18:19:54 +0000 (13:19 -0500)
committerMatthew Wilcox <willy@infradead.org>
Thu, 6 Dec 2018 14:25:15 +0000 (09:25 -0500)
commitb7677a132a4c2ff877986c5b30f9427127b9897a
treed93228d64009d3398ebdffe20515c7152db0950d
parent55f3f7eab75c10d9b33d122670b5935ab64db50f
XArray tests: Handle larger indices more elegantly

xa_mk_value() only handles values up to LONG_MAX.  I successfully hid
that inside xa_store_index() and xa_erase_index(), but it turned out I
also needed it for testing xa_alloc() on 32-bit machines.  So extract
xa_mk_index() from the above two functions, and convert the non-constant
users of xa_mk_value() to xa_mk_index().

Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/test_xarray.c