mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
XArray: Turn xa_erase into an exported function
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 <willy@infradead.org>
This commit is contained in:
parent
c5beb07e7a
commit
9c16bb8890
2 changed files with 25 additions and 17 deletions
24
lib/xarray.c
24
lib/xarray.c
|
@ -1336,6 +1336,30 @@ void *__xa_erase(struct xarray *xa, unsigned long index)
|
|||
}
|
||||
EXPORT_SYMBOL(__xa_erase);
|
||||
|
||||
/**
|
||||
* xa_erase() - Erase this entry from the XArray.
|
||||
* @xa: XArray.
|
||||
* @index: Index of entry.
|
||||
*
|
||||
* This function is the equivalent of calling xa_store() with %NULL as
|
||||
* the third argument. The XArray does not need to allocate memory, so
|
||||
* the user does not need to provide GFP flags.
|
||||
*
|
||||
* Context: Any context. Takes and releases the xa_lock.
|
||||
* Return: The entry which used to be at this index.
|
||||
*/
|
||||
void *xa_erase(struct xarray *xa, unsigned long index)
|
||||
{
|
||||
void *entry;
|
||||
|
||||
xa_lock(xa);
|
||||
entry = __xa_erase(xa, index);
|
||||
xa_unlock(xa);
|
||||
|
||||
return entry;
|
||||
}
|
||||
EXPORT_SYMBOL(xa_erase);
|
||||
|
||||
/**
|
||||
* xa_store() - Store this entry in the XArray.
|
||||
* @xa: XArray.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue