]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove self-assignment in libxfs/util.c
authorEric Sandeen <sandeen@sandeen.net>
Mon, 24 Aug 2015 01:52:45 +0000 (11:52 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 24 Aug 2015 01:52:45 +0000 (11:52 +1000)
We don't have percpu counters in userspace, so libxfs plays
tricks.  Rather than calling percpu_counter_set() in
xfs_reinit_percpu_counters, we just directly assign
the values in mp->m_sb to the counters in mp.

But this was already handled by #defining the percpu counters
in the mount structure to those in the superblock, i.e.:

#define m_icount        m_sb.sb_icount
#define m_ifree         m_sb.sb_ifree
#define m_fdblocks      m_sb.sb_fdblocks

so we actually end up with pointless self-assignment.

Define away the xfs_reinit_percpu_counters() function,
because it's a no-op.

Addresses-Coverity-Id: 1298009
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/libxfs_priv.h
libxfs/util.c

index 1b017642e8895fc5954eed61a3b733b2aede04d2..2a8b850737099b97b51eefad107388356906982c 100644 (file)
@@ -494,7 +494,8 @@ struct xfs_buf *xfs_trans_buf_item_match(struct xfs_trans *,
 #define xfs_mod_frextents(mp, delta) \
        libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FREXTENTS, delta, 0)
 int  libxfs_mod_incore_sb(struct xfs_mount *, int, int64_t, int);
-void xfs_reinit_percpu_counters(struct xfs_mount *mp);
+/* percpu counters in mp are #defined to the superblock sb_ counters */
+#define xfs_reinit_percpu_counters(mp)
 
 void xfs_trans_mod_sb(struct xfs_trans *, uint, long);
 void xfs_trans_init(struct xfs_mount *);
index 8272609e273305928ed338bac08697de5283d7f9..c9f9175d186c29a214d8a12bee7236e7564c4178 100644 (file)
@@ -729,12 +729,3 @@ xfs_verifier_error(
                  bp->b_error == -EFSBADCRC ? "CRC error" : "corruption",
                  bp->b_bn, BBTOB(bp->b_length));
 }
-
-void
-xfs_reinit_percpu_counters(
-       struct xfs_mount        *mp)
-{
-       mp->m_icount = mp->m_sb.sb_icount;
-       mp->m_ifree = mp->m_sb.sb_ifree;
-       mp->m_fdblocks = mp->m_sb.sb_fdblocks;
-}