From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfsprogs: remove self-assignment in libxfs/util.c
Date: Thu, 20 Aug 2015 14:52:15 -0500 [thread overview]
Message-ID: <55D62FEF.3020404@sandeen.net> (raw)
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>
---
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 1b01764..105290e 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -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 *);
diff --git a/libxfs/util.c b/libxfs/util.c
index 8272609..c9f9175 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -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;
-}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
reply other threads:[~2015-08-20 19:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55D62FEF.3020404@sandeen.net \
--to=sandeen@sandeen.net \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox