Lines Matching full:refcount

128 /// Whenever a process has an fd to a file, it may use something called a "light refcount" as a
131 /// `fdget` and `fdput`, then the refcount cannot hit zero during that time, as the `struct
133 /// file even if `fdget` does not increment the refcount.
135 /// The requirement that the fd is not closed during a light refcount applies globally across all
136 /// threads - not just on the thread using the light refcount. For this reason, light refcounts are
139 /// calling `fdget` on a shared `struct files_struct` creates a normal refcount instead of a light
140 /// refcount.
153 /// `fdget`. With `fdget`, you may avoid incrementing the refcount as long as the current fd table
199 // makes `ARef<File>` own a normal refcount.
203 // SAFETY: The existence of a shared reference means that the refcount is nonzero. in inc_ref()
209 // SAFETY: To call this method, the caller passes us ownership of a normal refcount, so we in dec_ref()
235 // makes `ARef<LocalFile>` own a normal refcount.
239 // SAFETY: The existence of a shared reference means that the refcount is nonzero. in inc_ref()
245 // SAFETY: To call this method, the caller passes us ownership of a normal refcount, so we in dec_ref()
266 // SAFETY: `bindings::fget` created a refcount, and we pass ownership of it to the `ARef`. in fget()
278 /// * The caller must ensure that `ptr` points at a valid file and that the file's refcount is
340 // SAFETY: The file is valid because the shared reference guarantees a nonzero refcount. in flags()
352 /// * The caller must ensure that `ptr` points at a valid file and that the file's refcount is
432 // Furthermore, the file pointer is guaranteed to own a refcount by its type invariants, in fd_install()
433 // and we take ownership of that refcount by not running the destructor below. in fd_install()