Whamcloud - gitweb
LU-5557 mdt: track reint operations in MDS service stats
[fs/lustre-release.git] / libcfs / libcfs / tracefile.c
index e24f66b..0c2e06a 100644 (file)
@@ -66,7 +66,7 @@ cfs_tage_from_list(struct list_head *list)
        return list_entry(list, struct cfs_trace_page, linkage);
 }
 
-static struct cfs_trace_page *cfs_tage_alloc(int gfp)
+static struct cfs_trace_page *cfs_tage_alloc(gfp_t gfp)
 {
        struct page            *page;
        struct cfs_trace_page *tage;
@@ -114,7 +114,7 @@ static void cfs_tage_to_tail(struct cfs_trace_page *tage,
        list_move_tail(&tage->linkage, queue);
 }
 
-int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, int gfp,
+int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, gfp_t gfp,
                           struct list_head *stock)
 {
        int i;
@@ -527,7 +527,7 @@ static void collect_pages_on_all_cpus(struct page_collection *pc)
        struct cfs_trace_cpu_data *tcd;
        int i, cpu;
 
-       cfs_for_each_possible_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                cfs_tcd_for_each_type_lock(tcd, i, cpu) {
                        list_splice_init(&tcd->tcd_pages, &pc->pc_pages);
                        tcd->tcd_cur_pages = 0;
@@ -558,7 +558,7 @@ static void put_pages_back_on_all_cpus(struct page_collection *pc)
         struct cfs_trace_page *tmp;
         int i, cpu;
 
-        cfs_for_each_possible_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                 cfs_tcd_for_each_type_lock(tcd, i, cpu) {
                         cur_head = tcd->tcd_pages.next;
 
@@ -622,7 +622,7 @@ static void put_pages_on_daemon_list(struct page_collection *pc)
         struct cfs_trace_cpu_data *tcd;
         int i, cpu;
 
-        cfs_for_each_possible_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                 cfs_tcd_for_each_type_lock(tcd, i, cpu)
                         put_pages_on_tcd_daemon_list(pc, tcd);
         }
@@ -713,7 +713,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
                 cfs_tage_free(tage);
         }
        MMSPACE_CLOSE;
-       rc = filp_fsync(filp);
+       rc = filp_fsync(filp, 0, LLONG_MAX);
        if (rc)
                printk(KERN_ERR "sync returns %d\n", rc);
 close:
@@ -824,12 +824,10 @@ int cfs_trace_dump_debug_buffer_usrstr(void *usr_str, int usr_str_nob)
         if (rc != 0)
                 goto out;
 
-#if !defined(__WINNT__)
         if (str[0] != '/') {
                 rc = -EINVAL;
                 goto out;
         }
-#endif
         rc = cfs_tracefile_dump_all_pages(str);
 out:
         cfs_trace_free_string_buffer(str, usr_str_nob + 1);
@@ -857,10 +855,8 @@ int cfs_trace_daemon_command(char *str)
 
         } else if (strlen(str) >= sizeof(cfs_tracefile)) {
                 rc = -ENAMETOOLONG;
-#ifndef __WINNT__
         } else if (str[0] != '/') {
                 rc = -EINVAL;
-#endif
         } else {
                strcpy(cfs_tracefile, str);
 
@@ -1022,6 +1018,7 @@ static int tracefiled(void *arg)
                                       "but wrote %d\n", tage->used, rc);
                                put_pages_back(&pc);
                                __LASSERT(list_empty(&pc.pc_pages));
+                               break;
                        }
                 }
                MMSPACE_CLOSE;
@@ -1147,7 +1144,7 @@ static void trace_cleanup_on_all_cpus(void)
        struct cfs_trace_page *tmp;
        int i, cpu;
 
-       cfs_for_each_possible_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                cfs_tcd_for_each_type_lock(tcd, i, cpu) {
                        tcd->tcd_shutting_down = 1;