]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
xfs: fix compiler warnings
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 31 Aug 2017 22:11:06 +0000 (15:11 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Sep 2017 12:32:06 +0000 (07:32 -0500)
BugLink: http://bugs.launchpad.net/bugs/1718412
commit 7bf7a193a90cadccaad21c5970435c665c40fe27 upstream.

Fix up all the compiler warnings that have crept in.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_log_recover.c

index c09c16b1ad3b8b1f883e2ee93b9fcc275c7ed63c..6f2a5baded7683360451aefff2483857679bca65 100644 (file)
@@ -579,7 +579,7 @@ xfs_bmap_validate_ret(
 
 #else
 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork)                do { } while (0)
-#define        xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)
+#define        xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)    do { } while (0)
 #endif /* DEBUG */
 
 /*
index 0e80f34fe97c509cef3eef61ff7237c20a19bdd4..5eb16555593426dd58554515d1ab5571be0a8d49 100644 (file)
@@ -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 {
index ef2c1375f092041a937d1c2753fc124cea9e6244..e0a0af0946f23bd84944256141967526044b2468 100644 (file)
@@ -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);
+#if defined(DEBUG) || defined(XFS_WARN)
        bool                    ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
+#endif
 
        /* Clear the buffer's association with this transaction. */
        bp->b_transp = NULL;
index 469c9fa4c178d98d06445b2456d82edc86d17f63..17081c77ef86ede1447fcf80565a718b136db40c 100644 (file)
@@ -817,7 +817,7 @@ xfs_vn_setattr_nonsize(
  * Caution: The caller of this function is responsible for calling
  * setattr_prepare() or otherwise verifying the change is fine.
  */
-int
+STATIC int
 xfs_setattr_size(
        struct xfs_inode        *ip,
        struct iattr            *iattr)
index 43d5df3a563f7aa3b234356f29c64b341fd22ccc..093ee82890574893e4e682b4fb499772606b6f86 100644 (file)
@@ -4827,12 +4827,16 @@ xlog_recover_process_intents(
        int                     error = 0;
        struct xfs_ail_cursor   cur;
        struct xfs_ail          *ailp;
+#if defined(DEBUG) || defined(XFS_WARN)
        xfs_lsn_t               last_lsn;
+#endif
 
        ailp = log->l_ailp;
        spin_lock(&ailp->xa_lock);
        lip = xfs_trans_ail_cursor_first(ailp, &cur, 0);
+#if defined(DEBUG) || defined(XFS_WARN)
        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.