xfs: fix compiler warnings
PATCH 1/1 xfs: fix compiler warnings
Fix up all the compiler warnings about unused variables that have crept in.
--- fs/xfs/libxfs/xfs_inode_fork.c | 9 +++------ fs/xfs/xfs_buf_item.c | 4 ++++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 11 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 +4 -0
@@ -570,12 +570,16 @@ xfs_buf_item_unlock(bool aborted;bool hold;bool dirty; +#ifdef DEBUG bool ordered; +#endif aborted = !!(lip->li_flags &XFS_LI_ABORTED ); hold = !!(bip->bli_flags &XFS_BLI_HOLD ); dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG 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 39 lines · Darrick J. Wong
Fix up all the compiler warnings about unused variables 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 | 4 ++++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 11 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,12 +570,16 @@ xfs_buf_item_unlock(bool aborted;bool hold;bool dirty;
fs/xfs/xfs_buf_item.c xfs_buf_item_unlock( · line 582
Quoted 10 lines
fs/xfs/xfs_buf_item.c +4
-0+#ifdef DEBUG bool ordered; +#endif aborted = !!(lip->li_flags &XFS_LI_ABORTED ); hold = !!(bip->bli_flags &XFS_BLI_HOLD ); dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif
I'd revert the last patch that changed this code (because it's busted!) and just do this here:
+#ifdef DEBUG
bool ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
+#endif
Also, feel free to rebase for-next to get rid of that last patch - just like linux-next, for-next isn't meant to be 100% stable. IMO it's better at this point to rebase for-next to remove/correct mistakes than to have commits in the tree that don't work....
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 54 lines · Dave Chinner
Quoted 39 lines · Darrick J. Wong
Fix up all the compiler warnings about unused variables 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 | 4 ++++ fs/xfs/xfs_log_recover.c | 4 ++++ 3 files changed, 11 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,12 +570,16 @@ xfs_buf_item_unlock(bool aborted;bool hold;bool dirty;fs/xfs/xfs_buf_item.c xfs_buf_item_unlock( · line 582
Quoted 10 lines
fs/xfs/xfs_buf_item.c +4
-0+#ifdef DEBUG bool ordered; +#endif aborted = !!(lip->li_flags &XFS_LI_ABORTED ); hold = !!(bip->bli_flags &XFS_BLI_HOLD ); dirty = !!(bip->bli_flags &XFS_BLI_DIRTY ); +#ifdef DEBUG ordered = !!(bip->bli_flags &XFS_BLI_ORDERED ); +#endif I'd revert the last patch that changed this code (because it's busted!) and just do this here:
Quoted 8 lines
+#ifdef DEBUG
bool ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);+#endif
Also, feel free to rebase for-next to get rid of that last patch - just like linux-next, for-next isn't meant to be 100% stable. IMO it's better at this point to rebase for-next to remove/correct mistakes than to have commits in the tree that don't work....
Ok. Sorry about the noise, everyone.
--D
Quoted 11 lines
Cheers,
Dave.
Signature · 6 lines
Dave Chinner [email protected] -- 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