diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 23:03:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 23:03:32 -0400 |
commit | d27fb65bc2389621040e5107baedb94b4cccf641 (patch) | |
tree | 4123a7b82dd048dc8b0602994a5db6f4b9885998 /fs/notify | |
parent | d3511f53bb2475f2a4e8460bee5a1ae6dea2a433 (diff) | |
parent | 795d673af1afae8146ac3070a2d77cfae5287c43 (diff) |
Merge branch 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc dcache updates from Al Viro:
"Most of this pile is putting name length into struct name_snapshot and
making use of it.
The beginning of this series ("ovl_lookup_real_one(): don't bother
with strlen()") ought to have been split in two (separate switch of
name_snapshot to struct qstr from overlayfs reaping the trivial
benefits of that), but I wanted to avoid a rebase - by the time I'd
spotted that it was (a) in -next and (b) close to 5.1-final ;-/"
* 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
audit_compare_dname_path(): switch to const struct qstr *
audit_update_watch(): switch to const struct qstr *
inotify_handle_event(): don't bother with strlen()
fsnotify: switch send_to_group() and ->handle_event to const struct qstr *
fsnotify(): switch to passing const struct qstr * for file_name
switch fsnotify_move() to passing const struct qstr * for old_name
ovl_lookup_real_one(): don't bother with strlen()
sysv: bury the broken "quietly truncate the long filenames" logics
nsfs: unobfuscate
unexport d_alloc_pseudo()
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/dnotify/dnotify.c | 2 | ||||
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 2 | ||||
-rw-r--r-- | fs/notify/fsnotify.c | 8 | ||||
-rw-r--r-- | fs/notify/inotify/inotify.h | 2 | ||||
-rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 6 |
5 files changed, 10 insertions, 10 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c index 58d77dc696eb..250369d6901d 100644 --- a/fs/notify/dnotify/dnotify.c +++ b/fs/notify/dnotify/dnotify.c | |||
@@ -81,7 +81,7 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark) | |||
81 | static int dnotify_handle_event(struct fsnotify_group *group, | 81 | static int dnotify_handle_event(struct fsnotify_group *group, |
82 | struct inode *inode, | 82 | struct inode *inode, |
83 | u32 mask, const void *data, int data_type, | 83 | u32 mask, const void *data, int data_type, |
84 | const unsigned char *file_name, u32 cookie, | 84 | const struct qstr *file_name, u32 cookie, |
85 | struct fsnotify_iter_info *iter_info) | 85 | struct fsnotify_iter_info *iter_info) |
86 | { | 86 | { |
87 | struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info); | 87 | struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info); |
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 63c6bb1f8c4d..e6fde1a5c072 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -367,7 +367,7 @@ static __kernel_fsid_t fanotify_get_fsid(struct fsnotify_iter_info *iter_info) | |||
367 | static int fanotify_handle_event(struct fsnotify_group *group, | 367 | static int fanotify_handle_event(struct fsnotify_group *group, |
368 | struct inode *inode, | 368 | struct inode *inode, |
369 | u32 mask, const void *data, int data_type, | 369 | u32 mask, const void *data, int data_type, |
370 | const unsigned char *file_name, u32 cookie, | 370 | const struct qstr *file_name, u32 cookie, |
371 | struct fsnotify_iter_info *iter_info) | 371 | struct fsnotify_iter_info *iter_info) |
372 | { | 372 | { |
373 | int ret = 0; | 373 | int ret = 0; |
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index df06f3da166c..5433e37fb0c5 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -179,10 +179,10 @@ int __fsnotify_parent(const struct path *path, struct dentry *dentry, __u32 mask | |||
179 | take_dentry_name_snapshot(&name, dentry); | 179 | take_dentry_name_snapshot(&name, dentry); |
180 | if (path) | 180 | if (path) |
181 | ret = fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH, | 181 | ret = fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH, |
182 | name.name, 0); | 182 | &name.name, 0); |
183 | else | 183 | else |
184 | ret = fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, | 184 | ret = fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, |
185 | name.name, 0); | 185 | &name.name, 0); |
186 | release_dentry_name_snapshot(&name); | 186 | release_dentry_name_snapshot(&name); |
187 | } | 187 | } |
188 | 188 | ||
@@ -195,7 +195,7 @@ EXPORT_SYMBOL_GPL(__fsnotify_parent); | |||
195 | static int send_to_group(struct inode *to_tell, | 195 | static int send_to_group(struct inode *to_tell, |
196 | __u32 mask, const void *data, | 196 | __u32 mask, const void *data, |
197 | int data_is, u32 cookie, | 197 | int data_is, u32 cookie, |
198 | const unsigned char *file_name, | 198 | const struct qstr *file_name, |
199 | struct fsnotify_iter_info *iter_info) | 199 | struct fsnotify_iter_info *iter_info) |
200 | { | 200 | { |
201 | struct fsnotify_group *group = NULL; | 201 | struct fsnotify_group *group = NULL; |
@@ -325,7 +325,7 @@ static void fsnotify_iter_next(struct fsnotify_iter_info *iter_info) | |||
325 | * notification event in whatever means they feel necessary. | 325 | * notification event in whatever means they feel necessary. |
326 | */ | 326 | */ |
327 | int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is, | 327 | int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is, |
328 | const unsigned char *file_name, u32 cookie) | 328 | const struct qstr *file_name, u32 cookie) |
329 | { | 329 | { |
330 | struct fsnotify_iter_info iter_info = {}; | 330 | struct fsnotify_iter_info iter_info = {}; |
331 | struct super_block *sb = to_tell->i_sb; | 331 | struct super_block *sb = to_tell->i_sb; |
diff --git a/fs/notify/inotify/inotify.h b/fs/notify/inotify/inotify.h index 74ae60305189..3f246f7b8a92 100644 --- a/fs/notify/inotify/inotify.h +++ b/fs/notify/inotify/inotify.h | |||
@@ -27,7 +27,7 @@ extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark, | |||
27 | extern int inotify_handle_event(struct fsnotify_group *group, | 27 | extern int inotify_handle_event(struct fsnotify_group *group, |
28 | struct inode *inode, | 28 | struct inode *inode, |
29 | u32 mask, const void *data, int data_type, | 29 | u32 mask, const void *data, int data_type, |
30 | const unsigned char *file_name, u32 cookie, | 30 | const struct qstr *file_name, u32 cookie, |
31 | struct fsnotify_iter_info *iter_info); | 31 | struct fsnotify_iter_info *iter_info); |
32 | 32 | ||
33 | extern const struct fsnotify_ops inotify_fsnotify_ops; | 33 | extern const struct fsnotify_ops inotify_fsnotify_ops; |
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index ff30abd6a49b..7e8b131029f8 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
@@ -67,7 +67,7 @@ static int inotify_merge(struct list_head *list, | |||
67 | int inotify_handle_event(struct fsnotify_group *group, | 67 | int inotify_handle_event(struct fsnotify_group *group, |
68 | struct inode *inode, | 68 | struct inode *inode, |
69 | u32 mask, const void *data, int data_type, | 69 | u32 mask, const void *data, int data_type, |
70 | const unsigned char *file_name, u32 cookie, | 70 | const struct qstr *file_name, u32 cookie, |
71 | struct fsnotify_iter_info *iter_info) | 71 | struct fsnotify_iter_info *iter_info) |
72 | { | 72 | { |
73 | struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info); | 73 | struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info); |
@@ -89,7 +89,7 @@ int inotify_handle_event(struct fsnotify_group *group, | |||
89 | return 0; | 89 | return 0; |
90 | } | 90 | } |
91 | if (file_name) { | 91 | if (file_name) { |
92 | len = strlen(file_name); | 92 | len = file_name->len; |
93 | alloc_len += len + 1; | 93 | alloc_len += len + 1; |
94 | } | 94 | } |
95 | 95 | ||
@@ -129,7 +129,7 @@ int inotify_handle_event(struct fsnotify_group *group, | |||
129 | event->sync_cookie = cookie; | 129 | event->sync_cookie = cookie; |
130 | event->name_len = len; | 130 | event->name_len = len; |
131 | if (len) | 131 | if (len) |
132 | strcpy(event->name, file_name); | 132 | strcpy(event->name, file_name->name); |
133 | 133 | ||
134 | ret = fsnotify_add_event(group, fsn_event, inotify_merge); | 134 | ret = fsnotify_add_event(group, fsn_event, inotify_merge); |
135 | if (ret) { | 135 | if (ret) { |