From 3030b83239c5b3935b7b9ed9f1694c902c532e34 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Sun, 18 Oct 2009 16:31:27 -0400 Subject: 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 --- fs/notify/inode_mark.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'fs/notify/inode_mark.c') diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index fe25723c3015..dd4f373b8d54 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c @@ -118,7 +118,7 @@ static void fsnotify_recalc_inode_mask_locked(struct inode *inode) assert_spin_locked(&inode->i_lock); - hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i_list) + hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i.i_list) new_mask |= entry->mask; inode->i_fsnotify_mask = new_mask; } @@ -149,7 +149,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry) spin_lock(&entry->lock); group = entry->group; - inode = entry->inode; + inode = entry->i.inode; BUG_ON(group && !inode); BUG_ON(!group && inode); @@ -166,8 +166,8 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry) spin_lock(&group->mark_lock); spin_lock(&inode->i_lock); - hlist_del_init(&entry->i_list); - entry->inode = NULL; + hlist_del_init(&entry->i.i_list); + entry->i.inode = NULL; list_del_init(&entry->g_list); entry->group = NULL; @@ -249,14 +249,14 @@ void fsnotify_clear_marks_by_inode(struct inode *inode) LIST_HEAD(free_list); spin_lock(&inode->i_lock); - hlist_for_each_entry_safe(entry, pos, n, &inode->i_fsnotify_mark_entries, i_list) { - list_add(&entry->free_i_list, &free_list); - hlist_del_init(&entry->i_list); + hlist_for_each_entry_safe(entry, pos, n, &inode->i_fsnotify_mark_entries, i.i_list) { + list_add(&entry->i.free_i_list, &free_list); + hlist_del_init(&entry->i.i_list); fsnotify_get_mark(entry); } spin_unlock(&inode->i_lock); - list_for_each_entry_safe(entry, lentry, &free_list, free_i_list) { + list_for_each_entry_safe(entry, lentry, &free_list, i.free_i_list) { fsnotify_destroy_mark_by_entry(entry); fsnotify_put_mark(entry); } @@ -274,7 +274,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou assert_spin_locked(&inode->i_lock); - hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i_list) { + hlist_for_each_entry(entry, pos, &inode->i_fsnotify_mark_entries, i.i_list) { if (entry->group == group) { fsnotify_get_mark(entry); return entry; @@ -286,7 +286,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou void fsnotify_duplicate_mark(struct fsnotify_mark_entry *new, struct fsnotify_mark_entry *old) { assert_spin_locked(&old->lock); - new->inode = old->inode; + new->i.inode = old->i.inode; new->group = old->group; new->mask = old->mask; new->free_mark = old->free_mark; @@ -300,10 +300,10 @@ void fsnotify_init_mark(struct fsnotify_mark_entry *entry, { spin_lock_init(&entry->lock); atomic_set(&entry->refcnt, 1); - INIT_HLIST_NODE(&entry->i_list); + INIT_HLIST_NODE(&entry->i.i_list); entry->group = NULL; entry->mask = 0; - entry->inode = NULL; + entry->i.inode = NULL; entry->free_mark = free_mark; } @@ -351,9 +351,9 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry, lentry = fsnotify_find_mark_entry(group, inode); if (!lentry) { entry->group = group; - entry->inode = inode; + entry->i.inode = inode; - hlist_add_head(&entry->i_list, &inode->i_fsnotify_mark_entries); + hlist_add_head(&entry->i.i_list, &inode->i_fsnotify_mark_entries); list_add(&entry->g_list, &group->mark_entries); fsnotify_get_mark(entry); /* for i_list and g_list */ -- cgit v1.2.3