Skip to content

Commit d077544

Browse files
committed
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>
1 parent e61ce86 commit d077544

7 files changed

Lines changed: 31 additions & 31 deletions

File tree

‎fs/notify/dnotify/dnotify.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int dnotify_handle_event(struct fsnotify_group *group,
9696
to_tell = event->to_tell;
9797

9898
spin_lock(&to_tell->i_lock);
99-
entry = fsnotify_find_mark_entry(group, to_tell);
99+
entry = fsnotify_find_mark(group, to_tell);
100100
spin_unlock(&to_tell->i_lock);
101101

102102
/* unlikely since we alreay passed dnotify_should_send_event() */
@@ -148,7 +148,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
148148
return false;
149149

150150
spin_lock(&inode->i_lock);
151-
entry = fsnotify_find_mark_entry(group, inode);
151+
entry = fsnotify_find_mark(group, inode);
152152
spin_unlock(&inode->i_lock);
153153

154154
/* no mark means no dnotify watch */
@@ -158,7 +158,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
158158
mask = (mask & ~FS_EVENT_ON_CHILD);
159159
send = (mask & entry->mask);
160160

161-
fsnotify_put_mark(entry); /* matches fsnotify_find_mark_entry */
161+
fsnotify_put_mark(entry); /* matches fsnotify_find_mark */
162162

163163
return send;
164164
}
@@ -202,7 +202,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
202202
return;
203203

204204
spin_lock(&inode->i_lock);
205-
entry = fsnotify_find_mark_entry(dnotify_group, inode);
205+
entry = fsnotify_find_mark(dnotify_group, inode);
206206
spin_unlock(&inode->i_lock);
207207
if (!entry)
208208
return;
@@ -226,7 +226,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
226226

227227
/* nothing else could have found us thanks to the dnotify_mark_mutex */
228228
if (dnentry->dn == NULL)
229-
fsnotify_destroy_mark_by_entry(entry);
229+
fsnotify_destroy_mark(entry);
230230

231231
fsnotify_recalc_group_mask(dnotify_group);
232232

@@ -357,7 +357,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
357357

358358
/* add the new_entry or find an old one. */
359359
spin_lock(&inode->i_lock);
360-
entry = fsnotify_find_mark_entry(dnotify_group, inode);
360+
entry = fsnotify_find_mark(dnotify_group, inode);
361361
spin_unlock(&inode->i_lock);
362362
if (entry) {
363363
dnentry = container_of(entry, struct dnotify_mark_entry, fsn_entry);
@@ -414,7 +414,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
414414
spin_unlock(&entry->lock);
415415

416416
if (destroy)
417-
fsnotify_destroy_mark_by_entry(entry);
417+
fsnotify_destroy_mark(entry);
418418

419419
fsnotify_recalc_group_mask(dnotify_group);
420420

‎fs/notify/inode_mark.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* - The inode is unlinked for the last time. (fsnotify_inode_remove)
5757
* - The inode is being evicted from cache. (fsnotify_inode_delete)
5858
* - 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)
6060
* - The fsnotify_group associated with the mark is going away and all such marks
6161
* need to be cleaned up. (fsnotify_clear_marks_by_group)
6262
*
@@ -140,7 +140,7 @@ void fsnotify_recalc_inode_mask(struct inode *inode)
140140
* The caller had better be holding a reference to this mark so we don't actually
141141
* do the final put under the entry->lock
142142
*/
143-
void fsnotify_destroy_mark_by_entry(struct fsnotify_mark *entry)
143+
void fsnotify_destroy_mark(struct fsnotify_mark *entry)
144144
{
145145
struct fsnotify_group *group;
146146
struct inode *inode;
@@ -233,7 +233,7 @@ void fsnotify_clear_marks_by_group(struct fsnotify_group *group)
233233
spin_unlock(&group->mark_lock);
234234

235235
list_for_each_entry_safe(entry, lentry, &free_list, free_g_list) {
236-
fsnotify_destroy_mark_by_entry(entry);
236+
fsnotify_destroy_mark(entry);
237237
fsnotify_put_mark(entry);
238238
}
239239
}
@@ -256,7 +256,7 @@ void fsnotify_clear_marks_by_inode(struct inode *inode)
256256
spin_unlock(&inode->i_lock);
257257

258258
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);
260260
fsnotify_put_mark(entry);
261261
}
262262
}
@@ -265,8 +265,8 @@ void fsnotify_clear_marks_by_inode(struct inode *inode)
265265
* given a group and inode, find the mark associated with that combination.
266266
* if found take a reference to that mark and return it, else return NULL
267267
*/
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)
270270
{
271271
struct fsnotify_mark *entry;
272272
struct hlist_node *pos;
@@ -349,7 +349,7 @@ int fsnotify_add_mark(struct fsnotify_mark *entry,
349349
spin_lock(&inode->i_lock);
350350

351351
if (!allow_dups)
352-
lentry = fsnotify_find_mark_entry(group, inode);
352+
lentry = fsnotify_find_mark(group, inode);
353353
if (!lentry) {
354354
entry->group = group;
355355
entry->i.inode = inode;

‎fs/notify/inotify/inotify_fsnotify.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev
9898
to_tell = event->to_tell;
9999

100100
spin_lock(&to_tell->i_lock);
101-
entry = fsnotify_find_mark_entry(group, to_tell);
101+
entry = fsnotify_find_mark(group, to_tell);
102102
spin_unlock(&to_tell->i_lock);
103103
/* race with watch removal? We already passes should_send */
104104
if (unlikely(!entry))
@@ -148,7 +148,7 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode
148148
bool send;
149149

150150
spin_lock(&inode->i_lock);
151-
entry = fsnotify_find_mark_entry(group, inode);
151+
entry = fsnotify_find_mark(group, inode);
152152
spin_unlock(&inode->i_lock);
153153
if (!entry)
154154
return false;

‎fs/notify/inotify/inotify_user.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
567567
return -EINVAL;
568568

569569
spin_lock(&inode->i_lock);
570-
entry = fsnotify_find_mark_entry(group, inode);
570+
entry = fsnotify_find_mark(group, inode);
571571
spin_unlock(&inode->i_lock);
572572
if (!entry)
573573
return -ENOENT;
@@ -607,7 +607,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
607607
/* return the wd */
608608
ret = ientry->wd;
609609

610-
/* match the get from fsnotify_find_mark_entry() */
610+
/* match the get from fsnotify_find_mark() */
611611
fsnotify_put_mark(entry);
612612

613613
return ret;
@@ -823,7 +823,7 @@ SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
823823

824824
ret = 0;
825825

826-
fsnotify_destroy_mark_by_entry(&ientry->fsn_entry);
826+
fsnotify_destroy_mark(&ientry->fsn_entry);
827827

828828
/* match ref taken by inotify_idr_find */
829829
fsnotify_put_mark(&ientry->fsn_entry);

‎include/linux/fsnotify_backend.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,13 @@ extern struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group
363363
extern void fsnotify_recalc_inode_mask(struct inode *inode);
364364
extern void fsnotify_init_mark(struct fsnotify_mark *entry, void (*free_mark)(struct fsnotify_mark *entry));
365365
/* 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);
367367
/* copy the values from old into new */
368368
extern void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old);
369369
/* attach the mark to both the group and the inode */
370370
extern int fsnotify_add_mark(struct fsnotify_mark *entry, struct fsnotify_group *group, struct inode *inode, int allow_dups);
371371
/* 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);
373373
/* run all the marks in a group, and flag them to be freed */
374374
extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group);
375375
extern void fsnotify_get_mark(struct fsnotify_mark *entry);

‎kernel/audit_tree.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void untag_chunk(struct node *p)
250250
list_del_rcu(&chunk->hash);
251251
spin_unlock(&hash_lock);
252252
spin_unlock(&entry->lock);
253-
fsnotify_destroy_mark_by_entry(entry);
253+
fsnotify_destroy_mark(entry);
254254
fsnotify_put_mark(entry);
255255
goto out;
256256
}
@@ -293,7 +293,7 @@ static void untag_chunk(struct node *p)
293293
owner->root = new;
294294
spin_unlock(&hash_lock);
295295
spin_unlock(&entry->lock);
296-
fsnotify_destroy_mark_by_entry(entry);
296+
fsnotify_destroy_mark(entry);
297297
fsnotify_put_mark(entry);
298298
goto out;
299299

@@ -333,7 +333,7 @@ static int create_chunk(struct inode *inode, struct audit_tree *tree)
333333
spin_unlock(&hash_lock);
334334
chunk->dead = 1;
335335
spin_unlock(&entry->lock);
336-
fsnotify_destroy_mark_by_entry(entry);
336+
fsnotify_destroy_mark(entry);
337337
fsnotify_put_mark(entry);
338338
return 0;
339339
}
@@ -361,7 +361,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
361361
int n;
362362

363363
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);
365365
spin_unlock(&inode->i_lock);
366366
if (!old_entry)
367367
return create_chunk(inode, tree);
@@ -415,7 +415,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
415415
spin_unlock(&chunk_entry->lock);
416416
spin_unlock(&old_entry->lock);
417417

418-
fsnotify_destroy_mark_by_entry(chunk_entry);
418+
fsnotify_destroy_mark(chunk_entry);
419419

420420
fsnotify_put_mark(chunk_entry);
421421
fsnotify_put_mark(old_entry);
@@ -446,7 +446,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
446446
spin_unlock(&hash_lock);
447447
spin_unlock(&chunk_entry->lock);
448448
spin_unlock(&old_entry->lock);
449-
fsnotify_destroy_mark_by_entry(old_entry);
449+
fsnotify_destroy_mark(old_entry);
450450
fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */
451451
fsnotify_put_mark(old_entry); /* and kill it */
452452
return 0;

‎kernel/audit_watch.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static inline struct audit_parent *audit_find_parent(struct inode *inode)
102102
struct fsnotify_mark *entry;
103103

104104
spin_lock(&inode->i_lock);
105-
entry = fsnotify_find_mark_entry(audit_watch_group, inode);
105+
entry = fsnotify_find_mark(audit_watch_group, inode);
106106
spin_unlock(&inode->i_lock);
107107

108108
if (entry)
@@ -354,7 +354,7 @@ static void audit_remove_parent_watches(struct audit_parent *parent)
354354
}
355355
mutex_unlock(&audit_filter_mutex);
356356

357-
fsnotify_destroy_mark_by_entry(&parent->mark);
357+
fsnotify_destroy_mark(&parent->mark);
358358

359359
fsnotify_recalc_group_mask(audit_watch_group);
360360

@@ -504,7 +504,7 @@ void audit_remove_watch_rule(struct audit_krule *krule)
504504

505505
if (list_empty(&parent->watches)) {
506506
audit_get_parent(parent);
507-
fsnotify_destroy_mark_by_entry(&parent->mark);
507+
fsnotify_destroy_mark(&parent->mark);
508508
audit_put_parent(parent);
509509
}
510510
}
@@ -521,7 +521,7 @@ static bool audit_watch_should_send_event(struct fsnotify_group *group, struct i
521521
bool send;
522522

523523
spin_lock(&inode->i_lock);
524-
entry = fsnotify_find_mark_entry(group, inode);
524+
entry = fsnotify_find_mark(group, inode);
525525
spin_unlock(&inode->i_lock);
526526
if (!entry)
527527
return false;

0 commit comments

Comments
 (0)