diff options
author | Eric Paris <eparis@redhat.com> | 2009-12-17 21:24:23 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:52 -0400 |
commit | 2823e04de4f1a49087b58ff2bb8f61361ffd9321 (patch) | |
tree | 0467ddf513cfb9ec76f3fe498bdc9b5084008c84 /fs/notify/inode_mark.c | |
parent | 3a9fb89f4cd04c23e16397befba92efb5d989b74 (diff) |
fsnotify: put inode specific fields in an fsnotify_mark in a union
The addition of marks on vfs mounts will be simplified if the inode
specific parts of a mark and the vfsmnt specific parts of a mark are
actually in a union so naming can be easy. This patch just implements the
inode struct and the union.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r-- | fs/notify/inode_mark.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index beffebb64627..6731408c49f7 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
@@ -117,7 +117,7 @@ static void fsnotify_recalc_inode_mask_locked(struct inode *inode) | |||
117 | 117 | ||
118 | assert_spin_locked(&inode->i_lock); | 118 | assert_spin_locked(&inode->i_lock); |
119 | 119 | ||
120 | hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i_list) | 120 | hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i.i_list) |
121 | new_mask |= entry->mask; | 121 | new_mask |= entry->mask; |
122 | inode->i_fsnotify_mask = new_mask; | 122 | inode->i_fsnotify_mask = new_mask; |
123 | } | 123 | } |
@@ -148,7 +148,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry) | |||
148 | spin_lock(&entry->lock); | 148 | spin_lock(&entry->lock); |
149 | 149 | ||
150 | group = entry->group; | 150 | group = entry->group; |
151 | inode = entry->inode; | 151 | inode = entry->i.inode; |
152 | 152 | ||
153 | BUG_ON(group && !inode); | 153 | BUG_ON(group && !inode); |
154 | BUG_ON(!group && inode); | 154 | BUG_ON(!group && inode); |
@@ -165,8 +165,8 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry) | |||
165 | spin_lock(&group->mark_lock); | 165 | spin_lock(&group->mark_lock); |
166 | spin_lock(&inode->i_lock); | 166 | spin_lock(&inode->i_lock); |
167 | 167 | ||
168 | hlist_del_init(&entry->i_list); | 168 | hlist_del_init(&entry->i.i_list); |
169 | entry->inode = NULL; | 169 | entry->i.inode = NULL; |
170 | 170 | ||
171 | list_del_init(&entry->g_list); | 171 | list_del_init(&entry->g_list); |
172 | entry->group = NULL; | 172 | entry->group = NULL; |
@@ -248,14 +248,14 @@ void fsnotify_clear_marks_by_inode(struct inode *inode) | |||
248 | LIST_HEAD(free_list); | 248 | LIST_HEAD(free_list); |
249 | 249 | ||
250 | spin_lock(&inode->i_lock); | 250 | spin_lock(&inode->i_lock); |
251 | hlist_for_each_entry_safe(entry, pos, n, &inode->i_fsnotify_mark_entries, i_list) { | 251 | hlist_for_each_entry_safe(entry, pos, n, &inode->i_fsnotify_mark_entries, i.i_list) { |
252 | list_add(&entry->free_i_list, &free_list); | 252 | list_add(&entry->i.free_i_list, &free_list); |
253 | hlist_del_init(&entry->i_list); | 253 | hlist_del_init(&entry->i.i_list); |
254 | fsnotify_get_mark(entry); | 254 | fsnotify_get_mark(entry); |
255 | } | 255 | } |
256 | spin_unlock(&inode->i_lock); | 256 | spin_unlock(&inode->i_lock); |
257 | 257 | ||
258 | list_for_each_entry_safe(entry, lentry, &free_list, free_i_list) { | 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_by_entry(entry); |
260 | fsnotify_put_mark(entry); | 260 | fsnotify_put_mark(entry); |
261 | } | 261 | } |
@@ -273,7 +273,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou | |||
273 | 273 | ||
274 | assert_spin_locked(&inode->i_lock); | 274 | assert_spin_locked(&inode->i_lock); |
275 | 275 | ||
276 | hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i_list) { | 276 | hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i.i_list) { |
277 | if (entry->group == group) { | 277 | if (entry->group == group) { |
278 | fsnotify_get_mark(entry); | 278 | fsnotify_get_mark(entry); |
279 | return entry; | 279 | return entry; |
@@ -285,7 +285,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou | |||
285 | void fsnotify_duplicate_mark(struct fsnotify_mark_entry *new, struct fsnotify_mark_entry *old) | 285 | void fsnotify_duplicate_mark(struct fsnotify_mark_entry *new, struct fsnotify_mark_entry *old) |
286 | { | 286 | { |
287 | assert_spin_locked(&old->lock); | 287 | assert_spin_locked(&old->lock); |
288 | new->inode = old->inode; | 288 | new->i.inode = old->i.inode; |
289 | new->group = old->group; | 289 | new->group = old->group; |
290 | new->mask = old->mask; | 290 | new->mask = old->mask; |
291 | new->free_mark = old->free_mark; | 291 | new->free_mark = old->free_mark; |
@@ -299,10 +299,10 @@ void fsnotify_init_mark(struct fsnotify_mark_entry *entry, | |||
299 | { | 299 | { |
300 | spin_lock_init(&entry->lock); | 300 | spin_lock_init(&entry->lock); |
301 | atomic_set(&entry->refcnt, 1); | 301 | atomic_set(&entry->refcnt, 1); |
302 | INIT_HLIST_NODE(&entry->i_list); | 302 | INIT_HLIST_NODE(&entry->i.i_list); |
303 | entry->group = NULL; | 303 | entry->group = NULL; |
304 | entry->mask = 0; | 304 | entry->mask = 0; |
305 | entry->inode = NULL; | 305 | entry->i.inode = NULL; |
306 | entry->free_mark = free_mark; | 306 | entry->free_mark = free_mark; |
307 | } | 307 | } |
308 | 308 | ||
@@ -350,9 +350,9 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry, | |||
350 | lentry = fsnotify_find_mark_entry(group, inode); | 350 | lentry = fsnotify_find_mark_entry(group, inode); |
351 | if (!lentry) { | 351 | if (!lentry) { |
352 | entry->group = group; | 352 | entry->group = group; |
353 | entry->inode = inode; | 353 | entry->i.inode = inode; |
354 | 354 | ||
355 | hlist_add_head(&entry->i_list, &inode->i_fsnotify_mark_entries); | 355 | hlist_add_head(&entry->i.i_list, &inode->i_fsnotify_mark_entries); |
356 | list_add(&entry->g_list, &group->mark_entries); | 356 | list_add(&entry->g_list, &group->mark_entries); |
357 | 357 | ||
358 | fsnotify_get_mark(entry); /* for i_list and g_list */ | 358 | fsnotify_get_mark(entry); /* for i_list and g_list */ |