Skip to content
Snippets Groups Projects
user avatar
Matthew Wilcox authored
A lot of places want to allocate IDs starting at 1 instead of 0.
While the xa_alloc() API supports this, it's not very efficient if lots
of IDs are allocated, due to having to walk down to the bottom of the
tree to see if ID 1 is available, then all the way over to the next
non-allocated ID.  This method marks ID 0 as being occupied which wastes
one slot in the XArray, but preserves xa_empty() as working.

Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
3ccaf57a
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.