diff mbox series

[04/20] nfsd: use fsnotify_data_inode() to get the unlinked inode

Message ID 20200612093343.5669-5-amir73il@gmail.com (mailing list archive)
State New, archived
Headers show
Series Prep work for fanotify named events | expand

Commit Message

Amir Goldstein June 12, 2020, 9:33 a.m. UTC
The inode argument to handle_event() is about to become obsolete.
Return non const inode pointer from fsnotify_data_inode(), fsnotify
hooks do not pass const inode pointer as data.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 fs/nfsd/filecache.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Amir Goldstein June 12, 2020, 10:25 a.m. UTC | #1
On Fri, Jun 12, 2020 at 12:34 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> The inode argument to handle_event() is about to become obsolete.


> Return non const inode pointer from fsnotify_data_inode(), fsnotify
> hooks do not pass const inode pointer as data.

Sorry, this sentence is leftover from before I split this patch.

>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>  fs/nfsd/filecache.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index 82198d747c4c..ace8e5c30952 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -599,11 +599,13 @@ static struct notifier_block nfsd_file_lease_notifier = {
>
>  static int
>  nfsd_file_fsnotify_handle_event(struct fsnotify_group *group,
> -                               struct inode *inode,
> +                               struct inode *to_tell,
>                                 u32 mask, const void *data, int data_type,
>                                 const struct qstr *file_name, u32 cookie,
>                                 struct fsnotify_iter_info *iter_info)
>  {
> +       struct inode *inode = fsnotify_data_inode(data, data_type);
> +
>         trace_nfsd_file_fsnotify_handle_event(inode, mask);
>
>         /* Should be no marks on non-regular files */
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index 82198d747c4c..ace8e5c30952 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -599,11 +599,13 @@  static struct notifier_block nfsd_file_lease_notifier = {
 
 static int
 nfsd_file_fsnotify_handle_event(struct fsnotify_group *group,
-				struct inode *inode,
+				struct inode *to_tell,
 				u32 mask, const void *data, int data_type,
 				const struct qstr *file_name, u32 cookie,
 				struct fsnotify_iter_info *iter_info)
 {
+	struct inode *inode = fsnotify_data_inode(data, data_type);
+
 	trace_nfsd_file_fsnotify_handle_event(inode, mask);
 
 	/* Should be no marks on non-regular files */