[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJWu+orzhpO5hPfUWd0EJp-ViWMifeQ_Ng+R4fHf7xabL+Bggw@mail.gmail.com>
Date: Mon, 3 Aug 2020 20:30:59 -0400
From: Joel Fernandes <joelaf@...gle.com>
To: Kalesh Singh <kaleshsingh@...gle.com>
Cc: Jonathan Corbet <corbet@....net>,
Sumit Semwal <sumit.semwal@...aro.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linaro-mm-sig@...ts.linaro.org,
linux-fsdevel@...r.kernel.org,
Suren Baghdasaryan <surenb@...gle.com>,
Hridya Valsaraju <hridya@...gle.com>,
Ioannis Ilkos <ilkos@...gle.com>,
John Stultz <john.stultz@...aro.org>,
"Cc: Android Kernel" <kernel-team@...roid.com>
Subject: Re: [PATCH 1/2] fs: Add fd_install file operation
On Mon, Aug 3, 2020 at 10:47 AM 'Kalesh Singh' via kernel-team
<kernel-team@...roid.com> wrote:
>
> Provides a per process hook for the acquisition of file descriptors,
> despite the method used to obtain the descriptor.
>
Hi,
So apart from all of the comments received, I think it is hard to
understand what the problem is, what the front-end looks like etc.
Your commit message is 1 line only.
I do remember some of the challenges discussed before, but it would
describe the problem in the commit message in detail and then discuss
why this solution is fit. Please read submitting-patches.rst
especially "2) Describe your changes".
thanks,
- Joel
> Signed-off-by: Kalesh Singh <kaleshsingh@...gle.com>
> ---
> Documentation/filesystems/vfs.rst | 5 +++++
> fs/file.c | 3 +++
> include/linux/fs.h | 1 +
> 3 files changed, 9 insertions(+)
>
> diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
> index ed17771c212b..95b30142c8d9 100644
> --- a/Documentation/filesystems/vfs.rst
> +++ b/Documentation/filesystems/vfs.rst
> @@ -1123,6 +1123,11 @@ otherwise noted.
> ``fadvise``
> possibly called by the fadvise64() system call.
>
> +``fd_install``
> + called by the VFS when a file descriptor is installed in the
> + process's file descriptor table, regardless how the file descriptor
> + was acquired -- be it via the open syscall, received over IPC, etc.
> +
> Note that the file operations are implemented by the specific
> filesystem in which the inode resides. When opening a device node
> (character or block special) most filesystems will call special
> diff --git a/fs/file.c b/fs/file.c
> index abb8b7081d7a..f5db8622b851 100644
> --- a/fs/file.c
> +++ b/fs/file.c
> @@ -616,6 +616,9 @@ void __fd_install(struct files_struct *files, unsigned int fd,
> void fd_install(unsigned int fd, struct file *file)
> {
> __fd_install(current->files, fd, file);
> +
> + if (file->f_op->fd_install)
> + file->f_op->fd_install(fd, file);
> }
>
> EXPORT_SYMBOL(fd_install);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index f5abba86107d..b976fbe8c902 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1864,6 +1864,7 @@ struct file_operations {
> struct file *file_out, loff_t pos_out,
> loff_t len, unsigned int remap_flags);
> int (*fadvise)(struct file *, loff_t, loff_t, int);
> + void (*fd_install)(int, struct file *);
> } __randomize_layout;
>
> struct inode_operations {
> --
> 2.28.0.163.g6104cc2f0b6-goog
>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@...roid.com.
>
Powered by blists - more mailing lists