xfs: fix compiler warnings
PATCH v2 1/1 xfs: fix compiler warnings
Fix up all the compiler warnings that have crept in.
--- fs/xfs/libxfs/xfs_inode_fork.c | 9 +++------ fs/xfs/xfs_buf_item.c | 2 ++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-)
fs/xfs/libxfs/xfs_inode_fork.c +3 -6
@@ -1499,14 +1499,11 @@ xfs_iext_realloc_indirect(xfs_ifork_t *ifp,/* inode fork pointer */ int new_size) /* new indirection array size */ { - int nlists; /* number of irec's (ex lists) */ -int size;/* current indirection array size */ - ASSERT(ifp->if_flags & XFS_IFEXTIREC); - nlists = ifp->if_real_bytes /XFS_IEXT_BUFSZ ; - size = nlists *sizeof (xfs_ext_irec_t);ASSERT (ifp->if_real_bytes); -ASSERT ((new_size >=0 ) && (new_size != size)); +ASSERT ((new_size >=0 ) && + (new_size != ((ifp->if_real_bytes /XFS_IEXT_BUFSZ ) * +sizeof (xfs_ext_irec_t))));if (new_size ==0 ) {xfs_iext_destroy (ifp); }else {
fs/xfs/xfs_buf_item.c +2 -0
@@ -570,7 +570,9 @@ xfs_buf_item_unlock(bool aborted = !!(lip->li_flags &XFS_LI_ABORTED );bool hold = !!(bip->bli_flags &XFS_BLI_HOLD );bool dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG bool ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif /* Clear the buffer's association with this transaction. */ bp->b_transp =NULL ;
fs/xfs/xfs_log_recover.c +4 -0
@@ -4827,12 +4827,16 @@ xlog_recover_process_intents(int error =0 ;struct xfs_ail_cursor cur;struct xfs_ail *ailp; +#ifdef DEBUG xfs_lsn_t last_lsn; +#endif ailp = log->l_ailp;spin_lock (&ailp->xa_lock); lip =xfs_trans_ail_cursor_first (ailp, &cur,0 ); +#ifdef DEBUG last_lsn =xlog_assign_lsn (log->l_curr_cycle, log->l_curr_block); +#endif while (lip !=NULL ) {/* * We're done when we see something other than an intent.
Quoted 3 lines · Darrick J. Wong
Fix up all the compiler warnings that have crept in.
Signed-off-by Darrick J. Wong <[email protected]>
Looks good, warnings gone.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Can we please just ensure ASSERT always evaluates the argument, similar to BUG()?
Quoted 2 lines · Christoph Hellwig
Can we please just ensure ASSERT always evaluates the argument, similar to
BUG()?
Assuming you meant BUG_ON or something that actually takes a parameter, yes you can do that, though now we have to fix up a bunch of things like the xfs_trans debug counter asserts and anything that asserts on xfs_isilocked.
-.text 785555 0 +.text 787843 0
I guess that's only 0.29% larger...
--D
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 36 lines · Darrick J. Wong
Fix up all the compiler warnings that have crept in.
Signed-off-by Darrick J. Wong <[email protected]>--- fs/xfs/libxfs/xfs_inode_fork.c | 9 +++------ fs/xfs/xfs_buf_item.c | 2 ++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_inode_fork.c +3
-6@@ -1499,14 +1499,11 @@ xfs_iext_realloc_indirect(xfs_ifork_t *ifp,/* inode fork pointer */ int new_size) /* new indirection array size */ { - int nlists; /* number of irec's (ex lists) */ -int size;/* current indirection array size */ - ASSERT(ifp->if_flags & XFS_IFEXTIREC); - nlists = ifp->if_real_bytes /XFS_IEXT_BUFSZ ; - size = nlists *sizeof (xfs_ext_irec_t);ASSERT (ifp->if_real_bytes); -ASSERT ((new_size >=0 ) && (new_size != size)); +ASSERT ((new_size >=0 ) && + (new_size != ((ifp->if_real_bytes /XFS_IEXT_BUFSZ ) * +sizeof (xfs_ext_irec_t))));if (new_size ==0 ) {xfs_iext_destroy (ifp); }else {fs/xfs/xfs_buf_item.c +0
-0
fs/xfs/xfs_buf_item.c xfs_buf_item_unlock( · line 576
Quoted 7 lines
fs/xfs/xfs_buf_item.c +2
-0@@ -570,7 +570,9 @@ xfs_buf_item_unlock(bool aborted = !!(lip->li_flags &XFS_LI_ABORTED );bool hold = !!(bip->bli_flags &XFS_BLI_HOLD );bool dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG bool ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif
This and the hunk below will break the CONFIG_XFS_WARN build.
Brian
Quoted 27 lines
fs/xfs/xfs_buf_item.c +0
-0/* Clear the buffer's association with this transaction. */ bp->b_transp =NULL ;fs/xfs/xfs_log_recover.c +4
-1@@ -4827,12 +4827,16 @@ xlog_recover_process_intents(int error =0 ;struct xfs_ail_cursor cur;struct xfs_ail *ailp; +#ifdef DEBUG xfs_lsn_t last_lsn; +#endif ailp = log->l_ailp;spin_lock (&ailp->xa_lock); lip =xfs_trans_ail_cursor_first (ailp, &cur,0 ); +#ifdef DEBUG last_lsn =xlog_assign_lsn (log->l_curr_cycle, log->l_curr_block); +#endif while (lip !=NULL ) {/* * We're done when we see something other than an intent. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 38 lines · Brian Foster
Quoted 37 lines · Darrick J. Wong
Fix up all the compiler warnings that have crept in.
Signed-off-by Darrick J. Wong <[email protected]>--- fs/xfs/libxfs/xfs_inode_fork.c | 9 +++------ fs/xfs/xfs_buf_item.c | 2 ++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_inode_fork.c +3
-6@@ -1499,14 +1499,11 @@ xfs_iext_realloc_indirect(xfs_ifork_t *ifp,/* inode fork pointer */ int new_size) /* new indirection array size */ { - int nlists; /* number of irec's (ex lists) */ -int size;/* current indirection array size */ - ASSERT(ifp->if_flags & XFS_IFEXTIREC); - nlists = ifp->if_real_bytes /XFS_IEXT_BUFSZ ; - size = nlists *sizeof (xfs_ext_irec_t);ASSERT (ifp->if_real_bytes); -ASSERT ((new_size >=0 ) && (new_size != size)); +ASSERT ((new_size >=0 ) && + (new_size != ((ifp->if_real_bytes /XFS_IEXT_BUFSZ ) * +sizeof (xfs_ext_irec_t))));if (new_size ==0 ) {xfs_iext_destroy (ifp); }else {fs/xfs/xfs_buf_item.c +0
-0@@ -570,7 +570,9 @@ xfs_buf_item_unlock(bool aborted = !!(lip->li_flags &XFS_LI_ABORTED );
Quoted 8 lines
fs/xfs/xfs_buf_item.c xfs_buf_item_unlock( · line 576
Quoted 6 lines
fs/xfs/xfs_buf_item.c +2
-0bool hold = !!(bip->bli_flags &XFS_BLI_HOLD );bool dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG bool ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif This and the hunk below will break the
CONFIG_XFS_WARNbuild.
Oops, good catch.
Quoted 16 lines
Brian
Quoted 14 lines
fs/xfs/xfs_buf_item.c +0
-0/* Clear the buffer's association with this transaction. */ bp->b_transp =NULL ;fs/xfs/xfs_log_recover.c +2
-0@@ -4827,12 +4827,16 @@ xlog_recover_process_intents(int error =0 ;struct xfs_ail_cursor cur;struct xfs_ail *ailp; +#ifdef DEBUG xfs_lsn_t last_lsn; +#endif
Quoted 6 lines
fs/xfs/xfs_log_recover.c xlog_recover_process_intents( · line 4839
Quoted 6 lines
fs/xfs/xfs_log_recover.c +2
-0ailp = log->l_ailp;spin_lock (&ailp->xa_lock); lip =xfs_trans_ail_cursor_first (ailp, &cur,0 ); +#ifdef DEBUG last_lsn =xlog_assign_lsn (log->l_curr_cycle, log->l_curr_block); +#endif
This one ought to be fine, because the ASSERT is itself protected by an '#ifdef DEBUG'.
--D
Quoted 11 lines
Quoted 7 lines
fs/xfs/xfs_log_recover.c +0
-1while (lip !=NULL ) {/* * We're done when we see something other than an intent. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 66 lines · Darrick J. Wong
Quoted 38 lines · Brian Foster
Quoted 37 lines · Darrick J. Wong
Fix up all the compiler warnings that have crept in.
Signed-off-by Darrick J. Wong <[email protected]>--- fs/xfs/libxfs/xfs_inode_fork.c | 9 +++------ fs/xfs/xfs_buf_item.c | 2 ++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_inode_fork.c +3
-6@@ -1499,14 +1499,11 @@ xfs_iext_realloc_indirect(xfs_ifork_t *ifp,/* inode fork pointer */ int new_size) /* new indirection array size */ { - int nlists; /* number of irec's (ex lists) */ -int size;/* current indirection array size */ - ASSERT(ifp->if_flags & XFS_IFEXTIREC); - nlists = ifp->if_real_bytes /XFS_IEXT_BUFSZ ; - size = nlists *sizeof (xfs_ext_irec_t);ASSERT (ifp->if_real_bytes); -ASSERT ((new_size >=0 ) && (new_size != size)); +ASSERT ((new_size >=0 ) && + (new_size != ((ifp->if_real_bytes /XFS_IEXT_BUFSZ ) * +sizeof (xfs_ext_irec_t))));if (new_size ==0 ) {xfs_iext_destroy (ifp); }else {fs/xfs/xfs_buf_item.c +0
-0@@ -570,7 +570,9 @@ xfs_buf_item_unlock(bool aborted = !!(lip->li_flags &XFS_LI_ABORTED );Quoted 8 lines
fs/xfs/xfs_buf_item.c xfs_buf_item_unlock( · line 576
Quoted 6 lines
fs/xfs/xfs_buf_item.c +2
-0bool hold = !!(bip->bli_flags &XFS_BLI_HOLD );bool dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG bool ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif This and the hunk below will break the
CONFIG_XFS_WARNbuild.Oops, good catch.
Quoted 16 lines
Brian
Quoted 14 lines
fs/xfs/xfs_buf_item.c +0
-0/* Clear the buffer's association with this transaction. */ bp->b_transp =NULL ;fs/xfs/xfs_log_recover.c +2
-0@@ -4827,12 +4827,16 @@ xlog_recover_process_intents(int error =0 ;struct xfs_ail_cursor cur;struct xfs_ail *ailp; +#ifdef DEBUG xfs_lsn_t last_lsn; +#endif
Quoted 10 lines
Quoted 6 lines
fs/xfs/xfs_log_recover.c xlog_recover_process_intents( · line 4839
Quoted 6 lines
fs/xfs/xfs_log_recover.c +2
-0ailp = log->l_ailp;spin_lock (&ailp->xa_lock); lip =xfs_trans_ail_cursor_first (ailp, &cur,0 ); +#ifdef DEBUG last_lsn =xlog_assign_lsn (log->l_curr_cycle, log->l_curr_block); +#endif This one ought to be fine, because the ASSERT is itself protected by an '#ifdef DEBUG'.
That looks like a different assert from the one that uses last_lsn..?
Brian
Quoted 13 lines
--D
Quoted 11 lines
Quoted 7 lines
fs/xfs/xfs_log_recover.c +0
-1while (lip !=NULL ) {/* * We're done when we see something other than an intent. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 78 lines · Brian Foster
Quoted 66 lines · Darrick J. Wong
Quoted 38 lines · Brian Foster
Quoted 37 lines · Darrick J. Wong
Fix up all the compiler warnings that have crept in.
Signed-off-by Darrick J. Wong <[email protected]>--- fs/xfs/libxfs/xfs_inode_fork.c | 9 +++------ fs/xfs/xfs_buf_item.c | 2 ++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_inode_fork.c +3
-6@@ -1499,14 +1499,11 @@ xfs_iext_realloc_indirect(xfs_ifork_t *ifp,/* inode fork pointer */ int new_size) /* new indirection array size */ { - int nlists; /* number of irec's (ex lists) */ -int size;/* current indirection array size */ - ASSERT(ifp->if_flags & XFS_IFEXTIREC); - nlists = ifp->if_real_bytes /XFS_IEXT_BUFSZ ; - size = nlists *sizeof (xfs_ext_irec_t);ASSERT (ifp->if_real_bytes); -ASSERT ((new_size >=0 ) && (new_size != size)); +ASSERT ((new_size >=0 ) && + (new_size != ((ifp->if_real_bytes /XFS_IEXT_BUFSZ ) * +sizeof (xfs_ext_irec_t))));if (new_size ==0 ) {xfs_iext_destroy (ifp); }else {fs/xfs/xfs_buf_item.c +0
-0@@ -570,7 +570,9 @@ xfs_buf_item_unlock(bool aborted = !!(lip->li_flags &XFS_LI_ABORTED );Quoted 8 lines
fs/xfs/xfs_buf_item.c xfs_buf_item_unlock( · line 576
Quoted 6 lines
fs/xfs/xfs_buf_item.c +2
-0bool hold = !!(bip->bli_flags &XFS_BLI_HOLD );bool dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG bool ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif This and the hunk below will break the
CONFIG_XFS_WARNbuild.Oops, good catch.
Quoted 16 lines
Brian
Quoted 14 lines
fs/xfs/xfs_buf_item.c +0
-0/* Clear the buffer's association with this transaction. */ bp->b_transp =NULL ;fs/xfs/xfs_log_recover.c +2
-0@@ -4827,12 +4827,16 @@ xlog_recover_process_intents(int error =0 ;struct xfs_ail_cursor cur;struct xfs_ail *ailp; +#ifdef DEBUG xfs_lsn_t last_lsn; +#endif Quoted 10 lines
Quoted 6 lines
fs/xfs/xfs_log_recover.c xlog_recover_process_intents( · line 4839
Quoted 6 lines
fs/xfs/xfs_log_recover.c +2
-0ailp = log->l_ailp;spin_lock (&ailp->xa_lock); lip =xfs_trans_ail_cursor_first (ailp, &cur,0 ); +#ifdef DEBUG last_lsn =xlog_assign_lsn (log->l_curr_cycle, log->l_curr_block); +#endif This one ought to be fine, because the ASSERT is itself protected by an '#ifdef DEBUG'.
Quoted 1 line
That looks like a different assert from the one that uses
last_lsn..?
Doh, you're right.
--D
Quoted 20 lines
Brian
Quoted 13 lines
--D
Quoted 11 lines
Quoted 7 lines
fs/xfs/xfs_log_recover.c +0
-1while (lip !=NULL ) {/* * We're done when we see something other than an intent. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html