From 2823e04de4f1a49087b58ff2bb8f61361ffd9321 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Thu, 17 Dec 2009 21:24:23 -0500 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 --- include/linux/fsnotify_backend.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/linux/fsnotify_backend.h') diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index c2a04b7e4fca..dca7f2cbde90 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -226,6 +226,15 @@ struct fsnotify_event { struct list_head private_data_list; /* groups can store private data here */ }; +/* + * Inode specific fields in an fsnotify_mark_entry + */ +struct fsnotify_inode_mark { + struct inode *inode; /* inode this entry is associated with */ + struct hlist_node i_list; /* list of mark_entries by inode->i_fsnotify_mark_entries */ + struct list_head free_i_list; /* tmp list used when freeing this mark */ +}; + /* * a mark is simply an entry attached to an in core inode which allows an * fsnotify listener to indicate they are either no longer interested in events @@ -241,12 +250,12 @@ struct fsnotify_mark_entry { /* we hold ref for each i_list and g_list. also one ref for each 'thing' * in kernel that found and may be using this mark. */ atomic_t refcnt; /* active things looking at this mark */ - struct inode *inode; /* inode this entry is associated with */ struct fsnotify_group *group; /* group this mark entry is for */ - struct hlist_node i_list; /* list of mark_entries by inode->i_fsnotify_mark_entries */ struct list_head g_list; /* list of mark_entries by group->i_fsnotify_mark_entries */ - spinlock_t lock; /* protect group, inode, and killme */ - struct list_head free_i_list; /* tmp list used when freeing this mark */ + spinlock_t lock; /* protect group and inode */ + union { + struct fsnotify_inode_mark i; + }; struct list_head free_g_list; /* tmp list used when freeing this mark */ void (*free_mark)(struct fsnotify_mark_entry *entry); /* called on final put+free */ }; -- cgit v1.2.1