summaryrefslogtreecommitdiffstats
path: root/include/linux/xarray.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/xarray.h')
-rw-r--r--include/linux/xarray.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/include/linux/xarray.h b/include/linux/xarray.h
index 588733abd19d..0e01e6129145 100644
--- a/include/linux/xarray.h
+++ b/include/linux/xarray.h
@@ -525,7 +525,6 @@ int __must_check __xa_alloc(struct xarray *, u32 *id, void *entry,
525 struct xa_limit, gfp_t); 525 struct xa_limit, gfp_t);
526int __must_check __xa_alloc_cyclic(struct xarray *, u32 *id, void *entry, 526int __must_check __xa_alloc_cyclic(struct xarray *, u32 *id, void *entry,
527 struct xa_limit, u32 *next, gfp_t); 527 struct xa_limit, u32 *next, gfp_t);
528int __must_check __xa_reserve(struct xarray *, unsigned long index, gfp_t);
529void __xa_set_mark(struct xarray *, unsigned long index, xa_mark_t); 528void __xa_set_mark(struct xarray *, unsigned long index, xa_mark_t);
530void __xa_clear_mark(struct xarray *, unsigned long index, xa_mark_t); 529void __xa_clear_mark(struct xarray *, unsigned long index, xa_mark_t);
531 530
@@ -1004,13 +1003,7 @@ static inline int xa_alloc_cyclic_irq(struct xarray *xa, u32 *id, void *entry,
1004static inline __must_check 1003static inline __must_check
1005int xa_reserve(struct xarray *xa, unsigned long index, gfp_t gfp) 1004int xa_reserve(struct xarray *xa, unsigned long index, gfp_t gfp)
1006{ 1005{
1007 int ret; 1006 return xa_err(xa_cmpxchg(xa, index, NULL, XA_ZERO_ENTRY, gfp));
1008
1009 xa_lock(xa);
1010 ret = __xa_reserve(xa, index, gfp);
1011 xa_unlock(xa);
1012
1013 return ret;
1014} 1007}
1015 1008
1016/** 1009/**
@@ -1028,13 +1021,7 @@ int xa_reserve(struct xarray *xa, unsigned long index, gfp_t gfp)
1028static inline __must_check 1021static inline __must_check
1029int xa_reserve_bh(struct xarray *xa, unsigned long index, gfp_t gfp) 1022int xa_reserve_bh(struct xarray *xa, unsigned long index, gfp_t gfp)
1030{ 1023{
1031 int ret; 1024 return xa_err(xa_cmpxchg_bh(xa, index, NULL, XA_ZERO_ENTRY, gfp));
1032
1033 xa_lock_bh(xa);
1034 ret = __xa_reserve(xa, index, gfp);
1035 xa_unlock_bh(xa);
1036
1037 return ret;
1038} 1025}
1039 1026
1040/** 1027/**
@@ -1052,13 +1039,7 @@ int xa_reserve_bh(struct xarray *xa, unsigned long index, gfp_t gfp)
1052static inline __must_check 1039static inline __must_check
1053int xa_reserve_irq(struct xarray *xa, unsigned long index, gfp_t gfp) 1040int xa_reserve_irq(struct xarray *xa, unsigned long index, gfp_t gfp)
1054{ 1041{
1055 int ret; 1042 return xa_err(xa_cmpxchg_irq(xa, index, NULL, XA_ZERO_ENTRY, gfp));
1056
1057 xa_lock_irq(xa);
1058 ret = __xa_reserve(xa, index, gfp);
1059 xa_unlock_irq(xa);
1060
1061 return ret;
1062} 1043}
1063 1044
1064/** 1045/**