diff options
| author | Jan Kara <jack@suse.cz> | 2014-12-12 19:58:39 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 15:42:53 -0500 |
| commit | 37d469e7673a663cbf38360beb1eaa3224c9d272 (patch) | |
| tree | b980de73eb2a32cb759d57792c0028e634350b80 /include | |
| parent | 0809ab69a2782afac8c4d7f3d35cd123050aab9a (diff) | |
fsnotify: remove destroy_list from fsnotify_mark
destroy_list is used to track marks which still need waiting for srcu
period end before they can be freed. However by the time mark is added to
destroy_list it isn't in group's list of marks anymore and thus we can
reuse fsnotify_mark->g_list for queueing into destroy_list. This saves
two pointers for each fsnotify_mark.
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fsnotify_backend.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 442847a02b8f..0f313f93c586 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -212,7 +212,11 @@ struct fsnotify_mark { | |||
| 212 | * in kernel that found and may be using this mark. */ | 212 | * in kernel that found and may be using this mark. */ |
| 213 | atomic_t refcnt; /* active things looking at this mark */ | 213 | atomic_t refcnt; /* active things looking at this mark */ |
| 214 | struct fsnotify_group *group; /* group this mark is for */ | 214 | struct fsnotify_group *group; /* group this mark is for */ |
| 215 | struct list_head g_list; /* list of marks by group->i_fsnotify_marks */ | 215 | struct list_head g_list; /* list of marks by group->i_fsnotify_marks |
| 216 | * Also reused for queueing mark into | ||
| 217 | * destroy_list when it's waiting for | ||
| 218 | * the end of SRCU period before it can | ||
| 219 | * be freed */ | ||
| 216 | spinlock_t lock; /* protect group and inode */ | 220 | spinlock_t lock; /* protect group and inode */ |
| 217 | struct hlist_node obj_list; /* list of marks for inode / vfsmount */ | 221 | struct hlist_node obj_list; /* list of marks for inode / vfsmount */ |
| 218 | struct list_head free_list; /* tmp list used when freeing this mark */ | 222 | struct list_head free_list; /* tmp list used when freeing this mark */ |
| @@ -227,7 +231,6 @@ struct fsnotify_mark { | |||
| 227 | #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08 | 231 | #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08 |
| 228 | #define FSNOTIFY_MARK_FLAG_ALIVE 0x10 | 232 | #define FSNOTIFY_MARK_FLAG_ALIVE 0x10 |
| 229 | unsigned int flags; /* vfsmount or inode mark? */ | 233 | unsigned int flags; /* vfsmount or inode mark? */ |
| 230 | struct list_head destroy_list; | ||
| 231 | void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */ | 234 | void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */ |
| 232 | }; | 235 | }; |
| 233 | 236 | ||
