Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fsnotify: rename fsnotify_find_mark_entry to fsnotify_find_mark

the _entry portion of fsnotify functions is useless. Drop it.

Signed-off-by: Eric Paris <eparis@redhat.com>

+31 -31
+7 -7
fs/notify/dnotify/dnotify.c
··· 96 96 to_tell = event->to_tell; 97 97 98 98 spin_lock(&to_tell->i_lock); 99 - entry = fsnotify_find_mark_entry(group, to_tell); 99 + entry = fsnotify_find_mark(group, to_tell); 100 100 spin_unlock(&to_tell->i_lock); 101 101 102 102 /* unlikely since we alreay passed dnotify_should_send_event() */ ··· 148 148 return false; 149 149 150 150 spin_lock(&inode->i_lock); 151 - entry = fsnotify_find_mark_entry(group, inode); 151 + entry = fsnotify_find_mark(group, inode); 152 152 spin_unlock(&inode->i_lock); 153 153 154 154 /* no mark means no dnotify watch */ ··· 158 158 mask = (mask & ~FS_EVENT_ON_CHILD); 159 159 send = (mask & entry->mask); 160 160 161 - fsnotify_put_mark(entry); /* matches fsnotify_find_mark_entry */ 161 + fsnotify_put_mark(entry); /* matches fsnotify_find_mark */ 162 162 163 163 return send; 164 164 } ··· 202 202 return; 203 203 204 204 spin_lock(&inode->i_lock); 205 - entry = fsnotify_find_mark_entry(dnotify_group, inode); 205 + entry = fsnotify_find_mark(dnotify_group, inode); 206 206 spin_unlock(&inode->i_lock); 207 207 if (!entry) 208 208 return; ··· 226 226 227 227 /* nothing else could have found us thanks to the dnotify_mark_mutex */ 228 228 if (dnentry->dn == NULL) 229 - fsnotify_destroy_mark_by_entry(entry); 229 + fsnotify_destroy_mark(entry); 230 230 231 231 fsnotify_recalc_group_mask(dnotify_group); 232 232 ··· 357 357 358 358 /* add the new_entry or find an old one. */ 359 359 spin_lock(&inode->i_lock); 360 - entry = fsnotify_find_mark_entry(dnotify_group, inode); 360 + entry = fsnotify_find_mark(dnotify_group, inode); 361 361 spin_unlock(&inode->i_lock); 362 362 if (entry) { 363 363 dnentry = container_of(entry, struct dnotify_mark_entry, fsn_entry); ··· 414 414 spin_unlock(&entry->lock); 415 415 416 416 if (destroy) 417 - fsnotify_destroy_mark_by_entry(entry); 417 + fsnotify_destroy_mark(entry); 418 418 419 419 fsnotify_recalc_group_mask(dnotify_group); 420 420
+7 -7
fs/notify/inode_mark.c
··· 56 56 * - The inode is unlinked for the last time. (fsnotify_inode_remove) 57 57 * - The inode is being evicted from cache. (fsnotify_inode_delete) 58 58 * - The fs the inode is on is unmounted. (fsnotify_inode_delete/fsnotify_unmount_inodes) 59 - * - Something explicitly requests that it be removed. (fsnotify_destroy_mark_by_entry) 59 + * - Something explicitly requests that it be removed. (fsnotify_destroy_mark) 60 60 * - The fsnotify_group associated with the mark is going away and all such marks 61 61 * need to be cleaned up. (fsnotify_clear_marks_by_group) 62 62 * ··· 140 140 * The caller had better be holding a reference to this mark so we don't actually 141 141 * do the final put under the entry->lock 142 142 */ 143 - void fsnotify_destroy_mark_by_entry(struct fsnotify_mark *entry) 143 + void fsnotify_destroy_mark(struct fsnotify_mark *entry) 144 144 { 145 145 struct fsnotify_group *group; 146 146 struct inode *inode; ··· 233 233 spin_unlock(&group->mark_lock); 234 234 235 235 list_for_each_entry_safe(entry, lentry, &free_list, free_g_list) { 236 - fsnotify_destroy_mark_by_entry(entry); 236 + fsnotify_destroy_mark(entry); 237 237 fsnotify_put_mark(entry); 238 238 } 239 239 } ··· 256 256 spin_unlock(&inode->i_lock); 257 257 258 258 list_for_each_entry_safe(entry, lentry, &free_list, i.free_i_list) { 259 - fsnotify_destroy_mark_by_entry(entry); 259 + fsnotify_destroy_mark(entry); 260 260 fsnotify_put_mark(entry); 261 261 } 262 262 } ··· 265 265 * given a group and inode, find the mark associated with that combination. 266 266 * if found take a reference to that mark and return it, else return NULL 267 267 */ 268 - struct fsnotify_mark *fsnotify_find_mark_entry(struct fsnotify_group *group, 269 - struct inode *inode) 268 + struct fsnotify_mark *fsnotify_find_mark(struct fsnotify_group *group, 269 + struct inode *inode) 270 270 { 271 271 struct fsnotify_mark *entry; 272 272 struct hlist_node *pos; ··· 349 349 spin_lock(&inode->i_lock); 350 350 351 351 if (!allow_dups) 352 - lentry = fsnotify_find_mark_entry(group, inode); 352 + lentry = fsnotify_find_mark(group, inode); 353 353 if (!lentry) { 354 354 entry->group = group; 355 355 entry->i.inode = inode;
+2 -2
fs/notify/inotify/inotify_fsnotify.c
··· 98 98 to_tell = event->to_tell; 99 99 100 100 spin_lock(&to_tell->i_lock); 101 - entry = fsnotify_find_mark_entry(group, to_tell); 101 + entry = fsnotify_find_mark(group, to_tell); 102 102 spin_unlock(&to_tell->i_lock); 103 103 /* race with watch removal? We already passes should_send */ 104 104 if (unlikely(!entry)) ··· 148 148 bool send; 149 149 150 150 spin_lock(&inode->i_lock); 151 - entry = fsnotify_find_mark_entry(group, inode); 151 + entry = fsnotify_find_mark(group, inode); 152 152 spin_unlock(&inode->i_lock); 153 153 if (!entry) 154 154 return false;
+3 -3
fs/notify/inotify/inotify_user.c
··· 567 567 return -EINVAL; 568 568 569 569 spin_lock(&inode->i_lock); 570 - entry = fsnotify_find_mark_entry(group, inode); 570 + entry = fsnotify_find_mark(group, inode); 571 571 spin_unlock(&inode->i_lock); 572 572 if (!entry) 573 573 return -ENOENT; ··· 607 607 /* return the wd */ 608 608 ret = ientry->wd; 609 609 610 - /* match the get from fsnotify_find_mark_entry() */ 610 + /* match the get from fsnotify_find_mark() */ 611 611 fsnotify_put_mark(entry); 612 612 613 613 return ret; ··· 823 823 824 824 ret = 0; 825 825 826 - fsnotify_destroy_mark_by_entry(&ientry->fsn_entry); 826 + fsnotify_destroy_mark(&ientry->fsn_entry); 827 827 828 828 /* match ref taken by inotify_idr_find */ 829 829 fsnotify_put_mark(&ientry->fsn_entry);
+2 -2
include/linux/fsnotify_backend.h
··· 363 363 extern void fsnotify_recalc_inode_mask(struct inode *inode); 364 364 extern void fsnotify_init_mark(struct fsnotify_mark *entry, void (*free_mark)(struct fsnotify_mark *entry)); 365 365 /* find (and take a reference) to a mark associated with group and inode */ 366 - extern struct fsnotify_mark *fsnotify_find_mark_entry(struct fsnotify_group *group, struct inode *inode); 366 + extern struct fsnotify_mark *fsnotify_find_mark(struct fsnotify_group *group, struct inode *inode); 367 367 /* copy the values from old into new */ 368 368 extern void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old); 369 369 /* attach the mark to both the group and the inode */ 370 370 extern int fsnotify_add_mark(struct fsnotify_mark *entry, struct fsnotify_group *group, struct inode *inode, int allow_dups); 371 371 /* given a mark, flag it to be freed when all references are dropped */ 372 - extern void fsnotify_destroy_mark_by_entry(struct fsnotify_mark *entry); 372 + extern void fsnotify_destroy_mark(struct fsnotify_mark *entry); 373 373 /* run all the marks in a group, and flag them to be freed */ 374 374 extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group); 375 375 extern void fsnotify_get_mark(struct fsnotify_mark *entry);
+6 -6
kernel/audit_tree.c
··· 250 250 list_del_rcu(&chunk->hash); 251 251 spin_unlock(&hash_lock); 252 252 spin_unlock(&entry->lock); 253 - fsnotify_destroy_mark_by_entry(entry); 253 + fsnotify_destroy_mark(entry); 254 254 fsnotify_put_mark(entry); 255 255 goto out; 256 256 } ··· 293 293 owner->root = new; 294 294 spin_unlock(&hash_lock); 295 295 spin_unlock(&entry->lock); 296 - fsnotify_destroy_mark_by_entry(entry); 296 + fsnotify_destroy_mark(entry); 297 297 fsnotify_put_mark(entry); 298 298 goto out; 299 299 ··· 333 333 spin_unlock(&hash_lock); 334 334 chunk->dead = 1; 335 335 spin_unlock(&entry->lock); 336 - fsnotify_destroy_mark_by_entry(entry); 336 + fsnotify_destroy_mark(entry); 337 337 fsnotify_put_mark(entry); 338 338 return 0; 339 339 } ··· 361 361 int n; 362 362 363 363 spin_lock(&inode->i_lock); 364 - old_entry = fsnotify_find_mark_entry(audit_tree_group, inode); 364 + old_entry = fsnotify_find_mark(audit_tree_group, inode); 365 365 spin_unlock(&inode->i_lock); 366 366 if (!old_entry) 367 367 return create_chunk(inode, tree); ··· 415 415 spin_unlock(&chunk_entry->lock); 416 416 spin_unlock(&old_entry->lock); 417 417 418 - fsnotify_destroy_mark_by_entry(chunk_entry); 418 + fsnotify_destroy_mark(chunk_entry); 419 419 420 420 fsnotify_put_mark(chunk_entry); 421 421 fsnotify_put_mark(old_entry); ··· 446 446 spin_unlock(&hash_lock); 447 447 spin_unlock(&chunk_entry->lock); 448 448 spin_unlock(&old_entry->lock); 449 - fsnotify_destroy_mark_by_entry(old_entry); 449 + fsnotify_destroy_mark(old_entry); 450 450 fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */ 451 451 fsnotify_put_mark(old_entry); /* and kill it */ 452 452 return 0;
+4 -4
kernel/audit_watch.c
··· 102 102 struct fsnotify_mark *entry; 103 103 104 104 spin_lock(&inode->i_lock); 105 - entry = fsnotify_find_mark_entry(audit_watch_group, inode); 105 + entry = fsnotify_find_mark(audit_watch_group, inode); 106 106 spin_unlock(&inode->i_lock); 107 107 108 108 if (entry) ··· 354 354 } 355 355 mutex_unlock(&audit_filter_mutex); 356 356 357 - fsnotify_destroy_mark_by_entry(&parent->mark); 357 + fsnotify_destroy_mark(&parent->mark); 358 358 359 359 fsnotify_recalc_group_mask(audit_watch_group); 360 360 ··· 504 504 505 505 if (list_empty(&parent->watches)) { 506 506 audit_get_parent(parent); 507 - fsnotify_destroy_mark_by_entry(&parent->mark); 507 + fsnotify_destroy_mark(&parent->mark); 508 508 audit_put_parent(parent); 509 509 } 510 510 } ··· 521 521 bool send; 522 522 523 523 spin_lock(&inode->i_lock); 524 - entry = fsnotify_find_mark_entry(group, inode); 524 + entry = fsnotify_find_mark(group, inode); 525 525 spin_unlock(&inode->i_lock); 526 526 if (!entry) 527 527 return false;