summaryrefslogtreecommitdiff
path: root/fs/notify
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-10-18 16:31:27 -0400
committerEric Paris <eparis@redhat.com>2009-11-06 13:19:00 -0500
commit3030b83239c5b3935b7b9ed9f1694c902c532e34 (patch)
treeb88f971a5ea141b0deaf3111afecfa2911403a45 /fs/notify
parentd72c245c1f2eb1400183f6a7387b28296938232c (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')
-rw-r--r--fs/notify/dnotify/dnotify.c4
-rw-r--r--fs/notify/inode_mark.c28
-rw-r--r--fs/notify/inotify/inotify_fsnotify.c2
-rw-r--r--fs/notify/inotify/inotify_user.c10
4 files changed, 22 insertions, 22 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c
index 9eddafa4c7ba..fc3a9dc567c5 100644
--- a/fs/notify/dnotify/dnotify.c
+++ b/fs/notify/dnotify/dnotify.c
@@ -70,8 +70,8 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark_entry *entry)
if (old_mask == new_mask)
return;
- if (entry->inode)
- fsnotify_recalc_inode_mask(entry->inode);
+ if (entry->i.inode)
+ fsnotify_recalc_inode_mask(entry->i.inode);
}
/*
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 */
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index 88198da7b30f..badf1a90bff9 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -192,7 +192,7 @@ static int idr_callback(int id, void *p, void *data)
*/
if (entry)
printk(KERN_WARNING "entry->group=%p inode=%p wd=%d\n",
- entry->group, entry->inode, ientry->wd);
+ entry->group, entry->i.inode, ientry->wd);
return 0;
}
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index 1dd7b09924f2..f323a026e83c 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -453,7 +453,7 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
if (wd == -1) {
printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p"
" ientry->inode=%p\n", __func__, ientry, ientry->wd,
- ientry->fsn_entry.group, ientry->fsn_entry.inode);
+ ientry->fsn_entry.group, ientry->fsn_entry.i.inode);
WARN_ON(1);
goto out;
}
@@ -463,7 +463,7 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
if (unlikely(!found_ientry)) {
printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p"
" ientry->inode=%p\n", __func__, ientry, ientry->wd,
- ientry->fsn_entry.group, ientry->fsn_entry.inode);
+ ientry->fsn_entry.group, ientry->fsn_entry.i.inode);
WARN_ON(1);
goto out;
}
@@ -479,9 +479,9 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
"entry->inode=%p found_ientry=%p found_ientry->wd=%d "
"found_ientry->group=%p found_ientry->inode=%p\n",
__func__, ientry, ientry->wd, ientry->fsn_entry.group,
- ientry->fsn_entry.inode, found_ientry, found_ientry->wd,
+ ientry->fsn_entry.i.inode, found_ientry, found_ientry->wd,
found_ientry->fsn_entry.group,
- found_ientry->fsn_entry.inode);
+ found_ientry->fsn_entry.i.inode);
goto out;
}
@@ -493,7 +493,7 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
if (unlikely(atomic_read(&ientry->fsn_entry.refcnt) < 3)) {
printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p"
" ientry->inode=%p\n", __func__, ientry, ientry->wd,
- ientry->fsn_entry.group, ientry->fsn_entry.inode);
+ ientry->fsn_entry.group, ientry->fsn_entry.i.inode);
/* we can't really recover with bad ref cnting.. */
BUG();
}