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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -220,12 +220,11 @@ enum fsnotify_data_type { · 219 unmodified lines | ||
| 220 | 220 | FSNOTIFY_EVENT_INODE, |
| 221 | 221 | }; |
| 222 | 222 | |
| 223 | −static inline const struct inode *fsnotify_data_inode(const void *data, | |
| 224 | − int data_type) | |
| 223 | +static inline struct inode *fsnotify_data_inode(const void *data, int data_type) | |
| 225 | 224 | { |
| 226 | 225 | switch (data_type) { |
| 227 | 226 | case FSNOTIFY_EVENT_INODE: |
| 228 | − return data; | |
| 227 | + return (struct inode *)data; | |
| 229 | 228 | case FSNOTIFY_EVENT_PATH: |
| 230 | 229 | return d_inode(((const struct path *)data)->dentry); |
| 231 | 230 | default: |