Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -1
+3 -1
include/linux/xarray.h
··· 229 229 * 230 230 * This structure is used either directly or via the XA_LIMIT() macro 231 231 * to communicate the range of IDs that are valid for allocation. 232 - * Two common ranges are predefined for you: 232 + * Three common ranges are predefined for you: 233 233 * * xa_limit_32b - [0 - UINT_MAX] 234 234 * * xa_limit_31b - [0 - INT_MAX] 235 + * * xa_limit_16b - [0 - USHRT_MAX] 235 236 */ 236 237 struct xa_limit { 237 238 u32 max; ··· 243 242 244 243 #define xa_limit_32b XA_LIMIT(0, UINT_MAX) 245 244 #define xa_limit_31b XA_LIMIT(0, INT_MAX) 245 + #define xa_limit_16b XA_LIMIT(0, USHRT_MAX) 246 246 247 247 typedef unsigned __bitwise xa_mark_t; 248 248 #define XA_MARK_0 ((__force xa_mark_t)0U)