mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
XArray: Add xa_limit_16b
A 16-bit limit is a more common limit than I had realised. Make it generally available. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This commit is contained in:
parent
3012110d71
commit
df59d0a461
1 changed files with 3 additions and 1 deletions
|
@ -229,9 +229,10 @@ static inline int xa_err(void *entry)
|
||||||
*
|
*
|
||||||
* This structure is used either directly or via the XA_LIMIT() macro
|
* This structure is used either directly or via the XA_LIMIT() macro
|
||||||
* to communicate the range of IDs that are valid for allocation.
|
* to communicate the range of IDs that are valid for allocation.
|
||||||
* Two common ranges are predefined for you:
|
* Three common ranges are predefined for you:
|
||||||
* * xa_limit_32b - [0 - UINT_MAX]
|
* * xa_limit_32b - [0 - UINT_MAX]
|
||||||
* * xa_limit_31b - [0 - INT_MAX]
|
* * xa_limit_31b - [0 - INT_MAX]
|
||||||
|
* * xa_limit_16b - [0 - USHRT_MAX]
|
||||||
*/
|
*/
|
||||||
struct xa_limit {
|
struct xa_limit {
|
||||||
u32 max;
|
u32 max;
|
||||||
|
@ -242,6 +243,7 @@ struct xa_limit {
|
||||||
|
|
||||||
#define xa_limit_32b XA_LIMIT(0, UINT_MAX)
|
#define xa_limit_32b XA_LIMIT(0, UINT_MAX)
|
||||||
#define xa_limit_31b XA_LIMIT(0, INT_MAX)
|
#define xa_limit_31b XA_LIMIT(0, INT_MAX)
|
||||||
|
#define xa_limit_16b XA_LIMIT(0, USHRT_MAX)
|
||||||
|
|
||||||
typedef unsigned __bitwise xa_mark_t;
|
typedef unsigned __bitwise xa_mark_t;
|
||||||
#define XA_MARK_0 ((__force xa_mark_t)0U)
|
#define XA_MARK_0 ((__force xa_mark_t)0U)
|
||||||
|
|
Loading…
Reference in a new issue