mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
XArray: Regularise xa_reserve
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 <willy@infradead.org>
This commit is contained in:
@@ -373,6 +373,12 @@ static noinline void check_reserve(struct xarray *xa)
|
||||
xa_erase_index(xa, 12345678);
|
||||
XA_BUG_ON(xa, !xa_empty(xa));
|
||||
|
||||
/* And so does xa_insert */
|
||||
xa_reserve(xa, 12345678, GFP_KERNEL);
|
||||
XA_BUG_ON(xa, xa_insert(xa, 12345678, xa_mk_value(12345678), 0) != 0);
|
||||
xa_erase_index(xa, 12345678);
|
||||
XA_BUG_ON(xa, !xa_empty(xa));
|
||||
|
||||
/* Can iterate through a reserved entry */
|
||||
xa_store_index(xa, 5, GFP_KERNEL);
|
||||
xa_reserve(xa, 6, GFP_KERNEL);
|
||||
|
Reference in New Issue
Block a user