diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/libcfs')
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/debug.c | 18 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/fail.c | 24 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/hash.c | 28 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c | 32 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c | 6 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c | 3 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/tracefile.c | 38 |
9 files changed, 61 insertions, 92 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index ba43b3067fa3..a7a7ac626aaf 100644 --- a/drivers/staging/lustre/lustre/libcfs/debug.c +++ b/drivers/staging/lustre/lustre/libcfs/debug.c @@ -318,9 +318,7 @@ libcfs_debug_str2mask(int *mask, const char *str, int is_subsys) if (t >= 1 && matched == n) { /* don't print warning for lctl set_param debug=0 or -1 */ if (m != 0 && m != -1) - CWARN("You are trying to use a numerical value for the " - "mask - this will be deprecated in a future " - "release.\n"); + CWARN("You are trying to use a numerical value for the mask - this will be deprecated in a future release.\n"); *mask = m; return 0; } @@ -375,8 +373,8 @@ void libcfs_debug_dumplog(void) (void *)(long)current_pid(), "libcfs_debug_dumper"); if (IS_ERR(dumper)) - pr_err("LustreError: cannot start log dump thread:" - " %ld\n", PTR_ERR(dumper)); + pr_err("LustreError: cannot start log dump thread: %ld\n", + PTR_ERR(dumper)); else schedule(); @@ -412,7 +410,7 @@ int libcfs_debug_init(unsigned long bufsize) max = TCD_MAX_PAGES; } else { max = (max / num_possible_cpus()); - max = (max << (20 - PAGE_CACHE_SHIFT)); + max = max << (20 - PAGE_CACHE_SHIFT); } rc = cfs_tracefile_init(max); @@ -460,11 +458,3 @@ void libcfs_debug_set_level(unsigned int debug_level) } EXPORT_SYMBOL(libcfs_debug_set_level); - -void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, const char *label, - long_ptr_t rc) -{ - libcfs_debug_msg(msgdata, "Process leaving via %s (rc=%lu : %ld : %#lx)\n", - label, (ulong_ptr_t)rc, rc, rc); -} -EXPORT_SYMBOL(libcfs_log_goto); diff --git a/drivers/staging/lustre/lustre/libcfs/fail.c b/drivers/staging/lustre/lustre/libcfs/fail.c index e73ca3df9734..92444b0fe2a3 100644 --- a/drivers/staging/lustre/lustre/libcfs/fail.c +++ b/drivers/staging/lustre/lustre/libcfs/fail.c @@ -103,18 +103,18 @@ int __cfs_fail_check_set(__u32 id, __u32 value, int set) } switch (set) { - case CFS_FAIL_LOC_NOSET: - case CFS_FAIL_LOC_VALUE: - break; - case CFS_FAIL_LOC_ORSET: - cfs_fail_loc |= value & ~(CFS_FAILED | CFS_FAIL_ONCE); - break; - case CFS_FAIL_LOC_RESET: - cfs_fail_loc = value; - break; - default: - LASSERTF(0, "called with bad set %u\n", set); - break; + case CFS_FAIL_LOC_NOSET: + case CFS_FAIL_LOC_VALUE: + break; + case CFS_FAIL_LOC_ORSET: + cfs_fail_loc |= value & ~(CFS_FAILED | CFS_FAIL_ONCE); + break; + case CFS_FAIL_LOC_RESET: + cfs_fail_loc = value; + break; + default: + LASSERTF(0, "called with bad set %u\n", set); + break; } return 1; diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 3b67b7b6428c..2d1e6729e996 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -1121,8 +1121,7 @@ cfs_hash_destroy(struct cfs_hash *hs) cfs_hash_bd_for_each_hlist(hs, &bd, hhead) { hlist_for_each_safe(hnode, pos, hhead) { LASSERTF(!cfs_hash_with_assert_empty(hs), - "hash %s bucket %u(%u) is not " - " empty: %u items left\n", + "hash %s bucket %u(%u) is not empty: %u items left\n", hs->hs_name, bd.bd_bucket->hsb_index, bd.bd_offset, bd.bd_bucket->hsb_count); /* can't assert key valicate, because we @@ -1371,8 +1370,7 @@ cfs_hash_lookup(struct cfs_hash *hs, const void *key) EXPORT_SYMBOL(cfs_hash_lookup); static void -cfs_hash_for_each_enter(struct cfs_hash *hs) -{ +cfs_hash_for_each_enter(struct cfs_hash *hs) { LASSERT(!cfs_hash_is_exiting(hs)); if (!cfs_hash_with_rehash(hs)) @@ -1397,8 +1395,7 @@ cfs_hash_for_each_enter(struct cfs_hash *hs) } static void -cfs_hash_for_each_exit(struct cfs_hash *hs) -{ +cfs_hash_for_each_exit(struct cfs_hash *hs) { int remained; int bits; @@ -1429,8 +1426,7 @@ cfs_hash_for_each_exit(struct cfs_hash *hs) */ static __u64 cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, - void *data, int remove_safe) -{ + void *data, int remove_safe) { struct hlist_node *hnode; struct hlist_node *pos; struct cfs_hash_bd bd; @@ -1523,8 +1519,7 @@ EXPORT_SYMBOL(cfs_hash_for_each); void cfs_hash_for_each_safe(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) -{ + cfs_hash_for_each_cb_t func, void *data) { cfs_hash_for_each_tight(hs, func, data, 1); } EXPORT_SYMBOL(cfs_hash_for_each_safe); @@ -1572,8 +1567,8 @@ EXPORT_SYMBOL(cfs_hash_size_get); * two cases, so iteration has to be stopped on change. */ static int -cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, void *data) -{ +cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, + void *data) { struct hlist_node *hnode; struct hlist_node *tmp; struct cfs_hash_bd bd; @@ -1634,8 +1629,7 @@ cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, void * int cfs_hash_for_each_nolock(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) -{ + cfs_hash_for_each_cb_t func, void *data) { if (cfs_hash_with_no_lock(hs) || cfs_hash_with_rehash_key(hs) || !cfs_hash_with_no_itemref(hs)) @@ -1667,8 +1661,7 @@ EXPORT_SYMBOL(cfs_hash_for_each_nolock); */ int cfs_hash_for_each_empty(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) -{ + cfs_hash_for_each_cb_t func, void *data) { unsigned i = 0; if (cfs_hash_with_no_lock(hs)) @@ -1726,8 +1719,7 @@ EXPORT_SYMBOL(cfs_hash_hlist_for_each); */ void cfs_hash_for_each_key(struct cfs_hash *hs, const void *key, - cfs_hash_for_each_cb_t func, void *data) -{ + cfs_hash_for_each_cb_t func, void *data) { struct hlist_node *hnode; struct cfs_hash_bd bds[2]; unsigned i; diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c index dbb81b6cc200..31a558115a96 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c @@ -38,7 +38,7 @@ #include "../../include/linux/libcfs/libcfs.h" /** Global CPU partition table */ -struct cfs_cpt_table *cfs_cpt_table __read_mostly = NULL; +struct cfs_cpt_table *cfs_cpt_table __read_mostly; EXPORT_SYMBOL(cfs_cpt_table); #ifndef HAVE_LIBCFS_CPT diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c index 224c65b5ce4e..05f7595f18aa 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c @@ -333,8 +333,8 @@ cfs_cpt_unset_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu) /* caller doesn't know the partition ID */ cpt = cptab->ctb_cpu2cpt[cpu]; if (cpt < 0) { /* not set in this CPT-table */ - CDEBUG(D_INFO, "Try to unset cpu %d which is " - "not in CPT-table %p\n", cpt, cptab); + CDEBUG(D_INFO, "Try to unset cpu %d which is not in CPT-table %p\n", + cpt, cptab); return; } @@ -384,8 +384,8 @@ cfs_cpt_set_cpumask(struct cfs_cpt_table *cptab, int cpt, cpumask_t *mask) int i; if (cpus_weight(*mask) == 0 || any_online_cpu(*mask) == NR_CPUS) { - CDEBUG(D_INFO, "No online CPU is found in the CPU mask " - "for CPU partition %d\n", cpt); + CDEBUG(D_INFO, "No online CPU is found in the CPU mask for CPU partition %d\n", + cpt); return 0; } @@ -579,9 +579,8 @@ cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt) } if (any_online_cpu(*cpumask) == NR_CPUS) { - CERROR("No online CPU found in CPU partition %d, did someone " - "do CPU hotplug on system? You might need to reload " - "Lustre modules to keep system working well.\n", cpt); + CERROR("No online CPU found in CPU partition %d, did someone do CPU hotplug on system? You might need to reload Lustre modules to keep system working well.\n", + cpt); return -EINVAL; } @@ -737,16 +736,12 @@ cfs_cpt_table_create(int ncpt) ncpt = rc; if (ncpt > num_online_cpus() || ncpt > 4 * rc) { - CWARN("CPU partition number %d is larger than suggested " - "value (%d), your system may have performance" - "issue or run out of memory while under pressure\n", + CWARN("CPU partition number %d is larger than suggested value (%d), your system may have performance issue or run out of memory while under pressure\n", ncpt, rc); } if (num_online_cpus() % ncpt != 0) { - CERROR("CPU number %d is not multiple of cpu_npartition %d, " - "please try different cpu_npartitions value or" - "set pattern string by cpu_pattern=STRING\n", + CERROR("CPU number %d is not multiple of cpu_npartition %d, please try different cpu_npartitions value or set pattern string by cpu_pattern=STRING\n", (int)num_online_cpus(), ncpt); goto failed; } @@ -796,8 +791,7 @@ cfs_cpt_table_create(int ncpt) if (cpt != ncpt || num != cpus_weight(*cptab->ctb_parts[ncpt - 1].cpt_cpumask)) { - CERROR("Expect %d(%d) CPU partitions but got %d(%d), " - "CPU hotplug/unplug while setting?\n", + CERROR("Expect %d(%d) CPU partitions but got %d(%d), CPU hotplug/unplug while setting?\n", cptab->ctb_nparts, num, cpt, cpus_weight(*cptab->ctb_parts[ncpt - 1].cpt_cpumask)); goto failed; @@ -808,8 +802,7 @@ cfs_cpt_table_create(int ncpt) return cptab; failed: - CERROR("Failed to setup CPU-partition-table with %d " - "CPU-partitions, online HW nodes: %d, HW cpus: %d.\n", + CERROR("Failed to setup CPU-partition-table with %d CPU-partitions, online HW nodes: %d, HW cpus: %d.\n", ncpt, num_online_nodes(), num_online_cpus()); if (mask != NULL) @@ -975,9 +968,8 @@ cfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) warn = any_online_cpu(*cpt_data.cpt_cpumask) >= nr_cpu_ids; mutex_unlock(&cpt_data.cpt_mutex); CDEBUG(warn ? D_WARNING : D_INFO, - "Lustre: can't support CPU plug-out well now, " - "performance and stability could be impacted " - "[CPU %u action: %lx]\n", cpu, action); + "Lustre: can't support CPU plug-out well now, performance and stability could be impacted [CPU %u action: %lx]\n", + cpu, action); } return NOTIFY_OK; diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c index 3298ddf6d3be..12005a71aa73 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c @@ -87,8 +87,7 @@ void libcfs_run_debug_log_upcall(char *file) rc = call_usermodehelper(argv[0], argv, envp, 1); if (rc < 0 && rc != -ENOENT) { - CERROR("Error %d invoking LNET debug log upcall %s %s; " - "check /proc/sys/lnet/debug_log_upcall\n", + CERROR("Error %d invoking LNET debug log upcall %s %s; check /proc/sys/lnet/debug_log_upcall\n", rc, argv[0], argv[1]); } else { CDEBUG(D_HA, "Invoked LNET debug log upcall %s %s\n", @@ -114,8 +113,7 @@ void libcfs_run_upcall(char **argv) rc = call_usermodehelper(argv[0], argv, envp, 1); if (rc < 0 && rc != -ENOENT) { - CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; " - "check /proc/sys/lnet/upcall\n", + CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; check /proc/sys/lnet/upcall\n", rc, argv[0], argv[1], argc < 3 ? "" : ",", argc < 3 ? "" : argv[2], argc < 4 ? "" : ",", argc < 4 ? "" : argv[3], diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c index bbe2c68c18a6..83d3f08a37b2 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c @@ -365,8 +365,8 @@ static int __proc_cpt_table(void *data, int write, if (rc >= 0) break; - LIBCFS_FREE(buf, len); if (rc == -EFBIG) { + LIBCFS_FREE(buf, len); len <<= 1; continue; } diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c index 939b33dd6520..b91a1f95bbd0 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c @@ -279,8 +279,7 @@ libcfs_sock_write (struct socket *sock, void *buffer, int nob, int timeout) rc = kernel_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv)); if (rc != 0) { - CERROR("Can't set socket send timeout " - "%ld.%06d: %d\n", + CERROR("Can't set socket send timeout %ld.%06d: %d\n", (long)tv.tv_sec, (int)tv.tv_usec, rc); return rc; } diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c index 7561030c96e6..5917c31c7ed6 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c @@ -196,8 +196,7 @@ static void cfs_tcd_shrink(struct cfs_trace_cpu_data *tcd) */ if (printk_ratelimit()) - printk(KERN_WARNING "debug daemon buffer overflowed; " - "discarding 10%% of pages (%d of %ld)\n", + printk(KERN_WARNING "debug daemon buffer overflowed; discarding 10%% of pages (%d of %ld)\n", pgcount + 1, tcd->tcd_cur_pages); INIT_LIST_HEAD(&pc.pc_pages); @@ -357,8 +356,8 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata, } if (*(string_buf+needed-1) != '\n') - printk(KERN_INFO "format at %s:%d:%s doesn't end in " - "newline\n", file, msgdata->msg_line, msgdata->msg_fn); + printk(KERN_INFO "format at %s:%d:%s doesn't end in newline\n", + file, msgdata->msg_line, msgdata->msg_fn); header.ph_len = known_size + needed; debug_buf = (char *)page_address(tage->page) + tage->used; @@ -715,8 +714,8 @@ int cfs_tracefile_dump_all_pages(char *filename) kunmap(tage->page); if (rc != (int)tage->used) { - printk(KERN_WARNING "wanted to write %u but wrote " - "%d\n", tage->used, rc); + printk(KERN_WARNING "wanted to write %u but wrote %d\n", + tage->used, rc); put_pages_back(&pc); __LASSERT(list_empty(&pc.pc_pages)); break; @@ -875,8 +874,8 @@ int cfs_trace_daemon_command(char *str) strcpy(cfs_tracefile, str); printk(KERN_INFO - "Lustre: debug daemon will attempt to start writing " - "to %s (%lukB max)\n", cfs_tracefile, + "Lustre: debug daemon will attempt to start writing to %s (%lukB max)\n", + cfs_tracefile, (long)(cfs_tracefile_size >> 10)); cfs_trace_start_thread(); @@ -914,15 +913,15 @@ int cfs_trace_set_debug_mb(int mb) if (mb < num_possible_cpus()) { printk(KERN_WARNING - "Lustre: %d MB is too small for debug buffer size, " - "setting it to %d MB.\n", mb, num_possible_cpus()); + "Lustre: %d MB is too small for debug buffer size, setting it to %d MB.\n", + mb, num_possible_cpus()); mb = num_possible_cpus(); } if (mb > limit) { printk(KERN_WARNING - "Lustre: %d MB is too large for debug buffer size, " - "setting it to %d MB.\n", mb, limit); + "Lustre: %d MB is too large for debug buffer size, setting it to %d MB.\n", + mb, limit); mb = limit; } @@ -1004,8 +1003,8 @@ static int tracefiled(void *arg) if (IS_ERR(filp)) { rc = PTR_ERR(filp); filp = NULL; - printk(KERN_WARNING "couldn't open %s: " - "%d\n", cfs_tracefile, rc); + printk(KERN_WARNING "couldn't open %s: %d\n", + cfs_tracefile, rc); } } cfs_tracefile_read_unlock(); @@ -1034,8 +1033,8 @@ static int tracefiled(void *arg) kunmap(tage->page); if (rc != (int)tage->used) { - printk(KERN_WARNING "wanted to write %u " - "but wrote %d\n", tage->used, rc); + printk(KERN_WARNING "wanted to write %u but wrote %d\n", + tage->used, rc); put_pages_back(&pc); __LASSERT(list_empty(&pc.pc_pages)); } @@ -1047,8 +1046,7 @@ static int tracefiled(void *arg) if (!list_empty(&pc.pc_pages)) { int i; - printk(KERN_ALERT "Lustre: trace pages aren't " - " empty\n"); + printk(KERN_ALERT "Lustre: trace pages aren't empty\n"); printk(KERN_ERR "total cpus(%d): ", num_possible_cpus()); for (i = 0; i < num_possible_cpus(); i++) @@ -1061,8 +1059,8 @@ static int tracefiled(void *arg) i = 0; list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) - printk(KERN_ERR "page %d belongs to cpu " - "%d\n", ++i, tage->cpu); + printk(KERN_ERR "page %d belongs to cpu %d\n", + ++i, tage->cpu); printk(KERN_ERR "There are %d pages unwritten\n", i); } |