Commit graph

136 commits

Author SHA1 Message Date
Marco Cyriacks 42e7f1df4e staging: lustre: socklnd: Remove static initialization to NULL or 0
This patch fixes the following coding style issue:
ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Marco Cyriacks <marco@cyriacks.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:25:49 -07:00
Janet Liu ebcb983639 staging:lustre:lnet lib-md.c erase space before ')' for code style
Silences the following error:
  ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Janet Liu <jianhua.ljh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:22:07 -07:00
Janet Liu fc8b040d5b staging:lustre:lnet: lib-md.c delete space before '(' for code style
Silences the following checkpatch warning:
  WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Janet Liu <jianhua.ljh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:21:04 -07:00
Julia Lawall fbe7c6c72a staging: lustre: remove parentheses from return arguments
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier i;
constant c;
@@

return
- (
    \(i\|-i\|i(...)\|c\)
- )
  ;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:07:35 -07:00
Greg Donald 1d8cb70c7b drivers: staging: lustre: Fix space required after that ',' errors
Fix checkpatch.pl space required after that ',' errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:05:39 -07:00
Greg Donald 9d0b2b7a07 drivers: staging: lustre: Fix that open brace { should be on the previous line errors
Fix checkpatch.pl that open brace { should be on the previous line errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:01:26 -07:00
Greg Donald a58a38ac0d drivers: staging: lustre: Fix space required before the open parenthesis '(' errors
Fix checkpatch.pl space required before the open parenthesis '(' errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 11:59:52 -07:00
Phong Tran f9cd474f86 staging: lustre: lnet: socklnd_cb.c Fix sparse non-static symbol warning
This patch fixes some non static function declarations that
cause sparse warning. Tested by compilation.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 11:56:33 -07:00
Oleg Drokin 459d3236ad staging/lustre/lnet: Fix potential uninitialized variable warning
Greg reports that with one of the patches in his queue
there's now an unused variable warning in lnet_parse_ip2nets
for ipaddrs variable.
Apparently the warning is a false positive as in all cases where
lnet_ipaddr_enumerate can return without setting ipaddrs to something
a negative return value is returned that is then checked
before we actually use ipaddrs.

Assign ipaddrs to NULL to quiet this.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:18 -07:00
Benedict Boerger 714340db24 drivers: staging: lustre: fix sparse warnings / delete unused function
drivers: staging: lustre: fix sparse warning: symbol XYZ was
not declared. Should it be static?

This was done by declaring them static. This could be done because the functions
were used only in this file.

Deleted the function lnet_print_text_bufs because it were unused.

Compiled without an error.
Done to complete a eudyptula task.

Signed-off-by: Benedict Boerger <benedict.boerger@cs.tu-dortmund.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:11 -07:00
Radek Dostal ea7893bb39 staging: lustre: fix sparse warnings "Using plain integer as NULL pointer"
fixes all sparse warnings "Using plain integer as NULL pointer"
in drivers/staging/lustre

drivers/staging/lustre/lnet/lnet/api-ni.c:1665:32: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lnet/lnet/api-ni.c:1773:35: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/fld/fld_request.c:171:17: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/llite/llite_lib.c:155:30: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/llite/lproc_llite.c:846:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:902:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:946:54: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:2819:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_dev.c:456:66: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/mdc_request.c:2426:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/mdc_request.c:2569:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/mdc_request.c:2740:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:175:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:176:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:177:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:178:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:179:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:180:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:181:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:182:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:183:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:185:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:186:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:193:66: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:194:63: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:195:56: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:196:51: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:197:50: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:198:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:199:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:200:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:206:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:207:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mgc/mgc_request.c:199:9: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:331:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/obd_config.c:1164:53: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/obd_config.c:1306:71: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/llog_test.c:943:62: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/llog_test.c:944:65: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdecho/echo_client.c:3116:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/osc/osc_request.c:3424:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/osc/osc_request.c:3548:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/osc/osc_request.c:3615:46: warning: Using plain integer as NULL pointer

Signed-off-by: Radek Dostal <rd@radekdostal.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-30 17:03:30 -07:00
Matt Kurz c49d4b96ab staging: lustre: Fix sparse warnings
Declare several functions and variables as static in order
to address the following sparse warnings

drivers/staging/lustre/lnet/lnet/acceptor.c:49:3: warning: symbol 'lnet_acceptor_state' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/acceptor.c:79:1: warning: symbol 'lnet_acceptor_get_tunables' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/acceptor.c:211:1: warning: symbol 'lnet_accept' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/acceptor.c:333:1: warning: symbol 'lnet_acceptor' was not declared. Should it be static?

Tested by compilation only.

Signed-off-by: Matt Kurz <matt@ninezulu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22 15:00:33 -07:00
Greg Kroah-Hartman 55f5a824b9 staging: lustre: remove LPX64 define
Just use the proper modifier type...

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 20:26:07 -07:00
Greg Kroah-Hartman b0f5aad587 staging: lustre: remove LPU64 define
Just use the proper modifier type...

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 20:25:57 -07:00
Greg Kroah-Hartman f537dd2c3c staging: lustre: remove LPD64 define
Just use the proper modifier type...

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 18:41:09 -07:00
Greg Kroah-Hartman 9b335e2b2f staging: lustre: clean up some proc file declarations
This removes the DECLARE_PROC_HANDLER macro, and makes proc_call_handler
a static function (horrible name to be in a module).  This makes the
linux-prim.h file empty now, so it can be removed soon.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 18:11:25 -07:00
Greg Kroah-Hartman 3bdb7ce411 staging: lustre: remove LL_PROC_PROTO macro
Spell out what is happening with the proc file functions, it helps to
unwind the call chain mess here.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 18:00:44 -07:00
Greg Kroah-Hartman 699503bcab staging: lustre: remove cfs_time_before()
Just call time_before() instead.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 01:03:41 -07:00
Greg Kroah-Hartman b2d201bd16 staging: lustre: remove cfs_duration_t typedef
Just use 'long' as that is what it was defined as.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 00:45:51 -07:00
Greg Kroah-Hartman 7264b8a5db staging: lustre: remove cfs_time_current_sec wrapper
Just call get_seconds() directly.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 00:38:48 -07:00
Greg Kroah-Hartman a649ad1d7b staging: lustre: remove cfs_time_t typedef
Just use unsigned long everywhere, like the rest of the kernel does.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 00:27:46 -07:00
Greg Kroah-Hartman fb4a153994 staging: lustre: remove linux-tcpip.h
There were just a few macros being used, remove them and have the places
where they were being used to make the proper kernel api call instead.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 00:01:03 -07:00
Greg Kroah-Hartman 490e7dd4f9 staging: lustre: fix makefile build breakage
Forgot to test with infiniband enabled.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11 23:49:54 -07:00
Greg Kroah-Hartman e327dc882d staging: lustre: remove socket_t typedef
Use 'struct socket' like the rest of the kernel does.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org
2014-07-11 23:42:52 -07:00
Greg Kroah-Hartman 691bc0eb29 staging: lustre: remove ctl_table typedefs
No need for these, just use the "real" struct the kernel provides.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11 23:38:41 -07:00
Greg Kroah-Hartman 6de9710b24 staging: lustre: delete linux-lock.h
It was a few empty defines, so just remove the thing.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11 23:28:12 -07:00
Greg Kroah-Hartman 30f38472f7 staging: lustre: remove unneeded DECLARE_LL_PROC_PPOS_DECL macro
It did nothing, so remove it.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11 23:05:14 -07:00
Greg Kroah-Hartman 5c4fcfbe3f staging: lustre: remove some unneeded cflags
The lnet code did not even need the cflags setting in the Makefile, so
remove it, as it is not doing anything at all.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11 20:58:15 -07:00
Greg Kroah-Hartman 9fdaf8c0b9 staging: lustre: remove top level ccflags variable
We need to remove the ccflags from the Lustre code as it prevents
individual object files from building properly in the kernel build
system.  It also hids the horrid mess that the Lustre include files are
made up of.

Start out by removing the toplevel ccflags variable pointing to
drivers/staging/lustre/include/ as a valid include path.  This requires
the absolute include markings of a bunch of .h and .c files, which is
also done here.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11 20:51:16 -07:00
Anil Belur 51bd88146f staging: lustre: lnet: api-ni.c: fixed sparse warnings
- this fixes few sparse warnings for missing static in functions:

drivers/staging/lustre/lnet/lnet/api-ni.c:63:6: warning: symbol 'lnet_get_routes' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:69:6: warning: symbol 'lnet_get_networks' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:93:1: warning: symbol 'lnet_init_locks' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:102:1: warning: symbol 'lnet_fini_locks' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:180:6: warning: symbol 'lnet_assert_wire_constants' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:273:7: warning: symbol 'lnet_find_lnd_by_type' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:419:1: warning: symbol 'lnet_create_interface_cookie' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:450:1: warning: symbol 'lnet_res_container_cleanup' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:494:1: warning: symbol 'lnet_res_container_setup' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:612:1: warning: symbol 'lnet_prepare' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:917:1: warning: symbol 'lnet_shutdown_lndnis' was not declared. Should it be static?
drivers/staging/lustre/lnet/lnet/api-ni.c:1034:1: warning: symbol 'lnet_startup_lndnis' was not declared. Should it be static?

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-29 14:31:40 -07:00
Isaac Huang dee2857e22 staging/lustre/lnet: abort messages whose MD has been unlinked
If LNetMDUnlink has been called, all outgoing messages
on that MD should be aborted before lnet_ni_send() is
called.

Signed-off-by: Isaac Huang <he.huang@intel.com>
Reviewed-on: http://review.whamcloud.com/8041
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4006
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:45:06 -04:00
James A Shackleford 0b913529c7 staging: lustre: fix sparse warnings for static symbols
This patch fixes the following sparse warnings:

drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:46:20: warning: symbol 'the_ksocklnd' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:49:19: warning: symbol 'ksocknal_ip2iface' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:67:15: warning: symbol 'ksocknal_create_route' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:103:1: warning: symbol 'ksocknal_create_peer' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:218:1: warning: symbol 'ksocknal_unlink_peer_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:248:1: warning: symbol 'ksocknal_get_peer_info' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:323:1: warning: symbol 'ksocknal_associate_route_conn_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:368:1: warning: symbol 'ksocknal_add_route_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:409:1: warning: symbol 'ksocknal_del_route_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:511:1: warning: symbol 'ksocknal_del_peer_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:566:1: warning: symbol 'ksocknal_del_peer' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:624:14: warning: symbol 'ksocknal_get_conn_by_idx' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:661:15: warning: symbol 'ksocknal_choose_scheduler_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:685:1: warning: symbol 'ksocknal_local_ipvec' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:713:1: warning: symbol 'ksocknal_match_peerip' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:745:1: warning: symbol 'ksocknal_select_ips' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:847:1: warning: symbol 'ksocknal_create_routes' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:997:1: warning: symbol 'ksocknal_connecting' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:1853:1: warning: symbol 'ksocknal_push_peer' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:1886:1: warning: symbol 'ksocknal_push' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:1935:1: warning: symbol 'ksocknal_add_interface' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:1997:1: warning: symbol 'ksocknal_peer_del_interface_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2038:1: warning: symbol 'ksocknal_del_interface' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2213:1: warning: symbol 'ksocknal_free_buffers' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2256:1: warning: symbol 'ksocknal_base_shutdown' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2349:1: warning: symbol 'ksocknal_new_incarnation' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2364:1: warning: symbol 'ksocknal_base_startup' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2496:1: warning: symbol 'ksocknal_debug_peerhash' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2603:1: warning: symbol 'ksocknal_enumerate_interfaces' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2660:1: warning: symbol 'ksocknal_search_new_ipif' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2702:1: warning: symbol 'ksocknal_start_schedulers' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2748:1: warning: symbol 'ksocknal_net_start_threads' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2860:1: warning: symbol 'ksocknal_module_fini' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2866:1: warning: symbol 'ksocknal_module_init' was not declared. Should it be static?

Signed-off-by: James A Shackleford <shack@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 14:10:51 -04:00
Vitaly Osipov cab80d98f5 staging: lustre: remove memset(0) after LIBCFS_ALLOC
Joe Perches mentioned on driverdev-devel that memset after LIBCFS_ALLOC
is not necessary as it is already done during LIBCFS_ALLOC_POST. This
commit removes these unnecessary memsets. Based on the results of running
a cocci patch along the lines of:

@@
expression E1, E2;
@@

LIBCFS_ALLOC (E1,E2);
...
- memset(E1,0,E2);

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 15:36:35 -07:00
John Church 24008203f8 staging: lustre: fix sparse warnings for undeclared symbols
This patch fixes the following sparse warnings for drivers/staging/lustre/lnet/lnet/router.c:

router.c:139:1: warning: symbol 'lnet_ni_notify_locked' was not declared. Should it be static?
router.c:277:1: warning: symbol 'lnet_add_route_to_rnet' was not declared. Should it be static?

Signed-off-by: John Church <sleeveroller@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 15:33:09 -07:00
Masaru Nomura 7139709576 staging: lustre: socklnd: Remove unnecessary return brackets
Remove unnecessary brackets from return statements in socklnd.c,
socklnd.h, socklnd_cb.c and socklnd_lib-linux.c to meet
kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 21:04:00 +09:00
Masaru Nomura 4b18c358e1 staging: lustre: socklnd: Remove unnecessary line continuation
Remove unnecessary line continuation '\' in socklnd.c to meet
kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 21:03:19 +09:00
Masaru Nomura a10f33e960 staging: lustre: socklnd: Fix indenting
Fixed indenting of if statement in socklnd.c to meet kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 21:01:41 +09:00
Masaru Nomura 991cc8d611 staging: lustre: socklnd: Add a required space
Added a required space before open brace and parenthsis
in socklnd.c to meet kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 21:01:41 +09:00
Masaru Nomura a1f659d41e staging: lustre: socklnd: Remove unnecessary () from return statement
Remove unnecessary brackets from return statements in socklnd.c
to meet kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 21:01:41 +09:00
Zi Shen Lim a8046a28c8 staging/lustre: fix sparse warnings in o2iblnd_cb.c
This patch fixes the following sparse warnings:

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:44:1: warning: symbol 'kiblnd_tx_done' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:102:10: warning: symbol 'kiblnd_get_idle_tx' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:131:1: warning: symbol 'kiblnd_drop_rx' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:212:10: warning: symbol 'kiblnd_find_waiting_tx_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:238:1: warning: symbol 'kiblnd_handle_completion' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:277:1: warning: symbol 'kiblnd_send_completion' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:296:1: warning: symbol 'kiblnd_handle_rx' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:457:1: warning: symbol 'kiblnd_rx_complete' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:527:13: warning: symbol 'kiblnd_kvaddr_to_page' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:699:1: warning: symbol 'kiblnd_setup_rd_iov' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:752:1: warning: symbol 'kiblnd_setup_rd_kiov' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:792:1: warning: symbol 'kiblnd_post_tx_locked' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:996:1: warning: symbol 'kiblnd_tx_complete' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1270:1: warning: symbol 'kiblnd_connect_peer' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1627:1: warning: symbol 'kiblnd_reply' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1814:1: warning: symbol 'kiblnd_thread_fini' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1828:1: warning: symbol 'kiblnd_peer_notify' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1934:1: warning: symbol 'kiblnd_handle_early_rxs' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1957:1: warning: symbol 'kiblnd_abort_txs' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1993:1: warning: symbol 'kiblnd_finalise_conn' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:2167:1: warning: symbol 'kiblnd_reject' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:2178:1: warning: symbol 'kiblnd_passive_connect' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:2452:1: warning: symbol 'kiblnd_reconnect' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:2516:1: warning: symbol 'kiblnd_rejected' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:2655:1: warning: symbol 'kiblnd_check_connreply' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:2754:1: warning: symbol 'kiblnd_active_connect' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:3025:1: warning: symbol 'kiblnd_check_conns' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:3108:1: warning: symbol 'kiblnd_disconnect_conn' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:3247:1: warning: symbol 'kiblnd_complete' was not declared. Should it be static?
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:904:20: warning: context imbalance in 'kiblnd_post_tx_locked' - unexpected unlock

Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:59:43 +09:00
Toby Smith 5f5b738480 staging: lustre: fix sparse warning "should it be static"
Fix the following warning in lib-eq.c
warning: symbol 'lnet_eq_dequeue_event' was not declared. Should it be static?

Signed-off-by: Toby Smith <toby@tismith.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:58:12 +09:00
Toby Smith e69ae73b62 staging: lustre: fix sparse warning "unexpected unlock"
Fix the following warning in lib-eq.c
warning: context imbalance in 'lnet_eq_wait_locked' - unexpected unlock

Signed-off-by: Toby Smith <toby@tismith.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:58:12 +09:00
Dan Carpenter 751a624adb staging: lustre: info leak in lnet_ping()
On 64 bit systems there is a 4 byte hole after the last member of the
struct.  We should clear it to avoid disclosing stack information.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16 16:10:41 -07:00
Fredrick John Berchmans 80db2734ac staging: lustre use kernel socket sockopt apis
Change old way of ops->setsockopt or ops->getsockopt in kernel
to kernel_setsockopt or kernel_getsockopt.

Signed-off-by: Fredrick John Berchmans <fredrickprashanth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:38:09 -04:00
Oleg Drokin d36175e9d2 staging/lustre/lnet: fix potential null pointer dereference
Pointer 'ni' checked for NULL at line 1569 may be passed to
function and may be dereferenced there by passing argument 1 to
function 'lnet_ni_notify_locked' at line 1621.
found by Klocwork Insight tool

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
CC: Dmitry Eremin <dmitry.eremin@intel.com>
CC: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:35:21 -04:00
Dmitry Eremin 109dae8dab staging/lustre/lnet: fix potential null pointer dereference in kiblnd_rejected
Null pointer 'cp' that comes from line 2544 may be dereferenced
at line 2618.
found by Klocwork Insight tool

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: http://review.whamcloud.com/9386
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:35:21 -04:00
Dmitry Eremin 1ae2bdb21e staging/lustre/lnet: remove unused variable in lnet_destroy_remote_nets_table
Local variable 'hash' is never used
found by Klocwork Insight tool

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: http://review.whamcloud.com/9386
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:35:20 -04:00
Oleg Drokin f39489e269 staging/lustre/lnet: Drop useless LASSERT in ksocknal_select_ips
It should never be NULL because our interface list is up to date,
and even if it does, we'll just crash anyway so we are no better off.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:35:20 -04:00
Liang Zhen 526cdb4f3e staging/lustre/lnet: NI shutdown may loop forever
lnet_shutdown_lndnis() may enter endless loop if there is a busy NI,
this is injected by LNet SMP improvements. It's fixed in this patch.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-on: http://review.whamcloud.com/9706
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4780
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27 10:27:12 -07:00
Ann Koehler 0be19afa74 staging/lustre: restore __GFP_WAIT flag to memalloc calls
In Lustre 2.4, the flags passed to the memory allocation functions are
translated from CFS enumeration values types to the kernel GFP
values by calling cfs_alloc_flags_to_gfp(). This function adds
__GFP_WAIT to all flags except CFS_ALLOC_ATOMIC. In 2.5, when
the cfs wrappers were dropped, cfs_alloc_flags_to_gfp() was
removed and the CFS_ALLOC_xxxx was simply replaced with __GFP_xxxx.
This means that most memory allocation calls are missing the
__GFP_WAIT flag. The result is that Lustre experiences more ENOMEM
errors, many of which the higher levels of Lustre do not handle
robustly.
Notes GFP_NOFS = __GFP_WAIT | __GFP_IO. So the patch replaces
__GFP_IO with GFP_NOFS.
Patch does not add __GFP_WAIT to GFP_IOFS. GFP_IOFS was not used in
Lustre 2.4 so it has never been used with __GFP_WAIT.

Signed-off-by: Ann Koehler <amk@cray.com>
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-on: http://review.whamcloud.com/9223
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4357
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27 10:23:15 -07:00