X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fstaging%2Flustre%2Flustre%2Flibcfs%2Ftracefile.c;fp=kernel%2Fdrivers%2Fstaging%2Flustre%2Flustre%2Flibcfs%2Ftracefile.c;h=f2d018d7823cdeb3f29b48cf970ed5f98b9c49da;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hp=c86394f7f4d9c32294eeb52a650255e4c24d208d;hpb=f93b97fd65072de626c074dbe099a1fff05ce060;p=kvmfornfv.git diff --git a/kernel/drivers/staging/lustre/lustre/libcfs/tracefile.c b/kernel/drivers/staging/lustre/lustre/libcfs/tracefile.c index c86394f7f..f2d018d78 100644 --- a/kernel/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/kernel/drivers/staging/lustre/lustre/libcfs/tracefile.c @@ -39,7 +39,6 @@ * Author: Phil Schwan */ - #define DEBUG_SUBSYSTEM S_LNET #define LUSTRE_TRACEFILE_PRIVATE #include "tracefile.h" @@ -52,7 +51,7 @@ union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline char cfs_tracefile[TRACEFILE_NAME_SIZE]; long long cfs_tracefile_size = CFS_TRACEFILE_SIZE; static struct tracefiled_ctl trace_tctl; -struct mutex cfs_trace_thread_mutex; +static DEFINE_MUTEX(cfs_trace_thread_mutex); static int thread_running; static atomic_t cfs_tage_allocated = ATOMIC_INIT(0); @@ -124,7 +123,7 @@ int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, gfp_t gfp, * from here: this will lead to infinite recursion. */ - for (i = 0; i + tcd->tcd_cur_stock_pages < TCD_STOCK_PAGES ; ++ i) { + for (i = 0; i + tcd->tcd_cur_stock_pages < TCD_STOCK_PAGES ; ++i) { struct cfs_trace_page *tage; tage = cfs_tage_alloc(gfp); @@ -370,7 +369,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata, /* indent message according to the nesting level */ while (depth-- > 0) { *(debug_buf++) = '.'; - ++ tage->used; + ++tage->used; } strcpy(debug_buf, file); @@ -652,6 +651,7 @@ void cfs_trace_debug_print(void) while (p < ((char *)page_address(page) + tage->used)) { struct ptldebug_header *hdr; int len; + hdr = (void *)p; p += sizeof(*hdr); file = p; @@ -810,7 +810,7 @@ int cfs_trace_allocate_string_buffer(char **str, int nob) if (nob > 2 * PAGE_CACHE_SIZE) /* string must be "sensible" */ return -EINVAL; - *str = kmalloc(nob, GFP_IOFS | __GFP_ZERO); + *str = kmalloc(nob, GFP_KERNEL | __GFP_ZERO); if (*str == NULL) return -ENOMEM; @@ -937,18 +937,6 @@ int cfs_trace_set_debug_mb(int mb) return 0; } -int cfs_trace_set_debug_mb_usrstr(void __user *usr_str, int usr_str_nob) -{ - char str[32]; - int rc; - - rc = cfs_trace_copyin_string(str, sizeof(str), usr_str, usr_str_nob); - if (rc < 0) - return rc; - - return cfs_trace_set_debug_mb(simple_strtoul(str, NULL, 0)); -} - int cfs_trace_get_debug_mb(void) { int i;