diff options
author | Eric Sandeen <sandeen@redhat.com> | 2013-04-22 12:12:31 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-06 15:55:16 -0400 |
commit | 6d49ba1b47b9c6822d08f90af6f1a2d8ca1cf533 (patch) | |
tree | 316890f9d5ce407a6767b279620ee3131b6c8e75 /fs/btrfs/extent_io.h | |
parent | ace68bac61b338e52924d87ebdd0fa8c7439f896 (diff) |
btrfs: move leak debug code to functions
Clean up the leak debugging in extent_io.c by moving
the debug code into functions. This also removes the
list_heads used for debugging from the extent_buffer
and extent_state structures when debug is not enabled.
Since we need a global debug config to do that last
part, implement CONFIG_BTRFS_DEBUG to accommodate.
Thanks to Dave Sterba for the Kconfig bit.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index fa86861de244..59d883bc3ed3 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -116,7 +116,9 @@ struct extent_state { | |||
116 | /* for use by the FS */ | 116 | /* for use by the FS */ |
117 | u64 private; | 117 | u64 private; |
118 | 118 | ||
119 | #ifdef CONFIG_BTRFS_DEBUG | ||
119 | struct list_head leak_list; | 120 | struct list_head leak_list; |
121 | #endif | ||
120 | }; | 122 | }; |
121 | 123 | ||
122 | #define INLINE_EXTENT_BUFFER_PAGES 16 | 124 | #define INLINE_EXTENT_BUFFER_PAGES 16 |
@@ -132,7 +134,6 @@ struct extent_buffer { | |||
132 | atomic_t refs; | 134 | atomic_t refs; |
133 | atomic_t io_pages; | 135 | atomic_t io_pages; |
134 | int read_mirror; | 136 | int read_mirror; |
135 | struct list_head leak_list; | ||
136 | struct rcu_head rcu_head; | 137 | struct rcu_head rcu_head; |
137 | pid_t lock_owner; | 138 | pid_t lock_owner; |
138 | 139 | ||
@@ -159,6 +160,9 @@ struct extent_buffer { | |||
159 | wait_queue_head_t read_lock_wq; | 160 | wait_queue_head_t read_lock_wq; |
160 | wait_queue_head_t lock_wq; | 161 | wait_queue_head_t lock_wq; |
161 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES]; | 162 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES]; |
163 | #ifdef CONFIG_BTRFS_DEBUG | ||
164 | struct list_head leak_list; | ||
165 | #endif | ||
162 | }; | 166 | }; |
163 | 167 | ||
164 | static inline void extent_set_compress_type(unsigned long *bio_flags, | 168 | static inline void extent_set_compress_type(unsigned long *bio_flags, |