]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pidfs: implement file handle support
authorChristian Brauner <brauner@kernel.org>
Fri, 29 Nov 2024 13:38:05 +0000 (14:38 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 17 Dec 2024 08:16:17 +0000 (09:16 +0100)
commitb3caba8f7a34a2bbaf45ffc6ff3a49b70afeb192
tree292d86daacf8cb64d8bf4374a5cc2e8659dd8a3f
parentc220e216d6bcd52cc7333e38edf43dc66ba0dd13
pidfs: implement file handle support

On 64-bit platforms, userspace can read the pidfd's inode in order to
get a never-repeated PID identifier. On 32-bit platforms this identifier
is not exposed, as inodes are limited to 32 bits. Instead expose the
identifier via export_fh, which makes it available to userspace via
name_to_handle_at.

In addition we implement fh_to_dentry, which allows userspace to
recover a pidfd from a pidfs file handle.

Signed-off-by: Erin Shepherd <erin.shepherd@e43.eu>
[brauner: patch heavily rewritten]
Link: https://lore.kernel.org/r/20241129-work-pidfs-file_handle-v1-6-87d803a42495@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Co-Developed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/pidfs.c