GitHub/moto-9609/android_kernel_motorola_exynos9610.git
8 years agostaging: wilc1000: fix return type of wilc_get_rssi
Chaehyun Lim [Thu, 24 Dec 2015 07:52:36 +0000 (16:52 +0900)]
staging: wilc1000: fix return type of wilc_get_rssi

This patch changes return type of wilc_get_rssi from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove wilc_free_join_params
Chaehyun Lim [Thu, 24 Dec 2015 07:52:35 +0000 (16:52 +0900)]
staging: wilc1000: remove wilc_free_join_params

wilc_free_join_params call kfree. There is no need to use
wrapper function, so use kfree directly.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename u16ReasonCode in wilc_disconnect
Chaehyun Lim [Thu, 24 Dec 2015 07:52:34 +0000 (16:52 +0900)]
staging: wilc1000: rename u16ReasonCode in wilc_disconnect

This patch renames u16ReasonCode to reason_code to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_disconnect
Chaehyun Lim [Thu, 24 Dec 2015 07:52:33 +0000 (16:52 +0900)]
staging: wilc1000: fix return type of wilc_disconnect

This patch changes return type of wilc_disconnect from s32 to int.
The result variable gets return value from wilc_disconnect that has
return type of int. It should be changed return type of this function as
well as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use kmemdup instead of kmalloc and memcpy
Chaehyun Lim [Thu, 24 Dec 2015 07:52:32 +0000 (16:52 +0900)]
staging: wilc1000: use kmemdup instead of kmalloc and memcpy

This patch changes kmalloc/memcpy to kmemdup.
It is also added error checking to return -ENOMEM if kmemdup is failed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pJoinParams in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:31 +0000 (16:52 +0900)]
staging: wilc1000: rename pJoinParams in wilc_set_join_req

This patch renames pJoinParams to join_params to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename u8channel in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:30 +0000 (16:52 +0900)]
staging: wilc1000: rename u8channel in wilc_set_join_req

This patch renames u8channel to channel to remove u8 prefix.
There is no need to add prefix in order to show data type of this
variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename tenuAuth_type in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:29 +0000 (16:52 +0900)]
staging: wilc1000: rename tenuAuth_type in wilc_set_join_req

This patch renames tenuAuth_type to auth_type to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename u8security in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:28 +0000 (16:52 +0900)]
staging: wilc1000: rename u8security in wilc_set_join_req

This patch renames u8security to security to remove u8 prefix.
There is no need to add prefix in order to show data type of this
variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pvUserArg in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:27 +0000 (16:52 +0900)]
staging: wilc1000: rename pvUserArg in wilc_set_join_req

This patch renames pvUserArg to user_arg to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pfConnectResult in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:26 +0000 (16:52 +0900)]
staging: wilc1000: rename pfConnectResult in wilc_set_join_req

This patch renames pfConnectResult to connect_result to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename IEsLen in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:25 +0000 (16:52 +0900)]
staging: wilc1000: rename IEsLen in wilc_set_join_req

This patch renames IEsLen to ies_len to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pu8IEs in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:24 +0000 (16:52 +0900)]
staging: wilc1000: rename pu8IEs in wilc_set_join_req

This patch renames pu8IEs to ies to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename ssidLen in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:23 +0000 (16:52 +0900)]
staging: wilc1000: rename ssidLen in wilc_set_join_req

This patch renames ssidLen to ssid_len to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pu8ssid in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:22 +0000 (16:52 +0900)]
staging: wilc1000: rename pu8ssid in wilc_set_join_req

This patch renames pu8ssid to ssid to remove pu8 prefix.
There is no need to add this prefix in order to show data type of this
variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pu8bssid in wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:21 +0000 (16:52 +0900)]
staging: wilc1000: rename pu8bssid in wilc_set_join_req

This patch renames pu8bssid to bssid to remove pu8 prefix.
There is no need to add this prefix in order to show data type of this
variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_set_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:20 +0000 (16:52 +0900)]
staging: wilc1000: fix return type of wilc_set_join_req

This patch changes return type of wilc_set_join_req from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_flush_join_req
Chaehyun Lim [Thu, 24 Dec 2015 07:52:19 +0000 (16:52 +0900)]
staging: wilc1000: fix return type of wilc_flush_join_req

This patch changes return type of wilc_flush_join_req from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replace numerical constant with predefined MACRO
Hari Prasath Gujulan Elango [Tue, 22 Dec 2015 11:44:43 +0000 (11:44 +0000)]
staging: wilc1000: replace numerical constant with predefined MACRO

Replace the pre-defined macro signifying the ethernet protocol type
defined in the kernel headers instead of the numerical constant

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove wilc_sdio_init
Glen Lee [Thu, 24 Dec 2015 06:02:52 +0000 (15:02 +0900)]
staging: wilc1000: remove wilc_sdio_init

wilc_sdio_init return always 1, which is needless. Remove it and it's related
codes also.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix always return 0 error
Glen Lee [Thu, 24 Dec 2015 06:02:51 +0000 (15:02 +0900)]
staging: wilc1000: fix always return 0 error

This patch fixes a bug that return always 0 so it fails every time.

Fixes: c1af9db78950 ("staging: wilc1000: call linux_sdio_init instead of io_init")
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pu8MacAddress in wilc_set_mac_address
Chaehyun Lim [Tue, 22 Dec 2015 00:49:09 +0000 (09:49 +0900)]
staging: wilc1000: rename pu8MacAddress in wilc_set_mac_address

This patch changes pu8MacAddress to mac_addr to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_set_mac_address
Chaehyun Lim [Tue, 22 Dec 2015 00:49:08 +0000 (09:49 +0900)]
staging: wilc1000: fix return type of wilc_set_mac_address

This patch changes return type of wilc_set_mac_address from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pu8MacAddress in wilc_get_mac_address
Chaehyun Lim [Tue, 22 Dec 2015 00:49:07 +0000 (09:49 +0900)]
staging: wilc1000: rename pu8MacAddress in wilc_get_mac_address

This patch changes pu8MacAddress to mac_addr to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_get_mac_address
Chaehyun Lim [Tue, 22 Dec 2015 00:49:06 +0000 (09:49 +0900)]
staging: wilc1000: fix return type of wilc_get_mac_address

This patch changes return type of wilc_get_mac_address from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename pu8PmkidInfoArray in wilc_set_pmkid_info
Chaehyun Lim [Tue, 22 Dec 2015 00:49:05 +0000 (09:49 +0900)]
staging: wilc1000: rename pu8PmkidInfoArray in wilc_set_pmkid_info

This patch changes pu8PmkidInfoArray to pmkid to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replace u32 with int
Chaehyun Lim [Tue, 22 Dec 2015 00:49:04 +0000 (09:49 +0900)]
staging: wilc1000: replace u32 with int

The data type of variable i changes u32 to int.
It is used as array index to copy some data with memcpy function
so that it is better to use data type of int.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_set_pmkid_info
Chaehyun Lim [Tue, 22 Dec 2015 00:49:03 +0000 (09:49 +0900)]
staging: wilc1000: fix return type of wilc_set_pmkid_info

This patch changes return type of wilc_set_pmkid_info from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove wilc_set_start_scan_req declaration
Chaehyun Lim [Tue, 22 Dec 2015 00:49:02 +0000 (09:49 +0900)]
staging: wilc1000: remove wilc_set_start_scan_req declaration

This patch deletes wilc_set_start_scan_req declaration. It is not find
wilc_set_start_scan_req definition in this driver.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove wilc_add_tx_gtk declaration
Chaehyun Lim [Tue, 22 Dec 2015 00:49:01 +0000 (09:49 +0900)]
staging: wilc1000: remove wilc_add_tx_gtk declaration

This patch deletes wilc_add_tx_gtk declaration. It is not find
wilc_add_tx_gtk definition in this driver.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: match argument name of wilc_add_rx_gtk declaration
Chaehyun Lim [Tue, 22 Dec 2015 00:49:00 +0000 (09:49 +0900)]
staging: wilc1000: match argument name of wilc_add_rx_gtk declaration

Some argument name of wilc_add_rx_gtk declaration is different to those
of this function definition. It is changed as same name of this function
declaration and definition.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_add_rx_gtk declaration
Chaehyun Lim [Tue, 22 Dec 2015 00:48:59 +0000 (09:48 +0900)]
staging: wilc1000: fix return type of wilc_add_rx_gtk declaration

This patch changes return type of wilc_add_rx_gtk declaration from s32
to int. The return type of this function declaration and definition
should be same as data type of int.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: match argument name of wilc_add_ptk declaration
Chaehyun Lim [Tue, 22 Dec 2015 00:48:58 +0000 (09:48 +0900)]
staging: wilc1000: match argument name of wilc_add_ptk declaration

Some arguments name of wilc_add_pkt declaration is different to those of
this function definition. It is changed as same name of this function
declaration and definition.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix return type of wilc_add_pkt declaration
Chaehyun Lim [Tue, 22 Dec 2015 00:48:57 +0000 (09:48 +0900)]
staging: wilc1000: fix return type of wilc_add_pkt declaration

This patch changes return type of wilc_add_pkt declaration from s32 to
int. The return type of this function declaration and definition should
be same as data type of int.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging:lustre:lclient:Remove unused function
Bhumika Goyal [Fri, 29 Jan 2016 08:44:26 +0000 (14:14 +0530)]
Staging:lustre:lclient:Remove unused function

Discard the function ccc_vmpage_page_transient as it is not used
anywhere in the kernel.
Used grep to find occurences.
Problem found using sparse.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging:lustre:lustre:llite:Remove explicit NULL comparision
Bhumika Goyal [Sat, 23 Jan 2016 13:11:53 +0000 (18:41 +0530)]
Staging:lustre:lustre:llite:Remove explicit NULL comparision

Replaced explicit NULL comparision with its simplier form.
Found using coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging:lustre:obdclass:linux:simplify NULL comparison
Bhumika Goyal [Wed, 20 Jan 2016 18:47:45 +0000 (00:17 +0530)]
Staging:lustre:obdclass:linux:simplify NULL comparison

Remove explicit NULL comparision and replace it with a simpier form.
Detected using checkpatch.pl.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging:lustre:obdclass:linux:remove unnecessary braces
Bhumika Goyal [Wed, 20 Jan 2016 18:47:44 +0000 (00:17 +0530)]
Staging:lustre:obdclass:linux:remove unnecessary braces

Fixed 'braces {} are not necessary for single statement blocks'
checkpatch.pl warning.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix comment style
Sushuruth Sadagopan [Mon, 18 Jan 2016 07:09:23 +0000 (02:09 -0500)]
staging: lustre: fix comment style

Fix style of several comments.

Signed-off-by: Sushuruth Sadagopan <sushsada@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lustre: lov: Added space
Anjali Menon [Sat, 16 Jan 2016 10:00:50 +0000 (15:30 +0530)]
staging: lustre: lustre: lov: Added space

Added a spaces around '|' to fix the check detected by
checkpatch.pl

CHECK: spaces preferred around that '|' (ctx:VxV)

Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging:lustre:lustre:obdclass:Remove return from void function
Bhumika Goyal [Fri, 15 Jan 2016 06:02:11 +0000 (11:32 +0530)]
Staging:lustre:lustre:obdclass:Remove return from void function

This patch removes the return statement at the end of a void function as
it is not necessary.This was found by checkpatch.pl .

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: remove obsolete comment in libcfs_ioctl.h
Parinay Kondekar [Tue, 5 Jan 2016 19:35:13 +0000 (14:35 -0500)]
staging:lustre: remove obsolete comment in libcfs_ioctl.h

The libcfs_ioctl.h header has a comment about a snapshot ioctl
which has been removed for years. Lets remove the comment to
avoid confusion. Broken out of patch 17492.

Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Add __user annotations in lnetselftest code
Frank Zago [Sun, 3 Jan 2016 17:06:00 +0000 (12:06 -0500)]
staging/lustre: Add __user annotations in lnetselftest code

This fixes a bunch of sparse warnings.

There is no code change.

Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11819
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: Update ll_dir_ioctl pointer casts with __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:59 +0000 (12:05 -0500)]
staging/lustre/llite: Update ll_dir_ioctl pointer casts with __user

When casting unsingned long userspace pointer from ioctl argument to
a pointer suitable for use with userspace access functions, need
to remember to add __user attribute, to make sparse happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Properly cast ll_getname argument to __user in ll_dir_ioctl
Oleg Drokin [Sun, 3 Jan 2016 17:05:58 +0000 (12:05 -0500)]
staging/lustre: Properly cast ll_getname argument to __user in ll_dir_ioctl

This makes sparse happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Properly cast ll_fid2path argument to __user in ll_dir_ioctl
Oleg Drokin [Sun, 3 Jan 2016 17:05:57 +0000 (12:05 -0500)]
staging/lustre: Properly cast ll_fid2path argument to __user in ll_dir_ioctl

This makes sparse happier.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Properly cast ll_fid2path argument to __user in ll_file_ioctl
Oleg Drokin [Sun, 3 Jan 2016 17:05:56 +0000 (12:05 -0500)]
staging/lustre: Properly cast ll_fid2path argument to __user in ll_file_ioctl

When calling ll_fid2path, it expects a userspace pointer.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: Update all file.c user pointer casts to __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:55 +0000 (12:05 -0500)]
staging/lustre/llite: Update all file.c user pointer casts to __user

unsigned long user address must be casted with __user attribute
to make sparse happy when used with userspace access functions.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Mark lmv_hsm_ct_register/unregister uarg as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:54 +0000 (12:05 -0500)]
staging/lustre: Mark lmv_hsm_ct_register/unregister uarg as __user

Since it is a userspace pointer, this makes things neater and
sparse happier.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Properly mark lmv_fid2path uarg argment as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:53 +0000 (12:05 -0500)]
staging/lustre: Properly mark lmv_fid2path uarg argment as __user

This makes sparse happy too.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lloop: Properly mark userspace pointers in lo/lloop_ioctl
Oleg Drokin [Sun, 3 Jan 2016 17:05:52 +0000 (12:05 -0500)]
staging/lustre/lloop: Properly mark userspace pointers in lo/lloop_ioctl

When casting unsigned long userspace pointer for use with
userspace-accessing functions, need to use __user attribute to make
sparse happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/osc: Mark osc_getstripe user pointer argument as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:51 +0000 (12:05 -0500)]
staging/lustre/osc: Mark osc_getstripe user pointer argument as __user

This shuts some sparse address space mismatch warnings

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: Update llite_lib.c with proper __user attributes
Oleg Drokin [Sun, 3 Jan 2016 17:05:50 +0000 (12:05 -0500)]
staging/lustre/llite: Update llite_lib.c with proper __user attributes

Casts for get/put_user and copy_to/from_user should have __user
attribute for the userspace buffer address.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Declare lov_getstripe lump argument as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:49 +0000 (12:05 -0500)]
staging/lustre: Declare lov_getstripe lump argument as __user

This is a user pointer, so that makes sparse a lot happier.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: Fix improper userspace access in ll_fiemap
Oleg Drokin [Sun, 3 Jan 2016 17:05:48 +0000 (12:05 -0500)]
staging/lustre/llite: Fix improper userspace access in ll_fiemap

Cannot use memcpy, but use copy_to/from_user instead

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: Properly mark ll_obd_statfs argument as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:47 +0000 (12:05 -0500)]
staging/lustre/llite: Properly mark ll_obd_statfs argument as __user

Also update all callers.
This fixes a bunch of address space mismatch warnings from sparse.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/osc: Do not use lprocfs_write_helper in sysfs store methods
Oleg Drokin [Sun, 3 Jan 2016 17:05:46 +0000 (12:05 -0500)]
staging/lustre/osc: Do not use lprocfs_write_helper in sysfs store methods

sysfs store methods provide us with a kernel buffer already, but
lprocfs_write_helper is expecting a user buffer.
Replace lprocfs_write_helper with kstrto[u]int() calls instead in
contention_seconds_store() and lockless_truncate_store()

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Declare lprocfs_write_frac_u64_helper argument as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:45 +0000 (12:05 -0500)]
staging/lustre: Declare lprocfs_write_frac_u64_helper argument as __user

The buffer that lprocfs_write_frac_u64_helper is working on is
presumed to be a userspace one, so it's not suitable for use
on kernel buffers.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Properly mark argument to p_ioctl in cfs_psdev_ops as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:44 +0000 (12:05 -0500)]
staging/lustre: Properly mark argument to p_ioctl in cfs_psdev_ops as __user

This also silents a sparse address space warning

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Properly mark obd_iocontrol argument as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:43 +0000 (12:05 -0500)]
staging/lustre: Properly mark obd_iocontrol argument as __user

Also update all methods and calls everywhere.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Get rid of an ugly statfs hack in lov_iocontrol
Oleg Drokin [Sun, 3 Jan 2016 17:05:42 +0000 (12:05 -0500)]
staging/lustre: Get rid of an ugly statfs hack in lov_iocontrol

For some crazy reason ll_obd_statfs decided to decode async flag
passed from userspace and then pass it via a userspace pointer
argument to lov_iocontrol.
This patch moves flags decoding to lov_iocontrol where it belongs.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lnet: Properly mark userspace pointer of lnet_ping()
Oleg Drokin [Sun, 3 Jan 2016 17:05:41 +0000 (12:05 -0500)]
staging/lustre/lnet: Properly mark userspace pointer of lnet_ping()

This also happens to silence sparce warnings about different
address spaces.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Mark obd_ioctl_popdata/getdata argument as __user
Oleg Drokin [Sun, 3 Jan 2016 17:05:40 +0000 (12:05 -0500)]
staging/lustre: Mark obd_ioctl_popdata/getdata argument as __user

arg is a userspace pointer and marking it as such makes sparse happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Update user pointers in struct obd_ioctl_data
Oleg Drokin [Sun, 3 Jan 2016 17:05:39 +0000 (12:05 -0500)]
staging/lustre: Update user pointers in struct obd_ioctl_data

Make them void __user * instead of char * (or char __user *),
void * removes the necessity of explicit casts to proper type
where people also need to remember __user qualifiers, so I think
it works better here.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Change ioctl user pointers in libcfs_ioctl_data
Oleg Drokin [Sun, 3 Jan 2016 17:05:38 +0000 (12:05 -0500)]
staging/lustre: Change ioctl user pointers in libcfs_ioctl_data

Make them void __user * instead of char * (or char __user *),
void * removes the necessity of explicit casts to proper type
where people also need to remember __user qualifiers, so I think
it works better here.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Add __user attributes to libcfs_ioctl_get/popdata args
Oleg Drokin [Sun, 3 Jan 2016 17:05:37 +0000 (12:05 -0500)]
staging/lustre: Add __user attributes to libcfs_ioctl_get/popdata args

Just make clear which pointers are from userspace and which are not in
libcfs_ioctl_getdata/libcfs_ioctl_popdata and their callers.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdecho: remove userspace LSM handling
John L. Hammond [Sun, 3 Jan 2016 17:05:36 +0000 (12:05 -0500)]
staging/lustre/obdecho: remove userspace LSM handling

In lustre/obdecho/echo_client.c, remove handling of lov_stripe_md
passed from userspace (since userspace never passes it). Remove the
LOV specific code (ed_next_islov) from the echo client (since it
doesn't work).

Remove echo_get_stripe_off_id() and all calls to it since the stripe
count of the passed in lsm is always 0 and the funciton does nothing
in this case. Remove the then unused lsm parameters of
echo_client_page_debug_setup() and echo_client_page_debug_check().

In the OBD_IOC_GETATTR and OBD_IOC_SETATTR cases of
echo_client_iocontrol() do not set the oi_md member of struct obd_info
since only LOV OBD methods access it.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/12446
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdecho: Remove unused ioctls
Oleg Drokin [Sun, 3 Jan 2016 17:05:35 +0000 (12:05 -0500)]
staging/lustre/obdecho: Remove unused ioctls

Remove long unused ECHO_IOC_GET_STRIPE, ECHO_IOC_SET_STRIPE,
ECHO_IOC_ENQUEUE and ECHO_IOC_CANCEL ioctls.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lnet: Get rid of IOC_LIBCFS_PORTALS_COMPATIBILITY ioctl
Oleg Drokin [Sun, 3 Jan 2016 17:05:34 +0000 (12:05 -0500)]
staging/lustre/lnet: Get rid of IOC_LIBCFS_PORTALS_COMPATIBILITY ioctl

This has been unused for ages and could be safely removed now.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lnet: Get rid of IOC_LIBCFS_DEBUG_PEER hack
Oleg Drokin [Sun, 3 Jan 2016 17:05:33 +0000 (12:05 -0500)]
staging/lustre/lnet: Get rid of IOC_LIBCFS_DEBUG_PEER hack

IOC_LIBCFS_DEBUG_PEER was added back in the stone ages to print debug
statistics on a peer when peer timeout happens.
Redo it properly as a separate LNet API call,
also get rid of "ioctl" forwarding into the underlying LNDs,
since no current LNDs implement this function anymore.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lnet: Make lnet_ping static
Oleg Drokin [Sun, 3 Jan 2016 17:05:32 +0000 (12:05 -0500)]
staging/lustre/lnet: Make lnet_ping static

It's not used anywhere outside of api-ni.c anyway.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: constify export_operations structures
Julia Lawall [Fri, 1 Jan 2016 09:02:03 +0000 (10:02 +0100)]
staging/lustre/llite: constify export_operations structures

This export_operations structure is never modified, so declare it as const.
Most other structures of this type are already const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdecho: constify lu_device_operations and cl_device_operations...
Julia Lawall [Fri, 1 Jan 2016 08:37:03 +0000 (09:37 +0100)]
staging: lustre: obdecho: constify lu_device_operations and cl_device_operations structures

These lu_device_operations and cl_device_operations structures are never
modified, so declare them as const.  Other structures of these types are
already const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix lock imbalance
Joshua Clayton [Sun, 27 Dec 2015 06:47:36 +0000 (22:47 -0800)]
staging: lustre: fix lock imbalance

nrs_resource_put_safe() might hold a lock one one struct
while operating on the other.
There are 2 levels of structures.
Use nrs_policy_put(), which has locking baked in.

sparse gives the following warning:
drivers/staging/lustre//lustre/ptlrpc/nrs.c:498:39:
warning: context imbalance in 'nrs_resource_put_safe' -
  different lock contexts for basic block

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/staging/lustre: Nuke another unsigned >= 0 assert
Valdis Kletnieks [Wed, 23 Dec 2015 00:36:54 +0000 (19:36 -0500)]
drivers/staging/lustre: Nuke another unsigned >= 0 assert

Clean up another case of the compiler remininding the programmer they
are an idiot:

drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c:308:34: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  LASSERT(page_pools.epp_waitqlen >= 0);

Just lose the assert, and save a page of compiler spew.

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/staging/lustre: Nuke an unsigned >= 0 assert
Valdis Kletnieks [Wed, 23 Dec 2015 00:36:53 +0000 (19:36 -0500)]
drivers/staging/lustre: Nuke an unsigned >= 0 assert

Writing asserts for almost-never-can-happen things can be valuable.
Writing an assert that tests that an "unsigned int" hasn't gone negative
isn't.

And it generates an *ugly* message:

drivers/staging/lustre/lustre/llite/rw.c:763:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
                    ^
include/linux/compiler.h:137:45: note: in definition of macro 'unlikely'
 #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                             ^
drivers/staging/lustre/lustre/llite/rw.c:763:2: note: in expansion of macro 'LASSERTF'
  LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
  ^
drivers/staging/lustre/lustre/llite/rw.c:763:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
                    ^
include/linux/compiler.h:137:53: note: in definition of macro 'unlikely'
 #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                     ^
drivers/staging/lustre/lustre/llite/rw.c:763:2: note: in expansion of macro 'LASSERTF'
  LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
  ^
drivers/staging/lustre/lustre/llite/rw.c:763:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
                    ^
include/linux/compiler.h:110:47: note: in definition of macro 'likely_notrace'
 #define likely_notrace(x) __builtin_expect(!!(x), 1)
                                               ^
include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
 #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                          ^
drivers/staging/lustre/lustre/llite/../include/linux/../../../include/linux/libcfs/libcfs_private.h:58:6: note: in expansion of macro 'unlikely'
  if (unlikely(!(cond))) {     \
      ^
drivers/staging/lustre/lustre/llite/rw.c:763:2: note: in expansion of macro 'LASSERTF'
  LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
  ^

Umm, thank you, GCC.  We'll delete the problem line so we never see that spew again.

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/staging/lustre: Fix another C compiler whine: set but not used
Valdis Kletnieks [Wed, 23 Dec 2015 00:36:52 +0000 (19:36 -0500)]
drivers/staging/lustre: Fix another C compiler whine: set but not used

  CC [M]  drivers/staging/lustre/lustre/libcfs/module.o
drivers/staging/lustre/lustre/libcfs/module.c: In function 'lustre_insert_debugfs':
drivers/staging/lustre/lustre/libcfs/module.c:670:17: warning: variable 'entry' set but not used [-Wunused-but-set-variable]
  struct dentry *entry;
                     ^

Just ignore the dentry returned, and add a comment that we *know*
we're not really leaking the dentry because something else will be able
to reap it via recursion.

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/staging/lustre: Clean up another C warnining: set but not used
Valdis Kletnieks [Wed, 23 Dec 2015 00:36:51 +0000 (19:36 -0500)]
drivers/staging/lustre: Clean up another C warnining: set but not used

drivers/staging/lustre/lustre/fid/../include/lustre_cfg.h: In function 'lustre_cfg_free':
drivers/staging/lustre/lustre/fid/../include/lustre_cfg.h:253:6: warning: variable 'len' set but not used [-Wunused-but-set-variable]
  int len;

Yep, we're just gonna call kfree, no need to calculate len. Bye-bye.

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/staging/lustre: Fix set-but-unused whinge.
Valdis Kletnieks [Wed, 23 Dec 2015 00:36:50 +0000 (19:36 -0500)]
drivers/staging/lustre: Fix set-but-unused whinge.

drivers/staging/lustre/lustre/fid/lproc_fid.c: In function 'ldebugfs_fid_write_common':
drivers/staging/lustre/lustre/fid/lproc_fid.c:67:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
  int rc;

We fix it by *using* the return code to help bulletproof it.  It says it's
test code - it should be *more* bulletproof than production, not less.

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/staging/lustre: Silence warning about 'inline'
Valdis Kletnieks [Wed, 23 Dec 2015 00:36:49 +0000 (19:36 -0500)]
drivers/staging/lustre: Silence warning about 'inline'

Low-hanging fruit first:

  CC [M]  drivers/staging/lustre/lustre/fid/fid_request.o
In file included from drivers/staging/lustre/lustre/fid/../include/lustre_net.h:66:0,
                 from drivers/staging/lustre/lustre/fid/../include/lustre_lib.h:64,
                 from drivers/staging/lustre/lustre/fid/../include/obd.h:52,
                 from drivers/staging/lustre/lustre/fid/fid_request.c:48:
drivers/staging/lustre/lustre/fid/../include/lu_object.h:765:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static const inline struct lu_device_operations *
 ^

So we just swap inline and const.  272 warnings gone. :)

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: cleanup white space in kernel comm code
James Simmons [Wed, 23 Dec 2015 21:24:52 +0000 (16:24 -0500)]
staging: lustre: cleanup white space in kernel comm code

Cleanup the last white space issues in the kernel comm code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix all conditional comparison to zero for kernelcomm.c
James Simmons [Wed, 23 Dec 2015 21:24:51 +0000 (16:24 -0500)]
staging: lustre: fix all conditional comparison to zero for kernelcomm.c

Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects
kernelcomm.c to behavior according to kernel coding standards.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: return proper error code for libcfs_kkuc_msg_put
James Simmons [Wed, 23 Dec 2015 21:24:50 +0000 (16:24 -0500)]
staging: lustre: return proper error code for libcfs_kkuc_msg_put

The functon libcfs_kkuc_msg_put() returns -ENOSYS which is not
correct. Return -ENXIO instead if the kuc header is corrupt.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: use proper braces in libcfs_kkuc_group_put
James Simmons [Wed, 23 Dec 2015 21:24:49 +0000 (16:24 -0500)]
staging: lustre: use proper braces in libcfs_kkuc_group_put

Add in missing braces for libcfs_kkuc_group_put();.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: add space around '+' in kernel_comm code
James Simmons [Wed, 23 Dec 2015 21:24:48 +0000 (16:24 -0500)]
staging: lustre: add space around '+' in kernel_comm code

Add in missing space arouund '+' in the kernel_comm code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: cleanup block comment style in kernel_comm code
James Simmons [Wed, 23 Dec 2015 21:24:47 +0000 (16:24 -0500)]
staging: lustre: cleanup block comment style in kernel_comm code

Fixup the comments to the linux kernel style for the source and
headers related to the kernel_comm work.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove unnecessary NULL checks in kernel_comm.c
James Simmons [Wed, 23 Dec 2015 21:24:46 +0000 (16:24 -0500)]
staging: lustre: remove unnecessary NULL checks in kernel_comm.c

Fix checkpatch.pl reports of NULL comparison in kernel_comm.c.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: convert kernelcomm group to unsigned int
James Simmons [Wed, 23 Dec 2015 21:24:45 +0000 (16:24 -0500)]
staging: lustre: convert kernelcomm group to unsigned int

The group variable was converted to an unsigned int in
libcfs_kkuc_group_add() to avoid a potential overflow.
The variable group is used in other kernelcomm functions
so it makes sense to convert the rest of the group
variables to unsigned int.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: embed kr_data into kkuc_reg
Hongchao Zhang [Wed, 23 Dec 2015 21:24:44 +0000 (16:24 -0500)]
staging: lustre: embed kr_data into kkuc_reg

In struct kkuc_reg, the "kr_data" is difficult to be freed
outside of libcfs, then it's better to change it to be
inline data instead of the data pointer.

Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6485
Reviewed-on: http://review.whamcloud.com/14638
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Robert Read <robert.read@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: split kernel comm between user and kernel
frank zago [Wed, 23 Dec 2015 21:24:43 +0000 (16:24 -0500)]
staging: lustre: split kernel comm between user and kernel

Split the kernel comm header in libcfs into two new headers
to handle both kernel space and user space for the lustre layer.
This is broken out of the original patch 14270. The part covered
by this change is as follows:

The original libcfs_kernelcomm.h header is split into three parts:
  * lustre_kernelcomm.h, a new header for the kernel parts;
  * uapi_kernelcomm.h, a new header for the data structures shared
    between userspace and kernelspace;
  * lustreapi_internal.h receives the private liblustreapi prototypes.

Various names and filenames have been harmonized to *kernelcomm*.

The unused symbol KUC_FL_BLOCK has been removed.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14270
Reviewed-by: Nathan Rutman <nathan.rutman@seagate.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: move kernel_user_comm.c from libcfs to lustre
frank zago [Wed, 23 Dec 2015 21:24:42 +0000 (16:24 -0500)]
staging: lustre: move kernel_user_comm.c from libcfs to lustre

Move the kernel portion from libcfs to obdclass. This code is
only used by lustre. This is broken out of the original patch
14270. The part covered by this change is as follows:

The original code in kernel_user_comm.c is split into two parts:

  * obdclass/kernelcomm.c for the kernel part. filp_user_write() was
    moved there, and linux-fs.c deleted;
  * liblustreapi_kernelconn.c for the user part. The calls to CDEBUG
    have been removed, and calls to CERROR have been transformed to
    llapi_err_noerrno. The type lustre_kernelcomm has been removed and
    replace by struct lustre_kernelcomm.

Various names and filenames have been harmonized to *kernelcomm*.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14270
Reviewed-by: Nathan Rutman <nathan.rutman@seagate.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Prevent duplicate CT registrations
Henri Doreau [Wed, 23 Dec 2015 21:24:41 +0000 (16:24 -0500)]
staging: lustre: Prevent duplicate CT registrations

Associate copytool registration to a given MDC import so that
multiple mounts of the same filesystem do not lead to having the
copytool registered multiple time.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3882
Reviewed-on: http://review.whamcloud.com/7612
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: kg_sem semaphore handling is incorrectly
James Simmons [Wed, 23 Dec 2015 21:24:40 +0000 (16:24 -0500)]
staging: lustre: kg_sem semaphore handling is incorrectly

During the removal of the cfs wrappers the kg_sem semaphore
was handled incorrectly. We need to take a write lock when
writing data to the kkuc_groups. The libcfs_kkuc_group_foreach
needs to only take a read lock. This makes use match the
OpenSFS development branch.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: enum lu_object_header_flags comma style fix
Fan Yong [Wed, 23 Dec 2015 17:32:12 +0000 (12:32 -0500)]
staging: lustre: enum lu_object_header_flags comma style fix

Cleanup the a style issues for the lu_object_header_flags
enum by adding a comma for the last field. This is
broken out of patch http://review.whamcloud.com/6321.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs
James Simmons [Wed, 23 Dec 2015 17:32:09 +0000 (12:32 -0500)]
staging: lustre: Use kernel's strncasecmp and remove cfs_get_blocked_sigs

Remove libcfs function cfs_strncasecmp() since the kernel
already has its own strncasecmp(). Lastly remove from libcfs.h
cfs_get_blocked_sigs() since this function no longer exist.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3963
Reviewed-on: http://review.whamcloud.com/13070
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: add debugging ability for LFSCK
Fan Yong [Wed, 23 Dec 2015 17:32:10 +0000 (12:32 -0500)]
staging: lustre: add debugging ability for LFSCK

Add the ability to debug LFSCK to libcfs. This is
broken out of patch http://review.whamcloud.com/6321.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: add sparse locking annotations
frank zago [Wed, 23 Dec 2015 17:32:11 +0000 (12:32 -0500)]
staging: lustre: add sparse locking annotations

Adds __acquires / __releases / __must_hold sparse locking annotations to
several functions.

Fixes sparse warnings such as:

libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock'
        - wrong count at exit
libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock'
        - unexpected unlock
libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock'
        - wrong count at exit
include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in
        'cfs_hash_rw_unlock' - unexpected unlock

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Handle nodemask on UMP machines
James Simmons [Wed, 23 Dec 2015 17:32:08 +0000 (12:32 -0500)]
staging: lustre: Handle nodemask on UMP machines

For UMP and SMP machines the struct cfs_cpt_table are
defined differently. In the case handled by this patch
nodemask is defined as a integer for the UMP case and
as a pointer for the SMP case. This will cause a problem
for ost_setup which reads the nodemask directly. Instead
we create a UMP version of cfs_cpt_nodemask and use that
in ost_setup.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
Reviewed-on: http://review.whamcloud.com/9219

Starting in 3.14 kernels nodemask_t was changed from a
a unsigned long to a linux bitmap so more than 32 cores
could be supported. Using set_bit in cfs_cpt_table_alloc
no longer compiles so this patch backports bits of the
node management function that use a linux bitmap back
end. Cleaned up libcfs bitmap.h to use the libcfs layers
memory allocation function. This was pulling in lustre
related code that was not defined.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
Reviewed-on: http://review.whamcloud.com/10332

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Remove unused memhog functionality
Niranjan Dighe [Wed, 23 Dec 2015 09:40:18 +0000 (09:40 +0000)]
staging: lustre: Remove unused memhog functionality

Remove IOC_LIBCFS_MEMHOG ioctl functionality as it is no longer needed thereby
making functions like - kportal_memhog_alloc(), kportal_memhog_free() and type -
struct libcfs_device_userstate unused.

Signed-off-by: Niranjan Dighe <ndighe@visteon.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agomisc: Move panel driver out of staging
Ksenija Stanojevic [Wed, 3 Feb 2016 11:31:49 +0000 (12:31 +0100)]
misc: Move panel driver out of staging

Move panel driver from drivers/staging/panel to drivers/misc.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>