These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / libcfs / tracefile.c
index c86394f..f2d018d 100644 (file)
@@ -39,7 +39,6 @@
  * Author: Phil Schwan <phil@clusterfs.com>
  */
 
-
 #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;