Skip to content

Commit ad0e966

Browse files
mnikicjankara
authored andcommitted
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. Signed-off-by: Milos Nikic <nikic.milos@gmail.com> Link: https://patch.msgid.link/20260207022920.258247-1-nikic.milos@gmail.com Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 0cf9c58 commit ad0e966

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/ext2/balloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static void group_adjust_blocks(struct super_block *sb, int group_no,
201201
* windows(start, end). Otherwise, it will only print out the "bad" windows,
202202
* those windows that overlap with their immediate neighbors.
203203
*/
204-
#if 1
204+
#ifdef EXT2FS_DEBUG
205205
static void __rsv_window_dump(struct rb_root *root, int verbose,
206206
const char *fn)
207207
{
@@ -248,7 +248,7 @@ static void __rsv_window_dump(struct rb_root *root, int verbose,
248248
__rsv_window_dump((root), (verbose), __func__)
249249
#else
250250
#define rsv_window_dump(root, verbose) do {} while (0)
251-
#endif
251+
#endif /* EXT2FS_DEBUG */
252252

253253
/**
254254
* goal_in_my_reservation()

0 commit comments

Comments
 (0)