3838 * that lock to dereference either of these things (they could be NULL even with
3939 * the lock)
4040 *
41- * group->mark_lock protects the mark_entries list anchored inside a given group
41+ * group->mark_lock protects the marks_list anchored inside a given group
4242 * and each entry is hooked via the g_list. It also sorta protects the
4343 * free_g_list, which when used is anchored by a private list on the stack of the
4444 * task which held the group->mark_lock.
4545 *
46- * inode->i_lock protects the i_fsnotify_mark_entries list anchored inside a
46+ * inode->i_lock protects the i_fsnotify_marks list anchored inside a
4747 * given inode and each entry is hooked via the i_list. (and sorta the
4848 * free_i_list)
4949 *
6161 * need to be cleaned up. (fsnotify_clear_marks_by_group)
6262 *
6363 * Worst case we are given an inode and need to clean up all the marks on that
64- * inode. We take i_lock and walk the i_fsnotify_mark_entries safely. For each
64+ * inode. We take i_lock and walk the i_fsnotify_marks safely. For each
6565 * mark on the list we take a reference (so the mark can't disappear under us).
6666 * We remove that mark form the inode's list of marks and we add this mark to a
6767 * private list anchored on the stack using i_free_list; At this point we no
9595#include <linux/fsnotify_backend.h>
9696#include "fsnotify.h"
9797
98- void fsnotify_get_mark (struct fsnotify_mark_entry * entry )
98+ void fsnotify_get_mark (struct fsnotify_mark * entry )
9999{
100100 atomic_inc (& entry -> refcnt );
101101}
102102
103- void fsnotify_put_mark (struct fsnotify_mark_entry * entry )
103+ void fsnotify_put_mark (struct fsnotify_mark * entry )
104104{
105105 if (atomic_dec_and_test (& entry -> refcnt ))
106106 entry -> free_mark (entry );
@@ -111,13 +111,13 @@ void fsnotify_put_mark(struct fsnotify_mark_entry *entry)
111111 */
112112static void fsnotify_recalc_inode_mask_locked (struct inode * inode )
113113{
114- struct fsnotify_mark_entry * entry ;
114+ struct fsnotify_mark * entry ;
115115 struct hlist_node * pos ;
116116 __u32 new_mask = 0 ;
117117
118118 assert_spin_locked (& inode -> i_lock );
119119
120- hlist_for_each_entry (entry , pos , & inode -> i_fsnotify_mark_entries , i .i_list )
120+ hlist_for_each_entry (entry , pos , & inode -> i_fsnotify_marks , i .i_list )
121121 new_mask |= entry -> mask ;
122122 inode -> i_fsnotify_mask = new_mask ;
123123}
@@ -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 * entry )
143+ void fsnotify_destroy_mark_by_entry (struct fsnotify_mark * entry )
144144{
145145 struct fsnotify_group * group ;
146146 struct inode * inode ;
@@ -174,7 +174,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
174174 fsnotify_put_mark (entry ); /* for i_list and g_list */
175175
176176 /*
177- * this mark is now off the inode->i_fsnotify_mark_entries list and we
177+ * this mark is now off the inode->i_fsnotify_marks list and we
178178 * hold the inode->i_lock, so this is the perfect time to update the
179179 * inode->i_fsnotify_mask
180180 */
@@ -221,11 +221,11 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
221221 */
222222void fsnotify_clear_marks_by_group (struct fsnotify_group * group )
223223{
224- struct fsnotify_mark_entry * lentry , * entry ;
224+ struct fsnotify_mark * lentry , * entry ;
225225 LIST_HEAD (free_list );
226226
227227 spin_lock (& group -> mark_lock );
228- list_for_each_entry_safe (entry , lentry , & group -> mark_entries , g_list ) {
228+ list_for_each_entry_safe (entry , lentry , & group -> marks_list , g_list ) {
229229 list_add (& entry -> free_g_list , & free_list );
230230 list_del_init (& entry -> g_list );
231231 fsnotify_get_mark (entry );
@@ -243,12 +243,12 @@ void fsnotify_clear_marks_by_group(struct fsnotify_group *group)
243243 */
244244void fsnotify_clear_marks_by_inode (struct inode * inode )
245245{
246- struct fsnotify_mark_entry * entry , * lentry ;
246+ struct fsnotify_mark * entry , * lentry ;
247247 struct hlist_node * pos , * n ;
248248 LIST_HEAD (free_list );
249249
250250 spin_lock (& inode -> i_lock );
251- hlist_for_each_entry_safe (entry , pos , n , & inode -> i_fsnotify_mark_entries , i .i_list ) {
251+ hlist_for_each_entry_safe (entry , pos , n , & inode -> i_fsnotify_marks , i .i_list ) {
252252 list_add (& entry -> i .free_i_list , & free_list );
253253 hlist_del_init (& entry -> i .i_list );
254254 fsnotify_get_mark (entry );
@@ -265,15 +265,15 @@ 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_entry * fsnotify_find_mark_entry (struct fsnotify_group * group ,
269- struct inode * inode )
268+ struct fsnotify_mark * fsnotify_find_mark_entry (struct fsnotify_group * group ,
269+ struct inode * inode )
270270{
271- struct fsnotify_mark_entry * entry ;
271+ struct fsnotify_mark * entry ;
272272 struct hlist_node * pos ;
273273
274274 assert_spin_locked (& inode -> i_lock );
275275
276- hlist_for_each_entry (entry , pos , & inode -> i_fsnotify_mark_entries , i .i_list ) {
276+ hlist_for_each_entry (entry , pos , & inode -> i_fsnotify_marks , i .i_list ) {
277277 if (entry -> group == group ) {
278278 fsnotify_get_mark (entry );
279279 return entry ;
@@ -282,7 +282,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou
282282 return NULL ;
283283}
284284
285- void fsnotify_duplicate_mark (struct fsnotify_mark_entry * new , struct fsnotify_mark_entry * old )
285+ void fsnotify_duplicate_mark (struct fsnotify_mark * new , struct fsnotify_mark * old )
286286{
287287 assert_spin_locked (& old -> lock );
288288 new -> i .inode = old -> i .inode ;
@@ -294,8 +294,8 @@ void fsnotify_duplicate_mark(struct fsnotify_mark_entry *new, struct fsnotify_ma
294294/*
295295 * Nothing fancy, just initialize lists and locks and counters.
296296 */
297- void fsnotify_init_mark (struct fsnotify_mark_entry * entry ,
298- void (* free_mark )(struct fsnotify_mark_entry * entry ))
297+ void fsnotify_init_mark (struct fsnotify_mark * entry ,
298+ void (* free_mark )(struct fsnotify_mark * entry ))
299299{
300300 spin_lock_init (& entry -> lock );
301301 atomic_set (& entry -> refcnt , 1 );
@@ -311,11 +311,11 @@ void fsnotify_init_mark(struct fsnotify_mark_entry *entry,
311311 * These marks may be used for the fsnotify backend to determine which
312312 * event types should be delivered to which group and for which inodes.
313313 */
314- int fsnotify_add_mark (struct fsnotify_mark_entry * entry ,
314+ int fsnotify_add_mark (struct fsnotify_mark * entry ,
315315 struct fsnotify_group * group , struct inode * inode ,
316316 int allow_dups )
317317{
318- struct fsnotify_mark_entry * lentry = NULL ;
318+ struct fsnotify_mark * lentry = NULL ;
319319 int ret = 0 ;
320320
321321 inode = igrab (inode );
@@ -354,8 +354,8 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
354354 entry -> group = group ;
355355 entry -> i .inode = inode ;
356356
357- hlist_add_head (& entry -> i .i_list , & inode -> i_fsnotify_mark_entries );
358- list_add (& entry -> g_list , & group -> mark_entries );
357+ hlist_add_head (& entry -> i .i_list , & inode -> i_fsnotify_marks );
358+ list_add (& entry -> g_list , & group -> marks_list );
359359
360360 fsnotify_get_mark (entry ); /* for i_list and g_list */
361361
0 commit comments