linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Miguel Ojeda <ojeda@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>
Cc: "Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Alice Ryhl" <aliceryhl@google.com>,
	linux-kernel@vger.kernel.org, patches@lists.linux.dev
Subject: [RFC PATCH v1 0/5] Various Rust bindings for files
Date: Thu, 20 Jul 2023 15:28:15 +0000	[thread overview]
Message-ID: <20230720152820.3566078-1-aliceryhl@google.com> (raw)

This contains bindings for various file related things that binder needs
to use.

I would especially like feedback on the SAFETY comments. Particularly,
the safety comments in patch 4 and 5 are non-trivial. For example:

 * In patch 4, I claim that passing POLLHUP|POLLFREE to __wake_up is
   enough to ensure that we can now destroy the wait_list without
   risking any use-after-frees, even if we have registered it with
   epoll. Is that correct?

 * In patch 5, I implement a utility for closing fds that might be held
   using `fdget`. This is rather non-trivial, and I would be happy to
   hear suggestions about alternate solutions.

This patch is based on top of
https://lore.kernel.org/all/20230426204923.16195-1-amiculas@cisco.com/
which is currently the top commit on rust-next.

Alice Ryhl (2):
  rust: file: add bindings for `poll_table`
  rust: file: add `DeferredFdCloser`

Wedson Almeida Filho (3):
  rust: file: add bindings for `struct file`
  rust: cred: add Rust bindings for `struct cred`
  rust: file: add `FileDescriptorReservation`

 rust/bindings/bindings_helper.h |   8 +
 rust/bindings/lib.rs            |   1 +
 rust/helpers.c                  |  36 ++++
 rust/kernel/cred.rs             |  66 +++++++
 rust/kernel/file.rs             | 331 ++++++++++++++++++++++++++++++++
 rust/kernel/file/poll_table.rs  |  93 +++++++++
 rust/kernel/lib.rs              |   2 +
 rust/kernel/sync/condvar.rs     |   2 +-
 8 files changed, 538 insertions(+), 1 deletion(-)
 create mode 100644 rust/kernel/cred.rs
 create mode 100644 rust/kernel/file.rs
 create mode 100644 rust/kernel/file/poll_table.rs


base-commit: 341faf2b45ba266d52c1ca886c4ffca52d666786
-- 
2.41.0.255.g8b1d071c50-goog


             reply	other threads:[~2023-07-20 15:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 15:28 Alice Ryhl [this message]
2023-07-20 15:28 ` [RFC PATCH v1 1/5] rust: file: add bindings for `struct file` Alice Ryhl
2023-08-09  2:59   ` Martin Rodriguez Reboredo
2023-07-20 15:28 ` [RFC PATCH v1 2/5] rust: cred: add Rust bindings for `struct cred` Alice Ryhl
2023-07-20 15:28 ` [RFC PATCH v1 3/5] rust: file: add `FileDescriptorReservation` Alice Ryhl
2023-08-09  4:02   ` Martin Rodriguez Reboredo
2023-07-20 15:28 ` [RFC PATCH v1 4/5] rust: file: add bindings for `poll_table` Alice Ryhl
2023-07-20 15:28 ` [RFC PATCH v1 5/5] rust: file: add `DeferredFdCloser` Alice Ryhl
2023-07-20 18:22   ` Miguel Ojeda
2023-08-09  4:33   ` Martin Rodriguez Reboredo
2023-08-09  9:00     ` Miguel Ojeda
2023-08-09  9:09       ` Miguel Ojeda
2023-08-09 20:15         ` Martin Rodriguez Reboredo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230720152820.3566078-1-aliceryhl@google.com \
    --to=aliceryhl@google.com \
    --cc=alex.gaynor@gmail.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=brauner@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wedsonaf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).