The macro cfs_tcd_for_each() is only used in tracefile.c so move
it from the header tracefile.h along with related material in
the header file.
Test-Parameters: trivial
Change-Id: I024dc0a4a1f5481cf3468c35e670096f29817c23
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/38914
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#include <libcfs/linux/linux-fs.h>
#include <libcfs/libcfs.h>
#include <libcfs/linux/linux-fs.h>
#include <libcfs/libcfs.h>
-/* XXX move things up to the top, comment */
+#define TCD_MAX_TYPES 8
+
union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned;
char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned;
char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
spin_unlock(&tcd->tcd_lock);
}
spin_unlock(&tcd->tcd_lock);
}
+#define cfs_tcd_for_each(tcd, i, j) \
+ for (i = 0; cfs_trace_data[i]; i++) \
+ for (j = 0, ((tcd) = &(*cfs_trace_data[i])[j].tcd); \
+ j < num_possible_cpus(); \
+ j++, (tcd) = &(*cfs_trace_data[i])[j].tcd)
+
#define cfs_tcd_for_each_type_lock(tcd, i, cpu) \
for (i = 0; cfs_trace_data[i] && \
(tcd = &(*cfs_trace_data[i])[cpu].tcd) && \
#define cfs_tcd_for_each_type_lock(tcd, i, cpu) \
for (i = 0; cfs_trace_data[i] && \
(tcd = &(*cfs_trace_data[i])[cpu].tcd) && \
char __pad[L1_CACHE_ALIGN(sizeof(struct cfs_trace_cpu_data))];
};
char __pad[L1_CACHE_ALIGN(sizeof(struct cfs_trace_cpu_data))];
};
-#define TCD_MAX_TYPES 8
-extern union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS];
-
-#define cfs_tcd_for_each(tcd, i, j) \
- for (i = 0; cfs_trace_data[i] != NULL; i++) \
- for (j = 0, ((tcd) = &(*cfs_trace_data[i])[j].tcd); \
- j < num_possible_cpus(); \
- j++, (tcd) = &(*cfs_trace_data[i])[j].tcd)
-
/* XXX nikita: this declaration is internal to tracefile.c and should probably
* be moved there */
struct page_collection {
/* XXX nikita: this declaration is internal to tracefile.c and should probably
* be moved there */
struct page_collection {