Lines Matching defs:xa
23 /// `self.xa` is always an initialized and valid [`bindings::xarray`] whose entries are either
32 /// let xa = KBox::pin_init(XArray::new(AllocKind::Alloc1), GFP_KERNEL)?;
37 /// let mut guard = xa.lock();
58 xa: Opaque<bindings::xarray>,
74 // SAFETY: `self.xa` is always valid by the type invariant.
75 unsafe { bindings::xa_destroy(self.xa.get()) };
95 // SAFETY: `xa` is valid while the closure is called.
97 // INVARIANT: `xa` is initialized here to an empty, valid [`bindings::xarray`].
98 xa <- Opaque::ffi_init(|xa| unsafe {
99 bindings::xa_init_flags(xa, flags)
108 // SAFETY: `self.xa` is always valid by the type invariant.
110 bindings::xa_find(self.xa.get(), &mut index, usize::MAX, bindings::XA_PRESENT)
113 // SAFETY: `self.xa` is always valid by the type invariant.
115 bindings::xa_find_after(self.xa.get(), &mut index, usize::MAX, bindings::XA_PRESENT)
123 // SAFETY: `self.xa` is always valid by the type invariant.
124 if (unsafe { bindings::xa_trylock(self.xa.get()) } != 0) {
126 xa: self,
136 // SAFETY: `self.xa` is always valid by the type invariant.
137 unsafe { bindings::xa_lock(self.xa.get()) };
140 xa: self,
151 xa: &'a XArray<T>,
158 // - `self.xa.xa` is always valid by the type invariant.
160 unsafe { bindings::xa_unlock(self.xa.xa.get()) };
186 // SAFETY: `self.xa.xa` is always valid by the type invariant.
187 let ptr = unsafe { bindings::xa_load(self.xa.xa.get(), index) };
211 // - `self.xa.xa` is always valid by the type invariant.
213 let ptr = unsafe { bindings::__xa_erase(self.xa.xa.get(), index) }.cast();
243 // - `self.xa.xa` is always valid by the type invariant.
247 unsafe { bindings::__xa_store(self.xa.xa.get(), index, new, gfp.as_raw()) }