aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-17 21:24:23 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:58:52 -0400
commit2823e04de4f1a49087b58ff2bb8f61361ffd9321 (patch)
tree0467ddf513cfb9ec76f3fe498bdc9b5084008c84 /kernel
parent3a9fb89f4cd04c23e16397befba92efb5d989b74 (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 'kernel')
-rw-r--r--kernel/audit_tree.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index ecf0bf260d0..c21b05d2522 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -179,9 +179,9 @@ static void insert_hash(struct audit_chunk *chunk)
179 struct fsnotify_mark_entry *entry = &chunk->mark; 179 struct fsnotify_mark_entry *entry = &chunk->mark;
180 struct list_head *list; 180 struct list_head *list;
181 181
182 if (!entry->inode) 182 if (!entry->i.inode)
183 return; 183 return;
184 list = chunk_hash(entry->inode); 184 list = chunk_hash(entry->i.inode);
185 list_add_rcu(&chunk->hash, list); 185 list_add_rcu(&chunk->hash, list);
186} 186}
187 187
@@ -193,7 +193,7 @@ struct audit_chunk *audit_tree_lookup(const struct inode *inode)
193 193
194 list_for_each_entry_rcu(p, list, hash) { 194 list_for_each_entry_rcu(p, list, hash) {
195 /* mark.inode may have gone NULL, but who cares? */ 195 /* mark.inode may have gone NULL, but who cares? */
196 if (p->mark.inode == inode) { 196 if (p->mark.i.inode == inode) {
197 atomic_long_inc(&p->refs); 197 atomic_long_inc(&p->refs);
198 return p; 198 return p;
199 } 199 }
@@ -233,7 +233,7 @@ static void untag_chunk(struct node *p)
233 spin_unlock(&hash_lock); 233 spin_unlock(&hash_lock);
234 234
235 spin_lock(&entry->lock); 235 spin_lock(&entry->lock);
236 if (chunk->dead || !entry->inode) { 236 if (chunk->dead || !entry->i.inode) {
237 spin_unlock(&entry->lock); 237 spin_unlock(&entry->lock);
238 goto out; 238 goto out;
239 } 239 }
@@ -259,7 +259,7 @@ static void untag_chunk(struct node *p)
259 if (!new) 259 if (!new)
260 goto Fallback; 260 goto Fallback;
261 fsnotify_duplicate_mark(&new->mark, entry); 261 fsnotify_duplicate_mark(&new->mark, entry);
262 if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.inode, 1)) { 262 if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.i.inode, 1)) {
263 free_chunk(new); 263 free_chunk(new);
264 goto Fallback; 264 goto Fallback;
265 } 265 }
@@ -388,7 +388,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
388 chunk_entry = &chunk->mark; 388 chunk_entry = &chunk->mark;
389 389
390 spin_lock(&old_entry->lock); 390 spin_lock(&old_entry->lock);
391 if (!old_entry->inode) { 391 if (!old_entry->i.inode) {
392 /* old_entry is being shot, lets just lie */ 392 /* old_entry is being shot, lets just lie */
393 spin_unlock(&old_entry->lock); 393 spin_unlock(&old_entry->lock);
394 fsnotify_put_mark(old_entry); 394 fsnotify_put_mark(old_entry);
@@ -397,7 +397,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
397 } 397 }
398 398
399 fsnotify_duplicate_mark(chunk_entry, old_entry); 399 fsnotify_duplicate_mark(chunk_entry, old_entry);
400 if (fsnotify_add_mark(chunk_entry, chunk_entry->group, chunk_entry->inode, 1)) { 400 if (fsnotify_add_mark(chunk_entry, chunk_entry->group, chunk_entry->i.inode, 1)) {
401 spin_unlock(&old_entry->lock); 401 spin_unlock(&old_entry->lock);
402 free_chunk(chunk); 402 free_chunk(chunk);
403 fsnotify_put_mark(old_entry); 403 fsnotify_put_mark(old_entry);
@@ -605,7 +605,7 @@ void audit_trim_trees(void)
605 list_for_each_entry(node, &tree->chunks, list) { 605 list_for_each_entry(node, &tree->chunks, list) {
606 struct audit_chunk *chunk = find_chunk(node); 606 struct audit_chunk *chunk = find_chunk(node);
607 /* this could be NULL if the watch is dieing else where... */ 607 /* this could be NULL if the watch is dieing else where... */
608 struct inode *inode = chunk->mark.inode; 608 struct inode *inode = chunk->mark.i.inode;
609 node->index |= 1U<<31; 609 node->index |= 1U<<31;
610 if (iterate_mounts(compare_root, inode, root_mnt)) 610 if (iterate_mounts(compare_root, inode, root_mnt))
611 node->index &= ~(1U<<31); 611 node->index &= ~(1U<<31);