diff options
author | Amir Goldstein <amir73il@gmail.com> | 2020-07-08 14:11:38 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2020-07-15 18:36:45 +0300 |
commit | cbcf47adc8aadbcaa741391ccfd96f764b50be7e (patch) | |
tree | d6b816f967e7c570f0865241475c3dd0ab0d180f /include/linux/fsnotify_backend.h | |
parent | c738fbabb0ff62d0f9a9572e56e65d05a1b34c6a (diff) | |
download | linux-cbcf47adc8aadbcaa741391ccfd96f764b50be7e.tar.xz |
fsnotify: return non const from fsnotify_data_inode()
Return non const inode pointer from fsnotify_data_inode().
None of the fsnotify hooks pass const inode pointer as data and
callers often need to cast to a non const pointer.
Link: https://lore.kernel.org/r/20200708111156.24659-3-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/fsnotify_backend.h')
-rw-r--r-- | include/linux/fsnotify_backend.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 1626fa7d10ff..97300f3b8ff0 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -220,12 +220,11 @@ enum fsnotify_data_type { FSNOTIFY_EVENT_INODE, }; -static inline const struct inode *fsnotify_data_inode(const void *data, - int data_type) +static inline struct inode *fsnotify_data_inode(const void *data, int data_type) { switch (data_type) { case FSNOTIFY_EVENT_INODE: - return data; + return (struct inode *)data; case FSNOTIFY_EVENT_PATH: return d_inode(((const struct path *)data)->dentry); default: |