This patch should fix it up to work with preempt, as well. Earlier code
was braindead on my part...
This doesn't protect the stats vars from preemption; I don't think we
care much, in any case it shouldn't harm anything but the accuracy of
the stats.
-Eric
===========================================================================
linux/fs/xfs/linux/xfs_stats.h
===========================================================================
--- /usr/tmp/TmpDir.27349-0/linux/fs/xfs/linux/xfs_stats.h_1.9 2003-10-02
13:06:14.000000000 -0500
+++ linux/fs/xfs/linux/xfs_stats.h 2003-10-02 12:37:24.000000000 -0500
@@ -130,9 +130,11 @@
DECLARE_PER_CPU(struct xfsstats, xfsstats);
-# define XFS_STATS_INC(count) ( get_cpu_var(xfsstats).count++ )
-# define XFS_STATS_DEC(count) ( get_cpu_var(xfsstats).count-- )
-# define XFS_STATS_ADD(count, inc) ( get_cpu_var(xfsstats).count += (inc) )
+/* We don't disable preempt, not too worried about poking the
+ * wrong cpu's stat */
+#define XFS_STATS_INC(count) (__get_cpu_var(xfsstats).count++)
+#define XFS_STATS_DEC(count) (__get_cpu_var(xfsstats).count--)
+#define XFS_STATS_ADD(count, inc) (__get_cpu_var(xfsstats).count += (inc))
extern void xfs_init_procfs(void);
extern void xfs_cleanup_procfs(void);
===========================================================================
linux/fs/xfs/pagebuf/page_buf_internal.h
===========================================================================
--- /usr/tmp/TmpDir.27349-0/linux/fs/xfs/pagebuf/page_buf_internal.h_1.27
2003-10-02 13:06:14.000000000 -0500
+++ linux/fs/xfs/pagebuf/page_buf_internal.h 2003-10-02 12:37:43.000000000
-0500
@@ -123,7 +123,12 @@
DECLARE_PER_CPU(struct pbstats, pbstats);
-#define PB_STATS_INC(count) ( get_cpu_var(pbstats).count++ )
+/* We don't disable preempt, not too worried about poking the
+ * wrong cpu's stat */
+#define PB_STATS_INC(count) do { \
+ get_cpu_var(pbstats).count++; \
+ put_cpu_var(pbstats); \
+} while (0)
#ifndef STATIC
# define STATIC static
|