XArray: Add xa_limit_16b
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 30 Mar 2021 17:40:27 +0000 (13:40 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 30 Mar 2021 17:42:33 +0000 (13:42 -0400)
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>
include/linux/xarray.h

index 92c0160b3352314fa2d5dbdff241cf24f3706ecf..a91e3d90df8a540daebcd0b9149bf98de2e9ec7f 100644 (file)
@@ -229,9 +229,10 @@ static inline int xa_err(void *entry)
  *
  * This structure is used either directly or via the XA_LIMIT() macro
  * 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_31b      - [0 - INT_MAX]
+ * * xa_limit_16b      - [0 - USHRT_MAX]
  */
 struct xa_limit {
        u32 max;
@@ -242,6 +243,7 @@ struct xa_limit {
 
 #define xa_limit_32b   XA_LIMIT(0, UINT_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;
 #define XA_MARK_0              ((__force xa_mark_t)0U)