RX: Fix old rx_stats incrementors
authorAndrew Deason <adeason@sinenomine.net>
Thu, 4 Nov 2010 17:07:17 +0000 (12:07 -0500)
committerDerrick Brashear <shadow@dementia.org>
Thu, 4 Nov 2010 19:16:31 +0000 (12:16 -0700)
A couple of places were still trying to increment rx_stats members by
just ++'ing them. Update them to use rx_atomic_inc.

Change-Id: I35f5b24a08952d308074851623b06580e4b2b93b
Reviewed-on: http://gerrit.openafs.org/3263
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/rx/rx_kcommon.c

index 1351495..c63b8b3 100644 (file)
@@ -304,9 +304,7 @@ MyPacketProc(struct rx_packet **ahandle, int asize)
                rxi_FreePacket(tp);
                tp = NULL;
                 if (rx_stats_active) {
-                    MUTEX_ENTER(&rx_stats_mutex);
-                    rx_stats.noPacketBuffersOnRead++;
-                    MUTEX_EXIT(&rx_stats_mutex);
+                   rx_atomic_inc(&rx_stats.noPacketBuffersOnRead);
                 }
            }
        }
@@ -317,9 +315,7 @@ MyPacketProc(struct rx_packet **ahandle, int asize)
         * end know we're losing.
         */
         if (rx_stats_active) {
-            MUTEX_ENTER(&rx_stats_mutex);
-            rx_stats.bogusPacketOnRead++;
-            MUTEX_EXIT(&rx_stats_mutex);
+           rx_atomic_inc(&rx_stats.bogusPacketOnRead);
         }
        /* I DON"T LIKE THIS PRINTF -- PRINTFS MAKE THINGS VERY VERY SLOOWWW */
        dpf(("rx: packet dropped: bad ulen=%d\n", asize));