xfs: clean up some inconsistent indenting
Subsystems (2)
PATCH 1/1 xfs: clean up some inconsistent indenting
From: Colin Ian King <[email protected]>
There are bunch of statements where the indentation is not correct, clean these up.
--- fs/xfs/xfs_log.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-)
fs/xfs/xfs_log.c +14 -15
@@ -3700,21 +3700,20 @@ xlog_verify_tail_lsn(xfs_lsn_t tail_lsn =be64_to_cpu (iclog->ic_header.h_tail_lsn);int blocks; -if (CYCLE_LSN (tail_lsn) == log->l_prev_cycle) { - blocks = - log->l_logBBsize - (log->l_prev_block -BLOCK_LSN (tail_lsn)); -if (blocks <BTOBB (iclog->ic_offset)+BTOBB (log->l_iclog_hsize)) -xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__); - }else { -ASSERT (CYCLE_LSN (tail_lsn)+1 == log->l_prev_cycle); - -if (BLOCK_LSN (tail_lsn) == log->l_prev_block) -xfs_emerg (log->l_mp,"%s: tail wrapped" , __func__); - - blocks =BLOCK_LSN (tail_lsn) - log->l_prev_block; -if (blocks <BTOBB (iclog->ic_offset) +1 ) -xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__); - } +if (CYCLE_LSN (tail_lsn) == log->l_prev_cycle) { + blocks = log->l_logBBsize - (log->l_prev_block -BLOCK_LSN (tail_lsn)); +if (blocks <BTOBB (iclog->ic_offset)+BTOBB (log->l_iclog_hsize)) +xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__); + }else { +ASSERT (CYCLE_LSN (tail_lsn)+1 == log->l_prev_cycle); + +if (BLOCK_LSN (tail_lsn) == log->l_prev_block) +xfs_emerg (log->l_mp,"%s: tail wrapped" , __func__); + + blocks =BLOCK_LSN (tail_lsn) - log->l_prev_block; +if (blocks <BTOBB (iclog->ic_offset) +1 ) +xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__); + } }/*
Signature · 1 line
2.32.0
Quoted 9 lines · Colin King
From: Colin Ian King <[email protected]>
There are bunch of statements where the indentation is not correct, clean these up.
Signed-off-by Colin Ian King <[email protected]>--- fs/xfs/xfs_log.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-)
Good idea, but I see no point in only fixing one of the many style violations this ancient debug code has whilst introducing new ones (i.e line lengths > 80 columns).
Quoted 15 lines
fs/xfs/xfs_log.c +0
-7@@ -3700,21 +3700,20 @@ xlog_verify_tail_lsn(xfs_lsn_t tail_lsn =be64_to_cpu (iclog->ic_header.h_tail_lsn);int blocks; -if (CYCLE_LSN (tail_lsn) == log->l_prev_cycle) { - blocks = - log->l_logBBsize - (log->l_prev_block -BLOCK_LSN (tail_lsn)); -if (blocks <BTOBB (iclog->ic_offset)+BTOBB (log->l_iclog_hsize)) -xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__); - }else { -ASSERT (CYCLE_LSN (tail_lsn)+1 == log->l_prev_cycle);
fs/xfs/xfs_log.c xlog_verify_tail_lsn( · line 3704
Quoted 10 lines
fs/xfs/xfs_log.c +2
-8- -if (BLOCK_LSN (tail_lsn) == log->l_prev_block) -xfs_emerg (log->l_mp,"%s: tail wrapped" , __func__); - - blocks =BLOCK_LSN (tail_lsn) - log->l_prev_block; -if (blocks <BTOBB (iclog->ic_offset) +1 ) -xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__); - } +if (CYCLE_LSN (tail_lsn) == log->l_prev_cycle) { + blocks = log->l_logBBsize - (log->l_prev_block -BLOCK_LSN (tail_lsn));
Line length.
fs/xfs/xfs_log.c xlog_verify_tail_lsn( · line 3705
Quoted 1 line
fs/xfs/xfs_log.c +1
-0+if (blocks <BTOBB (iclog->ic_offset)+BTOBB (log->l_iclog_hsize))
Lack of whitespace around "="
fs/xfs/xfs_log.c xlog_verify_tail_lsn( · line 3706
Quoted 1 line
fs/xfs/xfs_log.c +1
-0+xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__);
Line length.
fs/xfs/xfs_log.c xlog_verify_tail_lsn( · line 3707
Quoted 1 line
fs/xfs/xfs_log.c +1
-0+ }else {
Return from the if {} block rather than using an else statement, and the indent of this block doesn't change:
fs/xfs/xfs_log.c xlog_verify_tail_lsn( · line 3708
Quoted 1 line
fs/xfs/xfs_log.c +1
-0+ASSERT (CYCLE_LSN (tail_lsn)+1 == log->l_prev_cycle);
Whitespace.
fs/xfs/xfs_log.c xlog_verify_tail_lsn( · line 3715
Quoted 7 lines
fs/xfs/xfs_log.c +7
-0+ +if (BLOCK_LSN (tail_lsn) == log->l_prev_block) +xfs_emerg (log->l_mp,"%s: tail wrapped" , __func__); + + blocks =BLOCK_LSN (tail_lsn) - log->l_prev_block; +if (blocks <BTOBB (iclog->ic_offset) +1 ) +xfs_emerg (log->l_mp,"%s: ran out of log space" , __func__);
And because this doesn't need indent because of the return above, it won't violate line length limits...
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]