Skip to contentSkip to conversation

ext2: guard reservation window dump with EXT2FS_DEBUG

PATCH In review Milos Nikic 2 participants 3 messages Feb 7 – Feb 27 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext2: guard reservation window dump with EXT2FS_DEBUG

The function __rsv_window_dump() is a heavyweight debug tool that walks the reservation red-black tree. It is currently guarded by #if 1, forcing it to be compiled into all kernels, even production ones.

Match the rest of the file by guarding it with #ifdef EXT2FS_DEBUG, so it is only included when explicit debugging is enabled.

This removes the unused function code from standard builds.

---
 fs/ext2/balloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext2/balloc.c +2 -2
index b8cfab8f98b9..0fee01ed56d0 100644
@@ -201,7 +201,7 @@ static void group_adjust_blocks(struct super_block *sb, int group_no,
  * windows(start, end). Otherwise, it will only print out the "bad" windows,
  * those windows that overlap with their immediate neighbors.
  */
-#if 1
+#ifdef EXT2FS_DEBUG
 static void __rsv_window_dump(struct rb_root *root, int verbose,
 			      const char *fn)
 {
@@ -248,7 +248,7 @@ static void __rsv_window_dump(struct rb_root *root, int verbose,
 	__rsv_window_dump((root), (verbose), __func__)
 #else
 #define rsv_window_dump(root, verbose) do {} while (0)
-#endif
+#endif /* EXT2FS_DEBUG */
 
 /**
  * goal_in_my_reservation()
Signature · 1 line
2.52.0
#1 lore raw

Hi Jan,

Just a friendly ping on this patch now that a few weeks have passed. Let me know if you need any changes!

Thanks,
Milos

#2 lore raw
Quoted 4 lines · Milos Nikic

Hi Jan,

Just a friendly ping on this patch now that a few weeks have passed. Let me know if you need any changes!

Thanks, merged now.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR