lkml.org 
[lkml]   [2023]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v1 5/5] rust: file: add `DeferredFdCloser`
From
On 7/20/23 12:28, Alice Ryhl wrote:
> This adds a new type called `DeferredFdCloser` that can be used to close
> files by their fd in a way that is safe even if the file is currently
> held using `fdget`.
>
> This is done by grabbing an extra refcount to the file and dropping it
> in a task work once we return to userspace.
>
> See comments on `binder_do_fd_close` and commit `80cd795630d65` for
> motivation.

Please provide links, at least for the doc comment.

>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> [...]
>
> +/// Helper used for closing file descriptors in a way that is safe even if the file is currently
> +/// held using `fdget`.
> +///
> +/// See comments on `binder_do_fd_close` and commit `80cd795630d65`.

Ditto.

> +pub struct DeferredFdCloser {
> + inner: Box<DeferredFdCloserInner>,
> +}
> +
> [...]

\
 
 \ /
  Last update: 2023-08-09 06:35    [W:0.071 / U:2.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site