From: Kalesh Singh <kaleshsingh@google.com> To: Joel Fernandes <joelaf@google.com> Cc: Jonathan Corbet <corbet@lwn.net>, Sumit Semwal <sumit.semwal@linaro.org>, Alexander Viro <viro@zeniv.linux.org.uk>, Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>, "open list:DOCUMENTATION" <linux-doc@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-fsdevel@vger.kernel.org, Suren Baghdasaryan <surenb@google.com>, Hridya Valsaraju <hridya@google.com>, Ioannis Ilkos <ilkos@google.com>, John Stultz <john.stultz@linaro.org>, "Cc: Android Kernel" <kernel-team@android.com> Subject: Re: [PATCH 1/2] fs: Add fd_install file operation Date: Tue, 4 Aug 2020 13:54:12 +0000 [thread overview] Message-ID: <20200804135412.GA934259@google.com> (raw) In-Reply-To: <CAJWu+orzhpO5hPfUWd0EJp-ViWMifeQ_Ng+R4fHf7xabL+Bggw@mail.gmail.com> On Mon, Aug 03, 2020 at 08:30:59PM -0400, Joel Fernandes wrote: > On Mon, Aug 3, 2020 at 10:47 AM 'Kalesh Singh' via kernel-team > <kernel-team@android.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 Thanks for the advice Joel :) > > > > Signed-off-by: Kalesh Singh <kaleshsingh@google.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@android.com. > >
WARNING: multiple messages have this Message-ID (diff)
From: Kalesh Singh <kaleshsingh@google.com> To: Joel Fernandes <joelaf@google.com> Cc: "open list:DOCUMENTATION" <linux-doc@vger.kernel.org>, "Cc: Android Kernel" <kernel-team@android.com>, dri-devel@lists.freedesktop.org, Jonathan Corbet <corbet@lwn.net>, Ioannis Ilkos <ilkos@google.com>, LKML <linux-kernel@vger.kernel.org>, Steven Rostedt <rostedt@goodmis.org>, linaro-mm-sig@lists.linaro.org, Hridya Valsaraju <hridya@google.com>, Ingo Molnar <mingo@redhat.com>, Alexander Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org, Suren Baghdasaryan <surenb@google.com>, linux-media@vger.kernel.org Subject: Re: [PATCH 1/2] fs: Add fd_install file operation Date: Tue, 4 Aug 2020 13:54:12 +0000 [thread overview] Message-ID: <20200804135412.GA934259@google.com> (raw) In-Reply-To: <CAJWu+orzhpO5hPfUWd0EJp-ViWMifeQ_Ng+R4fHf7xabL+Bggw@mail.gmail.com> On Mon, Aug 03, 2020 at 08:30:59PM -0400, Joel Fernandes wrote: > On Mon, Aug 3, 2020 at 10:47 AM 'Kalesh Singh' via kernel-team > <kernel-team@android.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 Thanks for the advice Joel :) > > > > Signed-off-by: Kalesh Singh <kaleshsingh@google.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@android.com. > > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-08-04 13:54 UTC|newest] Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-03 14:47 [PATCH 0/2] Per process tracking of dma buffers Kalesh Singh 2020-08-03 14:47 ` Kalesh Singh 2020-08-03 14:47 ` [PATCH 1/2] fs: Add fd_install file operation Kalesh Singh 2020-08-03 14:47 ` Kalesh Singh 2020-08-03 16:34 ` Christoph Hellwig 2020-08-03 18:26 ` Kalesh Singh 2020-08-03 18:26 ` Kalesh Singh 2020-08-03 22:18 ` Al Viro 2020-08-03 22:18 ` Al Viro 2020-08-04 0:30 ` Joel Fernandes 2020-08-04 0:30 ` Joel Fernandes 2020-08-04 13:54 ` Kalesh Singh [this message] 2020-08-04 13:54 ` Kalesh Singh 2020-08-03 14:47 ` [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events Kalesh Singh 2020-08-03 14:47 ` Kalesh Singh 2020-08-03 15:32 ` Steven Rostedt 2020-08-03 15:32 ` Steven Rostedt 2020-08-03 16:33 ` Kalesh Singh 2020-08-03 16:33 ` Kalesh Singh 2020-08-03 15:41 ` Matthew Wilcox 2020-08-03 15:41 ` Matthew Wilcox 2020-08-03 16:00 ` Suren Baghdasaryan 2020-08-03 16:00 ` Suren Baghdasaryan 2020-08-03 16:12 ` Matthew Wilcox 2020-08-03 16:12 ` Matthew Wilcox 2020-08-03 16:22 ` Suren Baghdasaryan 2020-08-03 16:22 ` Suren Baghdasaryan 2020-08-03 22:28 ` Al Viro 2020-08-03 22:28 ` Al Viro 2020-08-04 1:09 ` Al Viro 2020-08-04 1:09 ` Al Viro 2020-08-04 2:10 ` Suren Baghdasaryan 2020-08-04 2:10 ` Suren Baghdasaryan 2020-08-04 15:44 ` Kalesh Singh 2020-08-04 15:44 ` Kalesh Singh 2020-08-04 18:27 ` Al Viro 2020-08-04 18:27 ` Al Viro 2020-08-04 20:42 ` Kalesh Singh 2020-08-04 20:42 ` Kalesh Singh 2020-08-04 20:26 ` Daniel Vetter 2020-08-04 20:26 ` Daniel Vetter
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=20200804135412.GA934259@google.com \ --to=kaleshsingh@google.com \ --cc=corbet@lwn.net \ --cc=dri-devel@lists.freedesktop.org \ --cc=hridya@google.com \ --cc=ilkos@google.com \ --cc=joelaf@google.com \ --cc=john.stultz@linaro.org \ --cc=kernel-team@android.com \ --cc=linaro-mm-sig@lists.linaro.org \ --cc=linux-doc@vger.kernel.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-media@vger.kernel.org \ --cc=mingo@redhat.com \ --cc=rostedt@goodmis.org \ --cc=sumit.semwal@linaro.org \ --cc=surenb@google.com \ --cc=viro@zeniv.linux.org.uk \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.