diff options
| author | Eric Paris <eparis@redhat.com> | 2009-12-17 21:24:24 -0500 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:54 -0400 |
| commit | 000285deb99a5e0636fdd3c6a2483a5d039ee2c2 (patch) | |
| tree | 45b13f2253265703a540bdd99685f4f56ac8e21b | |
| parent | 841bdc10f573aa010dd5818d35a5690b7d9f73ce (diff) | |
inotify: rename mark_entry to just mark
rename anything in inotify that deals with mark_entry to just be mark. It
makes a lot more sense.
Signed-off-by: Eric Paris <eparis@redhat.com>
| -rw-r--r-- | fs/notify/inotify/inotify.h | 7 | ||||
| -rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 48 | ||||
| -rw-r--r-- | fs/notify/inotify/inotify_user.c | 192 |
3 files changed, 123 insertions, 124 deletions
diff --git a/fs/notify/inotify/inotify.h b/fs/notify/inotify/inotify.h index 07be6df2428f..b6642e4de4bf 100644 --- a/fs/notify/inotify/inotify.h +++ b/fs/notify/inotify/inotify.h | |||
| @@ -9,13 +9,12 @@ struct inotify_event_private_data { | |||
| 9 | int wd; | 9 | int wd; |
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | struct inotify_inode_mark_entry { | 12 | struct inotify_inode_mark { |
| 13 | /* fsnotify_mark MUST be the first thing */ | 13 | struct fsnotify_mark fsn_mark; |
| 14 | struct fsnotify_mark fsn_entry; | ||
| 15 | int wd; | 14 | int wd; |
| 16 | }; | 15 | }; |
| 17 | 16 | ||
| 18 | extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *entry, | 17 | extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark, |
| 19 | struct fsnotify_group *group); | 18 | struct fsnotify_group *group); |
| 20 | extern void inotify_free_event_priv(struct fsnotify_event_private_data *event_priv); | 19 | extern void inotify_free_event_priv(struct fsnotify_event_private_data *event_priv); |
| 21 | 20 | ||
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index f8a2a6eda133..12dc72be992e 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
| @@ -88,8 +88,8 @@ static int inotify_merge(struct list_head *list, struct fsnotify_event *event) | |||
| 88 | 88 | ||
| 89 | static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_event *event) | 89 | static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_event *event) |
| 90 | { | 90 | { |
| 91 | struct fsnotify_mark *entry; | 91 | struct fsnotify_mark *fsn_mark; |
| 92 | struct inotify_inode_mark_entry *ientry; | 92 | struct inotify_inode_mark *i_mark; |
| 93 | struct inode *to_tell; | 93 | struct inode *to_tell; |
| 94 | struct inotify_event_private_data *event_priv; | 94 | struct inotify_event_private_data *event_priv; |
| 95 | struct fsnotify_event_private_data *fsn_event_priv; | 95 | struct fsnotify_event_private_data *fsn_event_priv; |
| @@ -98,14 +98,14 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev | |||
| 98 | to_tell = event->to_tell; | 98 | to_tell = event->to_tell; |
| 99 | 99 | ||
| 100 | spin_lock(&to_tell->i_lock); | 100 | spin_lock(&to_tell->i_lock); |
| 101 | entry = fsnotify_find_mark(group, to_tell); | 101 | fsn_mark = fsnotify_find_mark(group, to_tell); |
| 102 | spin_unlock(&to_tell->i_lock); | 102 | spin_unlock(&to_tell->i_lock); |
| 103 | /* race with watch removal? We already passes should_send */ | 103 | /* race with watch removal? We already passes should_send */ |
| 104 | if (unlikely(!entry)) | 104 | if (unlikely(!fsn_mark)) |
| 105 | return 0; | 105 | return 0; |
| 106 | ientry = container_of(entry, struct inotify_inode_mark_entry, | 106 | i_mark = container_of(fsn_mark, struct inotify_inode_mark, |
| 107 | fsn_entry); | 107 | fsn_mark); |
| 108 | wd = ientry->wd; | 108 | wd = i_mark->wd; |
| 109 | 109 | ||
| 110 | event_priv = kmem_cache_alloc(event_priv_cachep, GFP_KERNEL); | 110 | event_priv = kmem_cache_alloc(event_priv_cachep, GFP_KERNEL); |
| 111 | if (unlikely(!event_priv)) | 111 | if (unlikely(!event_priv)) |
| @@ -127,37 +127,37 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | /* | 129 | /* |
| 130 | * If we hold the entry until after the event is on the queue | 130 | * If we hold the fsn_mark until after the event is on the queue |
| 131 | * IN_IGNORED won't be able to pass this event in the queue | 131 | * IN_IGNORED won't be able to pass this event in the queue |
| 132 | */ | 132 | */ |
| 133 | fsnotify_put_mark(entry); | 133 | fsnotify_put_mark(fsn_mark); |
| 134 | 134 | ||
| 135 | return ret; | 135 | return ret; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static void inotify_freeing_mark(struct fsnotify_mark *entry, struct fsnotify_group *group) | 138 | static void inotify_freeing_mark(struct fsnotify_mark *fsn_mark, struct fsnotify_group *group) |
| 139 | { | 139 | { |
| 140 | inotify_ignored_and_remove_idr(entry, group); | 140 | inotify_ignored_and_remove_idr(fsn_mark, group); |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | static bool inotify_should_send_event(struct fsnotify_group *group, struct inode *inode, | 143 | static bool inotify_should_send_event(struct fsnotify_group *group, struct inode *inode, |
| 144 | struct vfsmount *mnt, __u32 mask, void *data, | 144 | struct vfsmount *mnt, __u32 mask, void *data, |
| 145 | int data_type) | 145 | int data_type) |
| 146 | { | 146 | { |
| 147 | struct fsnotify_mark *entry; | 147 | struct fsnotify_mark *fsn_mark; |
| 148 | bool send; | 148 | bool send; |
| 149 | 149 | ||
| 150 | spin_lock(&inode->i_lock); | 150 | spin_lock(&inode->i_lock); |
| 151 | entry = fsnotify_find_mark(group, inode); | 151 | fsn_mark = fsnotify_find_mark(group, inode); |
| 152 | spin_unlock(&inode->i_lock); | 152 | spin_unlock(&inode->i_lock); |
| 153 | if (!entry) | 153 | if (!fsn_mark) |
| 154 | return false; | 154 | return false; |
| 155 | 155 | ||
| 156 | mask = (mask & ~FS_EVENT_ON_CHILD); | 156 | mask = (mask & ~FS_EVENT_ON_CHILD); |
| 157 | send = (entry->mask & mask); | 157 | send = (fsn_mark->mask & mask); |
| 158 | 158 | ||
| 159 | /* find took a reference */ | 159 | /* find took a reference */ |
| 160 | fsnotify_put_mark(entry); | 160 | fsnotify_put_mark(fsn_mark); |
| 161 | 161 | ||
| 162 | return send; | 162 | return send; |
| 163 | } | 163 | } |
| @@ -171,18 +171,18 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode | |||
| 171 | */ | 171 | */ |
| 172 | static int idr_callback(int id, void *p, void *data) | 172 | static int idr_callback(int id, void *p, void *data) |
| 173 | { | 173 | { |
| 174 | struct fsnotify_mark *entry; | 174 | struct fsnotify_mark *fsn_mark; |
| 175 | struct inotify_inode_mark_entry *ientry; | 175 | struct inotify_inode_mark *i_mark; |
| 176 | static bool warned = false; | 176 | static bool warned = false; |
| 177 | 177 | ||
| 178 | if (warned) | 178 | if (warned) |
| 179 | return 0; | 179 | return 0; |
| 180 | 180 | ||
| 181 | warned = true; | 181 | warned = true; |
| 182 | entry = p; | 182 | fsn_mark = p; |
| 183 | ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); | 183 | i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark); |
| 184 | 184 | ||
| 185 | WARN(1, "inotify closing but id=%d for entry=%p in group=%p still in " | 185 | WARN(1, "inotify closing but id=%d for fsn_mark=%p in group=%p still in " |
| 186 | "idr. Probably leaking memory\n", id, p, data); | 186 | "idr. Probably leaking memory\n", id, p, data); |
| 187 | 187 | ||
| 188 | /* | 188 | /* |
| @@ -191,9 +191,9 @@ static int idr_callback(int id, void *p, void *data) | |||
| 191 | * out why we got here and the panic is no worse than the original | 191 | * out why we got here and the panic is no worse than the original |
| 192 | * BUG() that was here. | 192 | * BUG() that was here. |
| 193 | */ | 193 | */ |
| 194 | if (entry) | 194 | if (fsn_mark) |
| 195 | printk(KERN_WARNING "entry->group=%p inode=%p wd=%d\n", | 195 | printk(KERN_WARNING "fsn_mark->group=%p inode=%p wd=%d\n", |
| 196 | entry->group, entry->i.inode, ientry->wd); | 196 | fsn_mark->group, fsn_mark->i.inode, i_mark->wd); |
| 197 | return 0; | 197 | return 0; |
| 198 | } | 198 | } |
| 199 | 199 | ||
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 118085c9d2d9..80d102acb86b 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
| @@ -353,7 +353,7 @@ static int inotify_find_inode(const char __user *dirname, struct path *path, uns | |||
| 353 | 353 | ||
| 354 | static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock, | 354 | static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock, |
| 355 | int *last_wd, | 355 | int *last_wd, |
| 356 | struct inotify_inode_mark_entry *ientry) | 356 | struct inotify_inode_mark *i_mark) |
| 357 | { | 357 | { |
