Lines Matching full:entry
16 /// Owning handle to a DebugFS entry.
21 pub(crate) struct Entry<'a> {
22 entry: *mut bindings::dentry,
24 _parent: Option<Arc<Entry<'static>>>,
29 // SAFETY: [`Entry`] is just a `dentry` under the hood, which the API promises can be transferred
31 unsafe impl Send for Entry<'_> {}
34 unsafe impl Sync for Entry<'_> {}
36 impl Entry<'static> {
39 Some(entry) => entry.as_ptr(),
46 let entry = unsafe { bindings::debugfs_create_dir(name.as_char_ptr(), parent_ptr) };
48 Entry {
49 entry,
57 /// * `data` must outlive the returned `Entry`.
67 // * The caller guarantees that `data` will outlive the returned `Entry`.
70 let entry = unsafe {
81 Entry {
82 entry,
89 impl<'a> Entry<'a> {
90 pub(crate) fn dir(name: &CStr, parent: Option<&'a Entry<'_>>) -> Self {
92 Some(entry) => entry.as_ptr(),
98 // `dentry` (because `parent` is a valid reference to an `Entry`). The lifetime `'a`
99 // ensures that the parent outlives this entry.
100 let entry = unsafe { bindings::debugfs_create_dir(name.as_char_ptr(), parent_ptr) };
102 Entry {
103 entry,
111 parent: &'a Entry<'_>,
117 // * `parent.as_ptr()` is a pointer to a valid `dentry` because we have `&'a Entry`.
119 // * The returned `Entry` has lifetime `'a`, so it cannot outlive `parent` or `data`.
123 let entry = unsafe {
134 Entry {
135 entry,
142 impl Entry<'_> {
143 /// Constructs a placeholder DebugFS [`Entry`].
146 entry: core::ptr::null_mut(),
158 /// long as this entry lives.
160 self.entry
164 impl Drop for Entry<'_> {