Skip to content

Commit e61ce86

Browse files
committed
fsnotify: rename fsnotify_mark_entry to just fsnotify_mark
The name is long and it serves no real purpose. So rename fsnotify_mark_entry to just fsnotify_mark. Signed-off-by: Eric Paris <eparis@redhat.com>
1 parent 72acc85 commit e61ce86

13 files changed

Lines changed: 94 additions & 94 deletions

File tree

‎fs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void inode_init_once(struct inode *inode)
264264
INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear);
265265
i_size_ordered_init(inode);
266266
#ifdef CONFIG_FSNOTIFY
267-
INIT_HLIST_HEAD(&inode->i_fsnotify_mark_entries);
267+
INIT_HLIST_HEAD(&inode->i_fsnotify_marks);
268268
#endif
269269
}
270270
EXPORT_SYMBOL(inode_init_once);

‎fs/notify/dnotify/dnotify.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ static struct fsnotify_group *dnotify_group __read_mostly;
3434
static DEFINE_MUTEX(dnotify_mark_mutex);
3535

3636
/*
37-
* dnotify will attach one of these to each inode (i_fsnotify_mark_entries) which
37+
* dnotify will attach one of these to each inode (i_fsnotify_marks) which
3838
* is being watched by dnotify. If multiple userspace applications are watching
3939
* the same directory with dnotify their information is chained in dn
4040
*/
4141
struct dnotify_mark_entry {
42-
struct fsnotify_mark_entry fsn_entry;
42+
struct fsnotify_mark fsn_entry;
4343
struct dnotify_struct *dn;
4444
};
4545

@@ -51,7 +51,7 @@ struct dnotify_mark_entry {
5151
* it calls the fsnotify function so it can update the set of all events relevant
5252
* to this inode.
5353
*/
54-
static void dnotify_recalc_inode_mask(struct fsnotify_mark_entry *entry)
54+
static void dnotify_recalc_inode_mask(struct fsnotify_mark *entry)
5555
{
5656
__u32 new_mask, old_mask;
5757
struct dnotify_struct *dn;
@@ -85,7 +85,7 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark_entry *entry)
8585
static int dnotify_handle_event(struct fsnotify_group *group,
8686
struct fsnotify_event *event)
8787
{
88-
struct fsnotify_mark_entry *entry = NULL;
88+
struct fsnotify_mark *entry = NULL;
8989
struct dnotify_mark_entry *dnentry;
9090
struct inode *to_tell;
9191
struct dnotify_struct *dn;
@@ -136,7 +136,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
136136
struct inode *inode, struct vfsmount *mnt,
137137
__u32 mask, void *data, int data_type)
138138
{
139-
struct fsnotify_mark_entry *entry;
139+
struct fsnotify_mark *entry;
140140
bool send;
141141

142142
/* !dir_notify_enable should never get here, don't waste time checking
@@ -163,7 +163,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
163163
return send;
164164
}
165165

166-
static void dnotify_free_mark(struct fsnotify_mark_entry *entry)
166+
static void dnotify_free_mark(struct fsnotify_mark *entry)
167167
{
168168
struct dnotify_mark_entry *dnentry = container_of(entry,
169169
struct dnotify_mark_entry,
@@ -184,14 +184,14 @@ static struct fsnotify_ops dnotify_fsnotify_ops = {
184184

185185
/*
186186
* Called every time a file is closed. Looks first for a dnotify mark on the
187-
* inode. If one is found run all of the ->dn entries attached to that
187+
* inode. If one is found run all of the ->dn structures attached to that
188188
* mark for one relevant to this process closing the file and remove that
189189
* dnotify_struct. If that was the last dnotify_struct also remove the
190-
* fsnotify_mark_entry.
190+
* fsnotify_mark.
191191
*/
192192
void dnotify_flush(struct file *filp, fl_owner_t id)
193193
{
194-
struct fsnotify_mark_entry *entry;
194+
struct fsnotify_mark *entry;
195195
struct dnotify_mark_entry *dnentry;
196196
struct dnotify_struct *dn;
197197
struct dnotify_struct **prev;
@@ -260,7 +260,7 @@ static __u32 convert_arg(unsigned long arg)
260260

261261
/*
262262
* If multiple processes watch the same inode with dnotify there is only one
263-
* dnotify mark in inode->i_fsnotify_mark_entries but we chain a dnotify_struct
263+
* dnotify mark in inode->i_fsnotify_marks but we chain a dnotify_struct
264264
* onto that mark. This function either attaches the new dnotify_struct onto
265265
* that list, or it |= the mask onto an existing dnofiy_struct.
266266
*/
@@ -298,7 +298,7 @@ static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark_entry *dnent
298298
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
299299
{
300300
struct dnotify_mark_entry *new_dnentry, *dnentry;
301-
struct fsnotify_mark_entry *new_entry, *entry;
301+
struct fsnotify_mark *new_entry, *entry;
302302
struct dnotify_struct *dn;
303303
struct inode *inode;
304304
fl_owner_t id = current->files;
@@ -378,7 +378,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
378378
/* if (f != filp) means that we lost a race and another task/thread
379379
* actually closed the fd we are still playing with before we grabbed
380380
* the dnotify_mark_mutex and entry->lock. Since closing the fd is the
381-
* only time we clean up the mark entries we need to get our mark off
381+
* only time we clean up the marks we need to get our mark off
382382
* the list. */
383383
if (f != filp) {
384384
/* if we added ourselves, shoot ourselves, it's possible that

‎fs/notify/group.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ void fsnotify_recalc_group_mask(struct fsnotify_group *group)
7474
{
7575
__u32 mask = 0;
7676
__u32 old_mask = group->mask;
77-
struct fsnotify_mark_entry *entry;
77+
struct fsnotify_mark *entry;
7878

7979
spin_lock(&group->mark_lock);
80-
list_for_each_entry(entry, &group->mark_entries, g_list)
80+
list_for_each_entry(entry, &group->marks_list, g_list)
8181
mask |= entry->mask;
8282
spin_unlock(&group->mark_lock);
8383

@@ -133,7 +133,7 @@ void fsnotify_final_destroy_group(struct fsnotify_group *group)
133133
*/
134134
static void fsnotify_destroy_group(struct fsnotify_group *group)
135135
{
136-
/* clear all inode mark entries for this group */
136+
/* clear all inode marks for this group */
137137
fsnotify_clear_marks_by_group(group);
138138

139139
/* past the point of no return, matches the initial value of 1 */
@@ -224,7 +224,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
224224
INIT_LIST_HEAD(&group->vfsmount_group_list);
225225

226226
spin_lock_init(&group->mark_lock);
227-
INIT_LIST_HEAD(&group->mark_entries);
227+
INIT_LIST_HEAD(&group->marks_list);
228228

229229
group->ops = ops;
230230

‎fs/notify/inode_mark.c‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
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
*
@@ -61,7 +61,7 @@
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
@@ -95,12 +95,12 @@
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
*/
112112
static 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
*/
222222
void 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
*/
244244
void 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

‎fs/notify/inotify/inotify.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ struct inotify_event_private_data {
1010
};
1111

1212
struct inotify_inode_mark_entry {
13-
/* fsnotify_mark_entry MUST be the first thing */
14-
struct fsnotify_mark_entry fsn_entry;
13+
/* fsnotify_mark MUST be the first thing */
14+
struct fsnotify_mark fsn_entry;
1515
int wd;
1616
};
1717

18-
extern void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
18+
extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *entry,
1919
struct fsnotify_group *group);
2020
extern void inotify_free_event_priv(struct fsnotify_event_private_data *event_priv);
2121

‎fs/notify/inotify/inotify_fsnotify.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int inotify_merge(struct list_head *list, struct fsnotify_event *event)
8888

8989
static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_event *event)
9090
{
91-
struct fsnotify_mark_entry *entry;
91+
struct fsnotify_mark *entry;
9292
struct inotify_inode_mark_entry *ientry;
9393
struct inode *to_tell;
9494
struct inotify_event_private_data *event_priv;
@@ -135,7 +135,7 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev
135135
return ret;
136136
}
137137

138-
static void inotify_freeing_mark(struct fsnotify_mark_entry *entry, struct fsnotify_group *group)
138+
static void inotify_freeing_mark(struct fsnotify_mark *entry, struct fsnotify_group *group)
139139
{
140140
inotify_ignored_and_remove_idr(entry, group);
141141
}
@@ -144,7 +144,7 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode
144144
struct vfsmount *mnt, __u32 mask, void *data,
145145
int data_type)
146146
{
147-
struct fsnotify_mark_entry *entry;
147+
struct fsnotify_mark *entry;
148148
bool send;
149149

150150
spin_lock(&inode->i_lock);
@@ -171,7 +171,7 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode
171171
*/
172172
static int idr_callback(int id, void *p, void *data)
173173
{
174-
struct fsnotify_mark_entry *entry;
174+
struct fsnotify_mark *entry;
175175
struct inotify_inode_mark_entry *ientry;
176176
static bool warned = false;
177177

‎fs/notify/inotify/inotify_user.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static struct inotify_inode_mark_entry *inotify_idr_find_locked(struct fsnotify_
386386

387387
ientry = idr_find(idr, wd);
388388
if (ientry) {
389-
struct fsnotify_mark_entry *fsn_entry = &ientry->fsn_entry;
389+
struct fsnotify_mark *fsn_entry = &ientry->fsn_entry;
390390

391391
fsnotify_get_mark(fsn_entry);
392392
/* One ref for being in the idr, one ref we just took */
@@ -499,7 +499,7 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
499499
/*
500500
* Send IN_IGNORED for this wd, remove this wd from the idr.
501501
*/
502-
void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
502+
void inotify_ignored_and_remove_idr(struct fsnotify_mark *entry,
503503
struct fsnotify_group *group)
504504
{
505505
struct inotify_inode_mark_entry *ientry;
@@ -541,7 +541,7 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
541541
}
542542

543543
/* ding dong the mark is dead */
544-
static void inotify_free_mark(struct fsnotify_mark_entry *entry)
544+
static void inotify_free_mark(struct fsnotify_mark *entry)
545545
{
546546
struct inotify_inode_mark_entry *ientry;
547547

@@ -554,7 +554,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
554554
struct inode *inode,
555555
u32 arg)
556556
{
557-
struct fsnotify_mark_entry *entry;
557+
struct fsnotify_mark *entry;
558558
struct inotify_inode_mark_entry *ientry;
559559
__u32 old_mask, new_mask;
560560
__u32 mask;

‎include/linux/fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ struct inode {
768768

769769
#ifdef CONFIG_FSNOTIFY
770770
__u32 i_fsnotify_mask; /* all events this inode cares about */
771-
struct hlist_head i_fsnotify_mark_entries; /* fsnotify mark entries */
771+
struct hlist_head i_fsnotify_marks;
772772
#endif
773773

774774
unsigned long i_state;

0 commit comments

Comments
 (0)