[PATCH 5/7] staging: wilc1000: handle_cfg_param: fix logical continuations

2016-02-22 Thread Chaehyun Lim
This patch fixes logical continuations found by checkpatch
CHECK: Logical continuations should be on the previous line

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d207c5c..7d36d50 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -730,12 +730,12 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
if (cfg_param_attr->flag & CURRENT_TX_RATE) {
enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate;
 
-   if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1
-   || curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5
-   || curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6
-   || curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12
-   || curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24
-   || curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || 
curr_tx_rate == MBPS_54) {
+   if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1 ||
+   curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5 ||
+   curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6 ||
+   curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 ||
+   curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 ||
+   curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || 
curr_tx_rate == MBPS_54) {
wid_list[i].id = WID_CURRENT_TX_RATE;
wid_list[i].val = (s8 *)&curr_tx_rate;
wid_list[i].type = WID_SHORT;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/7] staging: wilc1000: handle_cfg_param: change data type of wid_cnt

2016-02-22 Thread Chaehyun Lim
This patch changes data type of wid_cnt from u8 to int.
This variable uses array index of struct wid_list so that it is better
to use int type.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index c97df27..382f946 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -473,7 +473,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
s32 result = 0;
struct wid wid_list[32];
struct host_if_drv *hif_drv = vif->hif_drv;
-   u8 wid_cnt = 0;
+   int wid_cnt = 0;
 
down(&hif_drv->sem_cfg_values);
 
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 7/7] staging: wilc1000: handle_cfg_param: remove unnecessary whitespace

2016-02-22 Thread Chaehyun Lim
This patch removes unnecessary whitespace before a quoted newline found
by checkpatch
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index fb809a4..2ace069 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -501,7 +501,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[i].size = sizeof(char);
hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->auth_type;
} else {
-   netdev_err(vif->ndev, "Impossible value \n");
+   netdev_err(vif->ndev, "Impossible value\n");
result = -EINVAL;
goto ERRORHANDLER;
}
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/7] staging: wilc1000: handle_cfg_param: fix line over 80 characters

2016-02-22 Thread Chaehyun Lim
This patch fixes line over 80 characters found by checkpatch
WARNING: line over 80 characters

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 7d36d50..fb809a4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -735,7 +735,8 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6 ||
curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 ||
curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 ||
-   curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || 
curr_tx_rate == MBPS_54) {
+   curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 ||
+   curr_tx_rate == MBPS_54) {
wid_list[i].id = WID_CURRENT_TX_RATE;
wid_list[i].val = (s8 *)&curr_tx_rate;
wid_list[i].type = WID_SHORT;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/7] staging: wilc1000: handle_cfg_param: rename wid_cnt

2016-02-22 Thread Chaehyun Lim
wid_cnt variable is used as indicating array index of struct wid_list.
This patch renames wid_cnt to i that makes more readability.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 184 +++---
 1 file changed, 92 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 382f946..d207c5c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -473,259 +473,259 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
s32 result = 0;
struct wid wid_list[32];
struct host_if_drv *hif_drv = vif->hif_drv;
-   int wid_cnt = 0;
+   int i = 0;
 
down(&hif_drv->sem_cfg_values);
 
if (cfg_param_attr->flag & BSS_TYPE) {
if (cfg_param_attr->bss_type < 6) {
-   wid_list[wid_cnt].id = WID_BSS_TYPE;
-   wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->bss_type;
-   wid_list[wid_cnt].type = WID_CHAR;
-   wid_list[wid_cnt].size = sizeof(char);
+   wid_list[i].id = WID_BSS_TYPE;
+   wid_list[i].val = (s8 *)&cfg_param_attr->bss_type;
+   wid_list[i].type = WID_CHAR;
+   wid_list[i].size = sizeof(char);
hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->bss_type;
} else {
netdev_err(vif->ndev, "check value 6 over\n");
result = -EINVAL;
goto ERRORHANDLER;
}
-   wid_cnt++;
+   i++;
}
if (cfg_param_attr->flag & AUTH_TYPE) {
if (cfg_param_attr->auth_type == 1 ||
cfg_param_attr->auth_type == 2 ||
cfg_param_attr->auth_type == 5) {
-   wid_list[wid_cnt].id = WID_AUTH_TYPE;
-   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->auth_type;
-   wid_list[wid_cnt].type = WID_CHAR;
-   wid_list[wid_cnt].size = sizeof(char);
+   wid_list[i].id = WID_AUTH_TYPE;
+   wid_list[i].val = (s8 *)&cfg_param_attr->auth_type;
+   wid_list[i].type = WID_CHAR;
+   wid_list[i].size = sizeof(char);
hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->auth_type;
} else {
netdev_err(vif->ndev, "Impossible value \n");
result = -EINVAL;
goto ERRORHANDLER;
}
-   wid_cnt++;
+   i++;
}
if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
if (cfg_param_attr->auth_timeout > 0 &&
cfg_param_attr->auth_timeout < 65536) {
-   wid_list[wid_cnt].id = WID_AUTH_TIMEOUT;
-   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->auth_timeout;
-   wid_list[wid_cnt].type = WID_SHORT;
-   wid_list[wid_cnt].size = sizeof(u16);
+   wid_list[i].id = WID_AUTH_TIMEOUT;
+   wid_list[i].val = (s8 *)&cfg_param_attr->auth_timeout;
+   wid_list[i].type = WID_SHORT;
+   wid_list[i].size = sizeof(u16);
hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->auth_timeout;
} else {
netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
result = -EINVAL;
goto ERRORHANDLER;
}
-   wid_cnt++;
+   i++;
}
if (cfg_param_attr->flag & POWER_MANAGEMENT) {
if (cfg_param_attr->power_mgmt_mode < 5) {
-   wid_list[wid_cnt].id = WID_POWER_MANAGEMENT;
-   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->power_mgmt_mode;
-   wid_list[wid_cnt].type = WID_CHAR;
-   wid_list[wid_cnt].size = sizeof(char);
+   wid_list[i].id = WID_POWER_MANAGEMENT;
+   wid_list[i].val = (s8 
*)&cfg_param_attr->power_mgmt_mode;
+   wid_list[i].type = WID_CHAR;
+   wid_list[i].size = sizeof(char);
hif_drv->cfg_values.power_mgmt_mode = 
(u8)cfg_param_attr->power_mgmt_mode;
} else {
netdev_err(vif->ndev, "Invalid power mode\n");
result = -EINVAL;
goto ERRORHANDLER;
}
-   wid_cnt++;
+   i++;
}
if (cfg_param_attr->flag & RETRY_SHORT) {
if (cfg_param_attr->short_retry_limit > 0 &&
cfg_param_attr->s

[PATCH 2/7] staging: wilc1000: handle_cfg_param: remove wrapper struct cfg_param_attr

2016-02-22 Thread Chaehyun Lim
This struct just wrap struct cfg_param_val. There is no other member
except struct cfg_param_val.
This patch remove struct cfg_param_attr, then struct cfg_param_val is
renamed to struct cfg_param_attr.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 172 +++---
 drivers/staging/wilc1000/host_interface.h |   6 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |   2 +-
 3 files changed, 88 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index e442d81..c97df27 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -62,10 +62,6 @@
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH   54
 #define DEFAULT_LINK_SPEED 72
 
-struct cfg_param_attr {
-   struct cfg_param_val cfg_attr_info;
-};
-
 struct host_if_wpa_attr {
u8 *key;
const u8 *mac_addr;
@@ -481,13 +477,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 
down(&hif_drv->sem_cfg_values);
 
-   if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) {
-   if (cfg_param_attr->cfg_attr_info.bss_type < 6) {
+   if (cfg_param_attr->flag & BSS_TYPE) {
+   if (cfg_param_attr->bss_type < 6) {
wid_list[wid_cnt].id = WID_BSS_TYPE;
-   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->cfg_attr_info.bss_type;
+   wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->bss_type;
wid_list[wid_cnt].type = WID_CHAR;
wid_list[wid_cnt].size = sizeof(char);
-   hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->cfg_attr_info.bss_type;
+   hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->bss_type;
} else {
netdev_err(vif->ndev, "check value 6 over\n");
result = -EINVAL;
@@ -495,15 +491,15 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
}
wid_cnt++;
}
-   if (cfg_param_attr->cfg_attr_info.flag & AUTH_TYPE) {
-   if (cfg_param_attr->cfg_attr_info.auth_type == 1 ||
-   cfg_param_attr->cfg_attr_info.auth_type == 2 ||
-   cfg_param_attr->cfg_attr_info.auth_type == 5) {
+   if (cfg_param_attr->flag & AUTH_TYPE) {
+   if (cfg_param_attr->auth_type == 1 ||
+   cfg_param_attr->auth_type == 2 ||
+   cfg_param_attr->auth_type == 5) {
wid_list[wid_cnt].id = WID_AUTH_TYPE;
-   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->cfg_attr_info.auth_type;
+   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->auth_type;
wid_list[wid_cnt].type = WID_CHAR;
wid_list[wid_cnt].size = sizeof(char);
-   hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->cfg_attr_info.auth_type;
+   hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->auth_type;
} else {
netdev_err(vif->ndev, "Impossible value \n");
result = -EINVAL;
@@ -511,14 +507,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
}
wid_cnt++;
}
-   if (cfg_param_attr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
-   if (cfg_param_attr->cfg_attr_info.auth_timeout > 0 &&
-   cfg_param_attr->cfg_attr_info.auth_timeout < 65536) {
+   if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
+   if (cfg_param_attr->auth_timeout > 0 &&
+   cfg_param_attr->auth_timeout < 65536) {
wid_list[wid_cnt].id = WID_AUTH_TIMEOUT;
-   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->cfg_attr_info.auth_timeout;
+   wid_list[wid_cnt].val = (s8 
*)&cfg_param_attr->auth_timeout;
wid_list[wid_cnt].type = WID_SHORT;
wid_list[wid_cnt].size = sizeof(u16);
-   hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->cfg_attr_info.auth_timeout;
+   hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->auth_timeout;
} else {
netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
result = -EINVAL;
@@ -526,13 +522,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
}
wid_cnt++;
}
-   if (cfg_param_attr->cfg_attr_info.flag & POWER_MANAGEMENT) {
-   if (cfg_param_attr->cfg_attr_info.power_mgmt_mode < 5) {
+   if (cfg_param_attr->flag & POWER_MANAGEMENT) {
+   if (cfg_param_attr->power_mgmt_mode < 5) {
wid_list[wid_cnt].id = WID_POWER_MANAGEMENT;
-   wid

[PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration

2016-02-22 Thread Chaehyun Lim
commit 31cc9885e7c7 ("staging: wilc1000: handle_set_mac_address: use kmemdup")
introduces a new checkpatch warning, so this patch fixes it.

WARNING: Missing a blank line after declarations
FILE: drivers/staging/wilc1000/host_interface.c:430:

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0c09df4..e442d81 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -429,8 +429,9 @@ static void handle_set_mac_address(struct wilc_vif *vif,
 {
int ret = 0;
struct wid wid;
+   u8 *mac_buf;
 
-   u8 *mac_buf = kmemdup(set_mac_addr->mac_addr, ETH_ALEN, GFP_KERNEL);
+   mac_buf = kmemdup(set_mac_addr->mac_addr, ETH_ALEN, GFP_KERNEL);
if (!mac_buf)
return;
 
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH RESEND 04/10] staging: wilc1000: removes unnecessary wilc_debug print log

2016-02-22 Thread Kim, Leo
Dear Dan,

Thank you your great comments.
I will be not forget your advice. 

Please understand that if you have a misunderstanding.

Thank you & Best Regards.
Leo

-Original Message-
From: Dan Carpenter [mailto:dan.carpen...@oracle.com] 
Sent: Monday, February 22, 2016 11:44 PM
To: Kim, Leo 
Cc: gre...@linuxfoundation.org; de...@driverdev.osuosl.org; Park, Chris 
; Shin, Austin ; 
linux-wirel...@vger.kernel.org; Ferre, Nicolas ; Cho, 
Tony ; Abozaeid, Adham 
Subject: Re: [PATCH RESEND 04/10] staging: wilc1000: removes unnecessary 
wilc_debug print log

On Mon, Feb 22, 2016 at 11:42:42AM +, Kim, Leo wrote:
> Dear Dan,
> 
> This patch is subject "removes unnecessary wilc_debug print log".

I'm fine with you fixing it up in a later patch, but you should not be 
defending this patch as valid way to do things.

The rule is "do one thing at a time", not "do half a thing at a time."
In the original code the if statement was required because it was determining 
when to print, but now it is a confusing unneeded line of code.  I'm not asking 
for an additional unrelated cleanup for something that was already there in the 
original code.  It was this patch which introduced the problem (the stray 
unneeded line of code).

Also I had already asked you to redo this on Feb 19.

Part of the reason that we like people to "do one thing per patch" is that 
people promise they will clean things up in the future but they get distracted 
and forget.

regards,
dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


re: staging: rtl8723au: use list_for_each_entry*()

2016-02-22 Thread Dan Carpenter
Hello Geliang Tang,

The patch e280d71bea18: "staging: rtl8723au: use
list_for_each_entry*()" from Feb 18, 2016, leads to the following
static checker warning:

drivers/staging/rtl8723au/core/rtw_sta_mgt.c:365 rtw_get_stainfo23a()
error: potential NULL dereference 'psta'.

drivers/staging/rtl8723au/core/rtw_sta_mgt.c
   363  spin_lock_bh(&pstapriv->sta_hash_lock);
   364  phead = &pstapriv->sta_hash[index];
   365  list_for_each_entry(psta, phead, hash_list) {
   366  /*  if found the matched address */
   367  if (ether_addr_equal(psta->hwaddr, addr))
   368  break;
   369  
   370  psta = NULL;
^^^
This leads to a NULL dereference if we don't the address is not first
in the list.

   371  }
   372  spin_unlock_bh(&pstapriv->sta_hash_lock);
   373  return psta;
   374  }

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 10/56] staging/lustre: Remove ldlm type/mode typedefs

2016-02-22 Thread kbuild test robot
Hi Oleg,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.5-rc5 next-20160222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/green-linuxhacker-ru/More-Lustre-cleanups/20160223-120654
config: sparc64-allyesconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64 

Note: the 
linux-review/green-linuxhacker-ru/More-Lustre-cleanups/20160223-120654 HEAD 
340181b90a18083de9509c39311e6e7859b89274 builds fine.
  It only hurts bisectibility.

All errors (new ones prefixed by >>):

   In file included from 
drivers/staging/lustre/lustre/fid/../include/lustre_export.h:51:0,
from drivers/staging/lustre/lustre/fid/../include/obd.h:54,
from drivers/staging/lustre/lustre/fid/fid_request.c:48:
>> drivers/staging/lustre/lustre/fid/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/fld/../include/lustre_export.h:51:0,
from drivers/staging/lustre/lustre/fld/../include/obd.h:54,
from drivers/staging/lustre/lustre/fld/fld_request.c:49:
>> drivers/staging/lustre/lustre/fld/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/llite/../include/linux/../lustre_export.h:51:0,
from 
drivers/staging/lustre/lustre/llite/../include/linux/../obd.h:54,
from 
drivers/staging/lustre/lustre/llite/../include/linux/../obd_class.h:42,
from 
drivers/staging/lustre/lustre/llite/../include/linux/lustre_lite.h:47,
from 
drivers/staging/lustre/lustre/llite/../include/lustre_lite.h:45,
from drivers/staging/lustre/lustre/llite/dcache.c:44:
>> drivers/staging/lustre/lustre/llite/../include/linux/../lustre_dlm.h:852:2: 
>> error: unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/llite/../include/lustre_export.h:51:0,
from 
drivers/staging/lustre/lustre/llite/../include/obd.h:54,
from 
drivers/staging/lustre/lustre/llite/../include/obd_class.h:42,
from drivers/staging/lustre/lustre/llite/dir.c:52:
>> drivers/staging/lustre/lustre/llite/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/lmv/../include/lustre_export.h:51:0,
from drivers/staging/lustre/lustre/lmv/../include/obd.h:54,
from 
drivers/staging/lustre/lustre/lmv/../include/obd_class.h:42,
from drivers/staging/lustre/lustre/lmv/lmv_obd.c:52:
>> drivers/staging/lustre/lustre/lmv/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from drivers/staging/lustre/lustre/lov/lov_obd.c:51:0:
>> drivers/staging/lustre/lustre/lov/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/mdc/../include/lustre_export.h:51:0,
from drivers/staging/lustre/lustre/mdc/../include/obd.h:54,
from 
drivers/staging/lustre/lustre/mdc/../include/obd_class.h:42,
from drivers/staging/lustre/lustre/mdc/mdc_request.c:46:
>> drivers/staging/lustre/lustre/mdc/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/mgc/../include/lustre_export.h:51:0,
from drivers/staging/lustre/lustre/mgc/../include/obd.h:54,
from 
drivers/staging/lustre/lustre/mgc/../include/obd_class.h:42,
from drivers/staging/lustre/lustre/mgc/mgc_request.c:45:
>> drivers/staging/lustre/lustre/mgc/../include/lustre_dlm.h:852:2: error: 
>> unknown type name 'ldlm_mode_t'
 ldlm_mode_t  lr_most_restr;
 ^
--
   In file included from 
drivers/staging/lustre/lustre/obdclass/../include/lustre_export.h:51:0,
from 
drivers/staging/lustre/lustre/obdclass/../include/obd.h:54,
from 
drivers/staging/lustre/lustre/obdclas

[PATCH 55/56] staging/lustre/ptlrpc: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/connection.c  |   3 +-
 drivers/staging/lustre/lustre/ptlrpc/events.c  |  51 ++---
 drivers/staging/lustre/lustre/ptlrpc/import.c  | 114 
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |   8 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c|   9 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  42 +---
 drivers/staging/lustre/lustre/ptlrpc/nrs.c |   6 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|  33 --
 drivers/staging/lustre/lustre/ptlrpc/pinger.c  |  11 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   2 -
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c |   9 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c |  18 ++--
 drivers/staging/lustre/lustre/ptlrpc/sec.c |  27 +++--
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c  |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c|   3 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c | 117 ++---
 17 files changed, 301 insertions(+), 164 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/connection.c 
b/drivers/staging/lustre/lustre/ptlrpc/connection.c
index 062db13..a14daff 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/connection.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/connection.c
@@ -72,7 +72,8 @@ ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
 * returned and may be compared against out object.
 */
/* In the function below, .hs_keycmp resolves to
-* conn_keycmp() */
+* conn_keycmp()
+*/
/* coverity[overrun-buffer-val] */
conn2 = cfs_hash_findadd_unique(conn_hash, &peer, &conn->c_hash);
if (conn != conn2) {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c 
b/drivers/staging/lustre/lustre/ptlrpc/events.c
index ffceba5..47be21a 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/events.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/events.c
@@ -71,7 +71,8 @@ void request_out_callback(lnet_event_t *ev)
if (ev->type == LNET_EVENT_UNLINK || ev->status != 0) {
 
/* Failed send: make it seem like the reply timed out, just
-* like failing sends in client.c does currently...  */
+* like failing sends in client.c does currently...
+*/
 
req->rq_net_err = 1;
ptlrpc_client_wake_req(req);
@@ -95,7 +96,8 @@ void reply_in_callback(lnet_event_t *ev)
LASSERT(ev->md.start == req->rq_repbuf);
LASSERT(ev->offset + ev->mlength <= req->rq_repbuf_len);
/* We've set LNET_MD_MANAGE_REMOTE for all outgoing requests
-  for adaptive timeouts' early reply. */
+* for adaptive timeouts' early reply.
+*/
LASSERT((ev->md.options & LNET_MD_MANAGE_REMOTE) != 0);
 
spin_lock(&req->rq_lock);
@@ -151,7 +153,8 @@ void reply_in_callback(lnet_event_t *ev)
req->rq_reply_off = ev->offset;
req->rq_nob_received = ev->mlength;
/* LNetMDUnlink can't be called under the LNET_LOCK,
-  so we must unlink in ptlrpc_unregister_reply */
+* so we must unlink in ptlrpc_unregister_reply
+*/
DEBUG_REQ(D_INFO, req,
  "reply in flags=%x mlen=%u offset=%d replen=%d",
  lustre_msg_get_flags(req->rq_reqmsg),
@@ -162,7 +165,8 @@ void reply_in_callback(lnet_event_t *ev)
 
 out_wake:
/* NB don't unlock till after wakeup; req can disappear under us
-* since we don't have our own ref */
+* since we don't have our own ref
+*/
ptlrpc_client_wake_req(req);
spin_unlock(&req->rq_lock);
 }
@@ -213,7 +217,8 @@ void client_bulk_callback(lnet_event_t *ev)
desc->bd_failure = 1;
 
/* NB don't unlock till after wakeup; desc can disappear under us
-* otherwise */
+* otherwise
+*/
if (desc->bd_md_count == 0)
ptlrpc_client_wake_req(desc->bd_req);
 
@@ -250,7 +255,8 @@ static void ptlrpc_req_add_history(struct 
ptlrpc_service_part *svcpt,
__u64 new_seq;
 
/* set sequence ID for request and add it to history list,
-* it must be called with hold svcpt::scp_lock */
+* it must be called with hold svcpt::scp_lock
+*/
 
new_seq = (sec << REQS_SEC_SHIFT) |
  (usec << REQS_USEC_SHIFT) |
@@ -258,7 +264,8 @@ static void ptlrpc_req_add_history(struct 
ptlrpc_service_part *svcpt,
 
if (new_seq > svcpt->scp_hist_seq) {
/* This handles the initial case of scp_hist_seq == 0 or
-* we just jumped into a new time window *

[PATCH 28/56] staging/lustre: Remove server-only values from enum lu_dirent_attrs

2016-02-22 Thread green
From: Oleg Drokin 

These values cannot be seen on the client so we probably should
not even be aware of them on the client.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre/lustre_idl.h| 16 
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d2f05e3..eeb0542 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -880,24 +880,8 @@ enum lu_dirent_attrs {
LUDA_FID= 0x0001,
LUDA_TYPE   = 0x0002,
LUDA_64BITHASH  = 0x0004,
-
-   /* The following attrs are used for MDT internal only,
-* not visible to client */
-
-   /* Verify the dirent consistency */
-   LUDA_VERIFY = 0x8000,
-   /* Only check but not repair the dirent inconsistency */
-   LUDA_VERIFY_DRYRUN  = 0x4000,
-   /* The dirent has been repaired, or to be repaired (dryrun). */
-   LUDA_REPAIR = 0x2000,
-   /* The system is upgraded, has beed or to be repaired (dryrun). */
-   LUDA_UPGRADE= 0x1000,
-   /* Ignore this record, go to next directly. */
-   LUDA_IGNORE = 0x0800,
 };
 
-#define LU_DIRENT_ATTRS_MASK   0xf800
-
 /**
  * Layout of readdir pages, as transmitted on wire.
  */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 24/56] staging/lustre: Remove lustre_build_version.h

2016-02-22 Thread green
From: Oleg Drokin 

of the two macroses is contained the LUSTRE_RELEASE was unused and
BUILD_VERSION is too generically named and was replaced with
LUSTRE_VERSION_STRING with all the users (provided by lustre_ver.h)

With in-kernel client the build version should be combined with
kernel build information anyway.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_build_version.h   |  2 --
 drivers/staging/lustre/lustre/obdclass/class_obd.c| 11 +--
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c   |  1 -
 3 files changed, 5 insertions(+), 9 deletions(-)
 delete mode 100644 
drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h

diff --git 
a/drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h
deleted file mode 100644
index 93a3d7d..000
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define BUILD_VERSION "v2_3_64_0-g6e62c21-CHANGED-3.9.0"
-#define LUSTRE_RELEASE 3.9.0_g6e62c21
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c 
b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 4b7e21f..f805693 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -42,7 +42,6 @@
 #include "../../include/linux/lnet/lnetctl.h"
 #include "../include/lustre_debug.h"
 #include "../include/lprocfs_status.h"
-#include "../include/lustre/lustre_build_version.h"
 #include 
 #include "../include/cl_object.h"
 #include "llog_internal.h"
@@ -218,14 +217,14 @@ int class_handle_ioctl(unsigned int cmd, unsigned long 
arg)
goto out;
}
 
-   if (strlen(BUILD_VERSION) + 1 > data->ioc_inllen1) {
+   if (strlen(LUSTRE_VERSION_STRING) + 1 > data->ioc_inllen1) {
CERROR("ioctl buffer too small to hold version\n");
err = -EINVAL;
goto out;
}
 
-   memcpy(data->ioc_bulk, BUILD_VERSION,
-  strlen(BUILD_VERSION) + 1);
+   memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING,
+  strlen(LUSTRE_VERSION_STRING) + 1);
 
err = obd_ioctl_popdata((void __user *)arg, data, len);
if (err)
@@ -481,7 +480,7 @@ static int __init init_obdclass(void)
 
int lustre_register_fs(void);
 
-   LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
+   LCONSOLE_INFO("Lustre: Build Version: " LUSTRE_VERSION_STRING "\n");
 
spin_lock_init(&obd_types_lock);
obd_zombie_impexp_init();
@@ -579,7 +578,7 @@ static void cleanup_obdclass(void)
 }
 
 MODULE_AUTHOR("OpenSFS, Inc. ");
-MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION);
+MODULE_DESCRIPTION("Lustre Class Driver Build Version: " 
LUSTRE_VERSION_STRING);
 MODULE_LICENSE("GPL");
 MODULE_VERSION(LUSTRE_VERSION_STRING);
 
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 689f33a..f3c4a17 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -70,7 +70,6 @@
 #include "../../include/obd_class.h"
 #include "../../include/lprocfs_status.h"
 #include "../../include/lustre_ver.h"
-#include "../../include/lustre/lustre_build_version.h"
 
 /* buffer MUST be at least the size of obd_ioctl_hdr */
 int obd_ioctl_getdata(char **buf, int *len, void __user *arg)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 50/56] staging/lustre/mdc: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c |  3 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   | 87 -
 drivers/staging/lustre/lustre/mdc/mdc_reint.c   | 12 ++--
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 27 +---
 4 files changed, 84 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c 
b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index ea2ab23..b3bfdcb 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -489,7 +489,8 @@ static int mdc_req_avail(struct client_obd *cli, struct 
mdc_cache_waiter *mcw)
 
 /* We record requests in flight in cli->cl_r_in_flight here.
  * There is only one write rpc possible in mdc anyway. If this to change
- * in the future - the code may need to be revisited. */
+ * in the future - the code may need to be revisited.
+ */
 int mdc_enter_request(struct client_obd *cli)
 {
int rc = 0;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c 
b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index ae648d0..6dae574 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -210,7 +210,8 @@ int mdc_null_inode(struct obd_export *exp,
 /* find any ldlm lock of the inode in mdc
  * return 0not find
  * 1find one
- *  < 0error */
+ *  < 0error
+ */
 int mdc_find_cbdata(struct obd_export *exp,
const struct lu_fid *fid,
ldlm_iterator_t it, void *data)
@@ -252,7 +253,8 @@ static inline void mdc_clear_replay_flag(struct 
ptlrpc_request *req, int rc)
  * OOM here may cause recovery failure if lmm is needed (only for the
  * original open if the MDS crashed just when this client also OOM'd)
  * but this is incredibly unlikely, and questionable whether the client
- * could do MDS recovery under OOM anyways... */
+ * could do MDS recovery under OOM anyways...
+ */
 static void mdc_realloc_openmsg(struct ptlrpc_request *req,
struct mdt_body *body)
 {
@@ -514,7 +516,8 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct 
obd_export *exp,
/* pack the layout intent request */
layout = req_capsule_client_get(&req->rq_pill, &RMF_LAYOUT_INTENT);
/* LAYOUT_INTENT_ACCESS is generic, specific operation will be
-* set for replication */
+* set for replication
+*/
layout->li_opc = LAYOUT_INTENT_ACCESS;
 
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
@@ -561,7 +564,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 
LASSERT(rc >= 0);
/* Similarly, if we're going to replay this request, we don't want to
-* actually get a lock, just perform the intent. */
+* actually get a lock, just perform the intent.
+*/
if (req->rq_transno || req->rq_replay) {
lockreq = req_capsule_client_get(pill, &RMF_DLM_REQ);
lockreq->lock_flags |= ldlm_flags_to_wire(LDLM_FL_INTENT_ONLY);
@@ -575,7 +579,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
lock = ldlm_handle2lock(lockh);
 
/* If the server gave us back a different lock mode, we should
-* fix up our variables. */
+* fix up our variables.
+*/
if (lock->l_req_mode != einfo->ei_mode) {
ldlm_lock_addref(lockh, lock->l_req_mode);
ldlm_lock_decref(lockh, einfo->ei_mode);
@@ -593,7 +598,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
intent->it_data = req;
 
/* Technically speaking rq_transno must already be zero if
-* it_status is in error, so the check is a bit redundant */
+* it_status is in error, so the check is a bit redundant
+*/
if ((!req->rq_transno || intent->it_status < 0) && req->rq_replay)
mdc_clear_replay_flag(req, intent->it_status);
 
@@ -603,7 +609,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 *
 * It's important that we do this first!  Otherwise we might exit the
 * function without doing so, and try to replay a failed create
-* (bug 3440) */
+* (bug 3440)
+*/
if (it->it_op & IT_OPEN && req->rq_replay &&
(!it_disposition(it, DISP_OPEN_OPEN) || intent->it_status != 0))
mdc_clear_replay_flag(req, intent->it_status);
@@ -647,7 +654,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
return -EPROTO;
 
/* save lvb data and length in case this is for layout
-* lock */
+* lock
+*/

[PATCH 53/56] staging/lustre/obdecho: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index ca87cc2..3be28c5 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -746,7 +746,8 @@ static struct lu_device *echo_device_alloc(const struct 
lu_env *env,
cleanup = 4;
 
/* if echo client is to be stacked upon ost device, the next is
-* NULL since ost is not a clio device so far */
+* NULL since ost is not a clio device so far
+*/
if (next && !lu_device_is_cl(next))
next = NULL;
 
@@ -965,7 +966,8 @@ static struct echo_object *cl_echo_object_find(struct 
echo_device *d,
}
 
/* In the function below, .hs_keycmp resolves to
-* lu_obj_hop_keycmp() */
+* lu_obj_hop_keycmp()
+*/
/* coverity[overrun-buffer-val] */
obj = cl_object_find(env, echo_dev2cl(d), fid, &conf->eoc_cl);
if (IS_ERR(obj)) {
@@ -1164,7 +1166,8 @@ static int cl_echo_object_brw(struct echo_object *eco, 
int rw, u64 offset,
cl_page_list_add(&queue->c2_qin, clp);
 
/* drop the reference count for cl_page_find, so that the page
-* will be freed in cl_2queue_fini. */
+* will be freed in cl_2queue_fini.
+*/
cl_page_put(env, clp);
cl_page_clip(env, clp, 0, page_size);
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 41/56] staging/lustre: Reformat comments and structures in lustre_idl.h

2016-02-22 Thread green
From: Oleg Drokin 

This file mostly contains various on the wire data and got
significantly mangled in transition.
This patch rectifies the situation somewhat. Also fixes the
comment style for block comments.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 286 -
 1 file changed, 165 insertions(+), 121 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index c272c18..e32163b 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -146,7 +146,9 @@
 #define SEQ_CONTROLLER_PORTAL32
 #define MGS_BULK_PORTAL33
 
-/* Portal 63 is reserved for the Cray Inc DVS - n...@cray.com, r...@cray.com, 
n8...@cray.com */
+/* Portal 63 is reserved for the Cray Inc DVS - n...@cray.com, r...@cray.com,
+ * n8...@cray.com
+ */
 
 /* packet types */
 #define PTL_RPC_MSG_REQUEST 4711
@@ -295,7 +297,8 @@ static inline int range_compare_loc(const struct 
lu_seq_range *r1,
fld_range_is_mdt(range) ? "mdt" : "ost"
 
 /** \defgroup lu_fid lu_fid
- * @{ */
+ * @{
+ */
 
 /**
  * Flags for lustre_mdt_attrs::lma_compat and lustre_mdt_attrs::lma_incompat.
@@ -307,7 +310,8 @@ enum lma_compat {
LMAC_SOM= 0x0002,
LMAC_NOT_IN_OI  = 0x0004, /* the object does NOT need OI mapping */
LMAC_FID_ON_OST = 0x0008, /* For OST-object, its OI mapping is
-  * under /O//d. */
+  * under /O//d.
+  */
 };
 
 /**
@@ -319,7 +323,8 @@ enum lma_incompat {
LMAI_RELEASED   = 0x0001, /* file is released */
LMAI_AGENT  = 0x0002, /* agent inode */
LMAI_REMOTE_PARENT  = 0x0004, /* the parent of the object
-is on the remote MDT */
+  * is on the remote MDT
+  */
 };
 
 #define LMA_INCOMPAT_SUPP  (LMAI_AGENT | LMAI_REMOTE_PARENT)
@@ -395,12 +400,14 @@ enum fid_seq {
FID_SEQ_LOCAL_FILE  = 0x20001ULL,
FID_SEQ_DOT_LUSTRE  = 0x20002ULL,
/* sequence is used for local named objects FIDs generated
-* by local_object_storage library */
+* by local_object_storage library
+*/
FID_SEQ_LOCAL_NAME  = 0x20003ULL,
/* Because current FLD will only cache the fid sequence, instead
 * of oid on the client side, if the FID needs to be exposed to
 * clients sides, it needs to make sure all of fids under one
-* sequence will be located in one MDT. */
+* sequence will be located in one MDT.
+*/
FID_SEQ_SPECIAL = 0x20004ULL,
FID_SEQ_QUOTA   = 0x20005ULL,
FID_SEQ_QUOTA_GLB   = 0x20006ULL,
@@ -601,7 +608,8 @@ static inline void ostid_set_seq(struct ost_id *oi, __u64 
seq)
oi->oi_fid.f_seq = seq;
/* Note: if f_oid + f_ver is zero, we need init it
 * to be 1, otherwise, ostid_seq will treat this
-* as old ostid (oi_seq == 0) */
+* as old ostid (oi_seq == 0)
+*/
if (oi->oi_fid.f_oid == 0 && oi->oi_fid.f_ver == 0)
oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID;
}
@@ -689,7 +697,8 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct 
ost_id *ostid,
 * that we map into the IDIF namespace.  It allows up to 2^48
 * objects per OST, as this is the object namespace that has
 * been in production for years.  This can handle create rates
-* of 1M objects/s/OST for 9 years, or combinations thereof. */
+* of 1M objects/s/OST for 9 years, or combinations thereof.
+*/
if (ostid_id(ostid) >= IDIF_MAX_OID) {
 CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
POSTID(ostid), ost_idx);
@@ -704,7 +713,8 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct 
ost_id *ostid,
   /* This is either an IDIF object, which identifies objects across
* all OSTs, or a regular FID.  The IDIF namespace maps legacy
* OST objects into the FID namespace.  In both cases, we just
-   * pass the FID through, no conversion needed. */
+   * pass the FID through, no conversion needed.
+   */
if (ostid->oi_fid.f_ver != 0) {
CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
POSTID(ostid), ost_idx);
@@ -868,7 +878,8 @@ static inline void ostid_le_to_cpu(const stru

[PATCH 46/56] staging/lustre/ldlm: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/interval_tree.c |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  12 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|  43 ---
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |   3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |  27 +++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |  63 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|  36 --
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 132 ++---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  36 --
 9 files changed, 236 insertions(+), 122 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c 
b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
index fd70f65..3230606 100644
--- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c
+++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
@@ -133,7 +133,8 @@ static void __rotate_change_maxhigh(struct interval_node 
*node,
 
 /* The left rotation "pivots" around the link from node to node->right, and
  * - node will be linked to node->right's left child, and
- * - node->right's left child will be linked to node's right child.  */
+ * - node->right's left child will be linked to node's right child.
+ */
 static void __rotate_left(struct interval_node *node,
  struct interval_node **root)
 {
@@ -162,7 +163,8 @@ static void __rotate_left(struct interval_node *node,
 
 /* The right rotation "pivots" around the link from node to node->left, and
  * - node will be linked to node->left's right child, and
- * - node->left's right child will be linked to node's left child.  */
+ * - node->left's right child will be linked to node's left child.
+ */
 static void __rotate_right(struct interval_node *node,
   struct interval_node **root)
 {
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index f07a077..222cb62 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -62,7 +62,8 @@
  * is the "highest lock".  This function returns the new KMS value.
  * Caller must hold lr_lock already.
  *
- * NB: A lock on [x,y] protects a KMS of up to y + 1 bytes! */
+ * NB: A lock on [x,y] protects a KMS of up to y + 1 bytes!
+ */
 __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
 {
struct ldlm_resource *res = lock->l_resource;
@@ -72,7 +73,8 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 
old_kms)
 
/* don't let another thread in ldlm_extent_shift_kms race in
 * just after we finish and take our lock into account in its
-* calculation of the kms */
+* calculation of the kms
+*/
lock->l_flags |= LDLM_FL_KMS_IGNORE;
 
list_for_each(tmp, &res->lr_granted) {
@@ -85,7 +87,8 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 
old_kms)
return old_kms;
 
/* This extent _has_ to be smaller than old_kms (checked above)
-* so kms can only ever be smaller or the same as old_kms. */
+* so kms can only ever be smaller or the same as old_kms.
+*/
if (lck->l_policy_data.l_extent.end + 1 > kms)
kms = lck->l_policy_data.l_extent.end + 1;
}
@@ -191,7 +194,8 @@ void ldlm_extent_add_lock(struct ldlm_resource *res,
res->lr_itree[idx].lit_size++;
 
/* even though we use interval tree to manage the extent lock, we also
-* add the locks into grant list, for debug purpose, .. */
+* add the locks into grant list, for debug purpose, ..
+*/
ldlm_resource_add_lock(res, &res->lr_granted, lock);
 }
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index 8bd6a18..b88b786 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -107,7 +107,8 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode 
mode, __u64 flags)
lock->l_flags |= LDLM_FL_LOCAL_ONLY | LDLM_FL_CBPENDING;
 
/* when reaching here, it is under lock_res_and_lock(). Thus,
-  need call the nolock version of ldlm_lock_decref_internal*/
+* need call the nolock version of ldlm_lock_decref_internal
+*/
ldlm_lock_decref_internal_nolock(lock, mode);
}
 
@@ -159,13 +160,15 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, 
__u64 *flags,
*err = ELDLM_OK;
 
/* No blocking ASTs are sent to the clients for
-* Posix file & record locks */
+* Posix file & record locks
+*/
  

[PATCH 43/56] staging/lustre/fld: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fld/fld_cache.c|  9 ++---
 drivers/staging/lustre/lustre/fld/fld_internal.h | 24 
 drivers/staging/lustre/lustre/fld/fld_request.c  |  9 ++---
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index a7026a9..2b09b76 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -183,7 +183,8 @@ restart_fixup:
}
 
/* we could have overlap over next
-* range too. better restart. */
+* range too. better restart.
+*/
goto restart_fixup;
}
 
@@ -302,7 +303,8 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
const u32 mdt = range->lsr_index;
 
/* this is overlap case, these case are checking overlapping with
-* prev range only. fixup will handle overlapping with next range. */
+* prev range only. fixup will handle overlapping with next range.
+*/
 
if (f_curr->fce_range.lsr_index == mdt) {
f_curr->fce_range.lsr_start = min(f_curr->fce_range.lsr_start,
@@ -317,7 +319,8 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
} else if (new_start <= f_curr->fce_range.lsr_start &&
f_curr->fce_range.lsr_end <= new_end) {
/* case 1: new range completely overshadowed existing range.
-*   e.g. whole range migrated. update fld cache entry */
+*   e.g. whole range migrated. update fld cache entry
+*/
 
f_curr->fce_range = *range;
kfree(f_new);
diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h 
b/drivers/staging/lustre/lustre/fld/fld_internal.h
index ee36d6b..e8a3caf 100644
--- a/drivers/staging/lustre/lustre/fld/fld_internal.h
+++ b/drivers/staging/lustre/lustre/fld/fld_internal.h
@@ -67,8 +67,7 @@ struct lu_fld_hash {
 struct fld_cache_entry {
struct list_head   fce_lru;
struct list_head   fce_list;
-   /**
-* fld cache entries are sorted on range->lsr_start field. */
+   /** fld cache entries are sorted on range->lsr_start field. */
struct lu_seq_range  fce_range;
 };
 
@@ -79,32 +78,25 @@ struct fld_cache {
 */
rwlock_t fci_lock;
 
-   /**
-* Cache shrink threshold */
+   /** Cache shrink threshold */
int   fci_threshold;
 
-   /**
-* Preferred number of cached entries */
+   /** Preferred number of cached entries */
int   fci_cache_size;
 
-   /**
-* Current number of cached entries. Protected by \a fci_lock */
+   /** Current number of cached entries. Protected by \a fci_lock */
int   fci_cache_count;
 
-   /**
-* LRU list fld entries. */
+   /** LRU list fld entries. */
struct list_head   fci_lru;
 
-   /**
-* sorted fld entries. */
+   /** sorted fld entries. */
struct list_head   fci_entries_head;
 
-   /**
-* Cache statistics. */
+   /** Cache statistics. */
struct fld_stats fci_stat;
 
-   /**
-* Cache name used for debug and messages. */
+   /** Cache name used for debug and messages. */
char fci_name[LUSTRE_MDT_MAXNAMELEN];
unsigned int fci_no_shrink:1;
 };
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
b/drivers/staging/lustre/lustre/fld/fld_request.c
index 0f0fbe4..b50a57b 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -58,7 +58,8 @@
 #include "fld_internal.h"
 
 /* TODO: these 3 functions are copies of flow-control code from mdc_lib.c
- * It should be common thing. The same about mdc RPC lock */
+ * It should be common thing. The same about mdc RPC lock
+ */
 static int fld_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
 {
int rc;
@@ -124,7 +125,8 @@ fld_rrb_scan(struct lu_client_fld *fld, u64 seq)
 * it should go to index 0 directly, instead of calculating
 * hash again, and also if other MDTs is not being connected,
 * the fld lookup requests(for seq on MDT0) should not be
-* blocked because of other MDTs */
+* blocked because of other MDTs
+*/
if (fid_seq_is_norm(seq))
hash = fld_rrb_hash(fld, seq);
else
@@ -139,7 +141,8 @@ again:
if (hash != 0) {
/* It i

[PATCH 23/56] staging/lustre/llite: Get rid of se_stat_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum se_stat

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 4b215d3..db220f2 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -49,13 +49,13 @@
 
 #define SA_OMITTED_ENTRY_MAX 8ULL
 
-typedef enum {
+enum se_stat {
/** negative values are for error cases */
SA_ENTRY_INIT = 0,  /** init entry */
SA_ENTRY_SUCC = 1,  /** stat succeed */
SA_ENTRY_INVA = 2,  /** invalid entry */
SA_ENTRY_DEST = 3,  /** entry to be destroyed */
-} se_stat_t;
+};
 
 struct ll_sa_entry {
/* link into sai->sai_entries */
@@ -71,7 +71,7 @@ struct ll_sa_entry {
/* low layer ldlm lock handle */
__u64  se_handle;
/* entry status */
-   se_stat_t  se_stat;
+   enum se_stat   se_stat;
/* entry size, contains name */
int  se_size;
/* pointer to async getattr enqueue info */
@@ -366,7 +366,7 @@ ll_sa_entry_fini(struct ll_statahead_info *sai, struct 
ll_sa_entry *entry)
  */
 static void
 do_sa_entry_to_stated(struct ll_statahead_info *sai,
- struct ll_sa_entry *entry, se_stat_t stat)
+ struct ll_sa_entry *entry, enum se_stat stat)
 {
struct ll_sa_entry *se;
struct list_head *pos = &sai->sai_entries_stated;
@@ -392,7 +392,7 @@ do_sa_entry_to_stated(struct ll_statahead_info *sai,
  */
 static int
 ll_sa_entry_to_stated(struct ll_statahead_info *sai,
- struct ll_sa_entry *entry, se_stat_t stat)
+ struct ll_sa_entry *entry, enum se_stat stat)
 {
struct ll_inode_info *lli = ll_i2info(sai->sai_inode);
intret = 1;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 38/56] staging/lustre: Remove dead code in ldlm_lock_destroy_internal

2016-02-22 Thread green
From: Oleg Drokin 

This code has been commented out since end of 2012, so it's
clearly not needed here.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 07e83e5..65d0cfe 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -337,16 +337,6 @@ static int ldlm_lock_destroy_internal(struct ldlm_lock 
*lock)
ldlm_lock_remove_from_lru(lock);
class_handle_unhash(&lock->l_handle);
 
-#if 0
-   /* Wake anyone waiting for this lock */
-   /* FIXME: I should probably add yet another flag, instead of using
-* l_export to only call this on clients */
-   if (lock->l_export)
-   class_export_put(lock->l_export);
-   lock->l_export = NULL;
-   if (lock->l_export && lock->l_completion_ast)
-   lock->l_completion_ast(lock, 0);
-#endif
return 1;
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 44/56] staging/lustre/fid: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fid/fid_request.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c 
b/drivers/staging/lustre/lustre/fid/fid_request.c
index 7ca65df..70400aa 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -95,7 +95,8 @@ static int seq_client_rpc(struct lu_client_seq *seq,
 * precreating objects on this OST), and it will send the
 * request to MDT0 here, so we can not keep resending the
 * request here, otherwise if MDT0 is failed(umounted),
-* it can not release the export of MDT0 */
+* it can not release the export of MDT0
+*/
if (seq->lcs_type == LUSTRE_SEQ_DATA)
req->rq_no_delay = req->rq_no_resend = 1;
debug_mask = D_CONSOLE;
@@ -152,7 +153,8 @@ static int seq_client_alloc_meta(const struct lu_env *env,
/* If meta server return -EINPROGRESS or EAGAIN,
 * it means meta server might not be ready to
 * allocate super sequence from sequence controller
-* (MDT0)yet */
+* (MDT0)yet
+*/
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_META, "meta");
} while (rc == -EINPROGRESS || rc == -EAGAIN);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/56] staging/lustre: Remove ldlm_appetite_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_appetite

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 8 
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 924e68f..0f229b9 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -296,10 +296,10 @@ struct ldlm_valblock_ops {
  * LDLM pools related, type of lock pool in the namespace.
  * Greedy means release cached locks aggressively
  */
-typedef enum {
+enum ldlm_appetite {
LDLM_NAMESPACE_GREEDY = 1 << 0,
LDLM_NAMESPACE_MODEST = 1 << 1
-} ldlm_appetite_t;
+};
 
 struct ldlm_ns_bucket {
/** back pointer to namespace */
@@ -440,7 +440,7 @@ struct ldlm_namespace {
/** LDLM pool structure for this namespace */
struct ldlm_poolns_pool;
/** Definition of how eagerly unused locks will be released from LRU */
-   ldlm_appetite_t ns_appetite;
+   enum ldlm_appetite  ns_appetite;
 
/** Limit of parallel AST RPC count. */
unsignedns_max_parallel_ast;
@@ -1176,7 +1176,7 @@ void ldlm_unlink_lock_skiplist(struct ldlm_lock *req);
 /* resource.c */
 struct ldlm_namespace *
 ldlm_namespace_new(struct obd_device *obd, char *name,
-  ldlm_side_t client, ldlm_appetite_t apt,
+  ldlm_side_t client, enum ldlm_appetite apt,
   ldlm_ns_type_t ns_type);
 int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags);
 void ldlm_namespace_get(struct ldlm_namespace *ns);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index f9d0383..582cb21 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -621,7 +621,7 @@ static void ldlm_namespace_register(struct ldlm_namespace 
*ns,
  */
 struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
  ldlm_side_t client,
- ldlm_appetite_t apt,
+ enum ldlm_appetite apt,
  ldlm_ns_type_t ns_type)
 {
struct ldlm_namespace *ns = NULL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/56] staging/lustre: Get rid of lustre_quota_version typedef

2016-02-22 Thread green
From: Oleg Drokin 

Does not appear to be used anywhere.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index a4765c2..57d42a3 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -566,9 +566,9 @@ enum {
 /* hdr + MDT index */
 #define LUSTRE_VOLATILE_IDXLUSTRE_VOLATILE_HDR":%.4X:"
 
-typedef enum lustre_quota_version {
+enum lustre_quota_version {
LUSTRE_QUOTA_V2 = 1
-} lustre_quota_version_t;
+};
 
 /* XXX: same as if_dqinfo struct in kernel */
 struct obd_dqinfo {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 39/56] staging/lustre: MAY_NOT_BLOCK is always defined, don't check for it.

2016-02-22 Thread green
From: Oleg Drokin 

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/file.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index bbe6ebf..ba65fc0 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3071,10 +3071,8 @@ int ll_inode_permission(struct inode *inode, int mask)
 {
int rc = 0;
 
-#ifdef MAY_NOT_BLOCK
if (mask & MAY_NOT_BLOCK)
return -ECHILD;
-#endif
 
/* as root inode are NOT getting validated in lookup operation,
* need to do it before permission check. */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 40/56] staging/lustre: Remove unused lli_open_count from struct ll_inode_info

2016-02-22 Thread green
From: Oleg Drokin 

Capabilities code was the only user and it is long gone.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 6 ++
 drivers/staging/lustre/lustre/llite/llite_lib.c  | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 46144ff..bbd5ab8f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -133,10 +133,8 @@ struct ll_inode_info {
 * for allocating OST objects after a mknod() and later open-by-FID. */
struct lu_fid  lli_pfid;
 
-   struct list_head  lli_close_list;
-   /* open count currently used by capability only, indicate whether
-* capability needs renewal */
-   atomic_tlli_open_count;
+   struct list_head  lli_close_list;
+
unsigned long lli_rmtperm_time;
 
/* handle is to be sent to MDS later on done_writing and setattr.
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 67b4b80..b652aee 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -797,7 +797,6 @@ void ll_lli_init(struct ll_inode_info *lli)
/* Do not set lli_fid, it has been initialized already. */
fid_zero(&lli->lli_pfid);
INIT_LIST_HEAD(&lli->lli_close_list);
-   atomic_set(&lli->lli_open_count, 0);
lli->lli_rmtperm_time = 0;
lli->lli_pending_och = NULL;
lli->lli_mds_read_och = NULL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 31/56] staging/lustre: Remove unused struct quota_body

2016-02-22 Thread green
From: Oleg Drokin 

It's only used for communications between servers.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 31 ---
 .../lustre/lustre/include/lustre_req_layout.h  |  3 --
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 36 --
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 10 -
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 44 --
 5 files changed, 124 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index ccb1b85..607bfde 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1819,37 +1819,6 @@ do { \
Q_COPY(out, in, qc_dqblk);  \
 } while (0)
 
-/* Body of quota request used for quota acquire/release RPCs between quota
- * master (aka QMT) and slaves (ak QSD). */
-struct quota_body {
-   struct lu_fid   qb_fid; /* FID of global index packing the pool ID
- * and type (data or metadata) as well as
- * the quota type (user or group). */
-   union lquota_id qb_id;  /* uid or gid or directory FID */
-   __u32   qb_flags;   /* see below */
-   __u32   qb_padding;
-   __u64   qb_count;   /* acquire/release count (kbytes/inodes) */
-   __u64   qb_usage;   /* current slave usage (kbytes/inodes) */
-   __u64   qb_slv_ver; /* slave index file version */
-   struct lustre_handleqb_lockh; /* per-ID lock handle */
-   struct lustre_handleqb_glb_lockh; /* global lock handle */
-   __u64   qb_padding1[4];
-};
-
-/* When the quota_body is used in the reply of quota global intent
- * lock (IT_QUOTA_CONN) reply, qb_fid contains slave index file FID. */
-#define qb_slv_fid qb_fid
-/* qb_usage is the current qunit (in kbytes/inodes) when quota_body is used in
- * quota reply */
-#define qb_qunit   qb_usage
-
-#define QUOTA_DQACQ_FL_ACQ 0x1  /* acquire quota */
-#define QUOTA_DQACQ_FL_PREACQ  0x2  /* pre-acquire */
-#define QUOTA_DQACQ_FL_REL 0x4  /* release quota */
-#define QUOTA_DQACQ_FL_REPORT  0x8  /* report usage */
-
-void lustre_swab_quota_body(struct quota_body *b);
-
 /* Quota types currently supported */
 enum {
LQUOTA_TYPE_USR = 0x00, /* maps to USRQUOTA */
diff --git a/drivers/staging/lustre/lustre/include/lustre_req_layout.h 
b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
index b8a83a1..fdcdd7a 100644
--- a/drivers/staging/lustre/lustre/include/lustre_req_layout.h
+++ b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
@@ -176,7 +176,6 @@ extern struct req_format RQF_MDS_REINT_SETXATTR;
 extern struct req_format RQF_MDS_QUOTACHECK;
 extern struct req_format RQF_MDS_QUOTACTL;
 extern struct req_format RQF_QC_CALLBACK;
-extern struct req_format RQF_QUOTA_DQACQ;
 extern struct req_format RQF_MDS_SWAP_LAYOUTS;
 /* MDS hsm formats */
 extern struct req_format RQF_MDS_HSM_STATE_GET;
@@ -219,7 +218,6 @@ extern struct req_format RQF_LDLM_INTENT_OPEN;
 extern struct req_format RQF_LDLM_INTENT_CREATE;
 extern struct req_format RQF_LDLM_INTENT_UNLINK;
 extern struct req_format RQF_LDLM_INTENT_GETXATTR;
-extern struct req_format RQF_LDLM_INTENT_QUOTA;
 extern struct req_format RQF_LDLM_CANCEL;
 extern struct req_format RQF_LDLM_CALLBACK;
 extern struct req_format RQF_LDLM_CP_CALLBACK;
@@ -276,7 +274,6 @@ extern struct req_msg_field RMF_CAPA1;
 extern struct req_msg_field RMF_CAPA2;
 extern struct req_msg_field RMF_OBD_QUOTACHECK;
 extern struct req_msg_field RMF_OBD_QUOTACTL;
-extern struct req_msg_field RMF_QUOTA_BODY;
 extern struct req_msg_field RMF_STRING;
 extern struct req_msg_field RMF_SWAP_LAYOUTS;
 extern struct req_msg_field RMF_MDS_HSM_PROGRESS;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c 
b/drivers/staging/lustre/lustre/ptlrpc/layout.c
index aff9bf5..715088f 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
@@ -118,25 +118,6 @@ static const struct req_msg_field *quotactl_only[] = {
&RMF_OBD_QUOTACTL
 };
 
-static const struct req_msg_field *quota_body_only[] = {
-   &RMF_PTLRPC_BODY,
-   &RMF_QUOTA_BODY
-};
-
-static const struct req_msg_field *ldlm_intent_quota_client[] = {
-   &RMF_PTLRPC_BODY,
-   &RMF_DLM_REQ,
-   &RMF_LDLM_INTENT,
-   &RMF_QUOTA_BODY
-};
-
-static const struct req_msg_field *ldlm_intent_quota_server[] = {
-   &RMF_PTLRPC_BODY,
-   &RMF_DLM_REP,
-   &RMF_DLM_LVB,
-   &RMF_QUOTA_BODY
-};
-
 static const struct req_msg_field *mdt_close_client[] = {
&RMF_PTLRPC_BODY,
&RMF_MDT_EPOCH,
@@ -748,8 +729,6 @@ static struct req_format *req_formats[] = {
&RQF_LDLM_INTENT_CREATE,
&RQF_

[PATCH 33/56] staging/lustre: S_DIRSYNC is always defined in kernel

2016-02-22 Thread green
From: Oleg Drokin 

No need to check for it.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index b5f8453..ad77d33 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2013,9 +2013,7 @@ static inline int ll_ext_to_inode_flags(int flags)
return (((flags & LUSTRE_SYNC_FL)  ? S_SYNC  : 0) |
((flags & LUSTRE_NOATIME_FL)   ? S_NOATIME   : 0) |
((flags & LUSTRE_APPEND_FL)? S_APPEND: 0) |
-#if defined(S_DIRSYNC)
((flags & LUSTRE_DIRSYNC_FL)   ? S_DIRSYNC   : 0) |
-#endif
((flags & LUSTRE_IMMUTABLE_FL) ? S_IMMUTABLE : 0));
 }
 
@@ -2024,9 +2022,7 @@ static inline int ll_inode_to_ext_flags(int iflags)
return (((iflags & S_SYNC)  ? LUSTRE_SYNC_FL  : 0) |
((iflags & S_NOATIME)   ? LUSTRE_NOATIME_FL   : 0) |
((iflags & S_APPEND)? LUSTRE_APPEND_FL: 0) |
-#if defined(S_DIRSYNC)
((iflags & S_DIRSYNC)   ? LUSTRE_DIRSYNC_FL   : 0) |
-#endif
((iflags & S_IMMUTABLE) ? LUSTRE_IMMUTABLE_FL : 0));
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 36/56] staging/lustre: Remove server data from struct obd_export

2016-02-22 Thread green
From: Oleg Drokin 

Despite it's name struct obd_export could exist on the client too
(used for reverse exports), but all the actual server bits
are not needed there, so could be dropped. This is mostly
various target-related stuff.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_export.h  | 70 --
 1 file changed, 70 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h 
b/drivers/staging/lustre/lustre/include/lustre_export.h
index 86f91ce..30ae096 100644
--- a/drivers/staging/lustre/lustre/include/lustre_export.h
+++ b/drivers/staging/lustre/lustre/include/lustre_export.h
@@ -50,62 +50,6 @@
 #include "lustre/lustre_idl.h"
 #include "lustre_dlm.h"
 
-struct mds_client_data;
-struct mdt_client_data;
-struct mds_idmap_table;
-struct mdt_idmap_table;
-
-/**
- * Target-specific export data
- */
-struct tg_export_data {
-   /** Protects led_lcd below */
-   struct mutexted_lcd_lock;
-   /** Per-client data for each export */
-   struct lsd_client_data  *ted_lcd;
-   /** Offset of record in last_rcvd file */
-   loff_t  ted_lr_off;
-   /** Client index in last_rcvd file */
-   int ted_lr_idx;
-};
-
-/**
- * MDT-specific export data
- */
-struct mdt_export_data {
-   struct tg_export_data   med_ted;
-   /** List of all files opened by client on this MDT */
-   struct list_headmed_open_head;
-   spinlock_t  med_open_lock; /* med_open_head, mfd_list */
-   /** Bitmask of all ibit locks this MDT understands */
-   __u64   med_ibits_known;
-   struct mutexmed_idmap_mutex;
-   struct lustre_idmap_table *med_idmap;
-};
-
-struct ec_export_data { /* echo client */
-   struct list_head eced_locks;
-};
-
-/* In-memory access to client data from OST struct */
-/** Filter (oss-side) specific import data */
-struct filter_export_data {
-   struct tg_export_data   fed_ted;
-   spinlock_t  fed_lock;   /**< protects fed_mod_list */
-   long   fed_dirty;/* in bytes */
-   long   fed_grant;/* in bytes */
-   struct list_head fed_mod_list; /* files being modified 
*/
-   int fed_mod_count;/* items in fed_writing list */
-   long   fed_pending;  /* bytes just being written */
-   __u32 fed_group;
-   __u8   fed_pagesize; /* log2 of client page size */
-};
-
-struct mgs_export_data {
-   struct list_headmed_clients;/* mgc fs client via 
this exp */
-   spinlock_t  med_lock;   /* protect med_clients */
-};
-
 enum obd_option {
OBD_OPT_FORCE =  0x0001,
OBD_OPT_FAILOVER =  0x0002,
@@ -200,22 +144,8 @@ struct obd_export {
/** blocking dlm lock list, protected by exp_bl_list_lock */
struct list_headexp_bl_list;
spinlock_texp_bl_list_lock;
-
-   /** Target specific data */
-   union {
-   struct tg_export_data eu_target_data;
-   struct mdt_export_dataeu_mdt_data;
-   struct filter_export_data eu_filter_data;
-   struct ec_export_data eu_ec_data;
-   struct mgs_export_dataeu_mgs_data;
-   } u;
 };
 
-#define exp_target_data u.eu_target_data
-#define exp_mdt_datau.eu_mdt_data
-#define exp_filter_data u.eu_filter_data
-#define exp_ec_data u.eu_ec_data
-
 static inline __u64 *exp_connect_flags_ptr(struct obd_export *exp)
 {
return &exp->exp_connect_data.ocd_connect_flags;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 34/56] staging/lustre: FMODE_READ and FMODE_WRITE are always defined in the kernel

2016-02-22 Thread green
From: Oleg Drokin 

So no need to see if they are.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index ad77d33..7b5c132 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2158,11 +2158,6 @@ void lustre_swab_mdt_rec_setattr(struct mdt_rec_setattr 
*sa);
 #define MDS_ATTR_FROM_OPEN  0x4000ULL /* = 16384, called from open path, ie 
O_TRUNC */
 #define MDS_ATTR_BLOCKS 0x8000ULL /* = 32768 */
 
-#ifndef FMODE_READ
-#define FMODE_READ0001
-#define FMODE_WRITE  0002
-#endif
-
 #define MDS_FMODE_CLOSED
 #define MDS_FMODE_EXEC0004
 /* IO Epoch is opened on a closed file. */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 35/56] staging/lustre: Remove index file transfer structures

2016-02-22 Thread green
From: Oleg Drokin 

struct idx_info, struct lu_idxpage, lustre_swab_idx_info,
request formats and related defines are all unused and could
only happen for between-servers communications, so remove them
from the client code.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 86 
 .../lustre/lustre/include/lustre_req_layout.h  |  2 -
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 21 -
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 14 
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 95 --
 5 files changed, 218 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 7b5c132..c272c18 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3168,92 +3168,6 @@ void dump_ioo(struct obd_ioobj *nb);
 void dump_ost_body(struct ost_body *ob);
 void dump_rcs(__u32 *rc);
 
-#define IDX_INFO_MAGIC 0x3D37CC37
-
-/* Index file transfer through the network. The server serializes the index 
into
- * a byte stream which is sent to the client via a bulk transfer */
-struct idx_info {
-   __u32   ii_magic;
-
-   /* reply: see idx_info_flags below */
-   __u32   ii_flags;
-
-   /* request & reply: number of lu_idxpage (to be) transferred */
-   __u16   ii_count;
-   __u16   ii_pad0;
-
-   /* request: requested attributes passed down to the iterator API */
-   __u32   ii_attrs;
-
-   /* request & reply: index file identifier (FID) */
-   struct lu_fid   ii_fid;
-
-   /* reply: version of the index file before starting to walk the index.
-* Please note that the version can be modified at any time during the
-* transfer */
-   __u64   ii_version;
-
-   /* request: hash to start with:
-* reply: hash of the first entry of the first lu_idxpage and hash
-*  of the entry to read next if any */
-   __u64   ii_hash_start;
-   __u64   ii_hash_end;
-
-   /* reply: size of keys in lu_idxpages, minimal one if II_FL_VARKEY is
-* set */
-   __u16   ii_keysize;
-
-   /* reply: size of records in lu_idxpages, minimal one if II_FL_VARREC
-* is set */
-   __u16   ii_recsize;
-
-   __u32   ii_pad1;
-   __u64   ii_pad2;
-   __u64   ii_pad3;
-};
-
-void lustre_swab_idx_info(struct idx_info *ii);
-
-#define II_END_OFF MDS_DIR_END_OFF /* all entries have been read */
-
-/* List of flags used in idx_info::ii_flags */
-enum idx_info_flags {
-   II_FL_NOHASH= 1 << 0, /* client doesn't care about hash value */
-   II_FL_VARKEY= 1 << 1, /* keys can be of variable size */
-   II_FL_VARREC= 1 << 2, /* records can be of variable size */
-   II_FL_NONUNQ= 1 << 3, /* index supports non-unique keys */
-};
-
-#define LIP_MAGIC 0x8A6D6B6C
-
-/* 4KB (= LU_PAGE_SIZE) container gathering key/record pairs */
-struct lu_idxpage {
-   /* 16-byte header */
-   __u32   lip_magic;
-   __u16   lip_flags;
-   __u16   lip_nr;   /* number of entries in the container */
-   __u64   lip_pad0; /* additional padding for future use */
-
-   /* key/record pairs are stored in the remaining 4080 bytes.
-* depending upon the flags in idx_info::ii_flags, each key/record
-* pair might be preceded by:
-* - a hash value
-* - the key size (II_FL_VARKEY is set)
-* - the record size (II_FL_VARREC is set)
-*
-* For the time being, we only support fixed-size key & record. */
-   charlip_entries[0];
-};
-
-#define LIP_HDR_SIZE (offsetof(struct lu_idxpage, lip_entries))
-
-/* Gather all possible type associated with a 4KB container */
-union lu_page {
-   struct lu_dirpage   lp_dir; /* for MDS_READPAGE */
-   struct lu_idxpage   lp_idx; /* for OBD_IDX_READ */
-   charlp_array[LU_PAGE_SIZE];
-};
-
 /* security opcodes */
 enum sec_cmd {
SEC_CTX_INIT= 801,
diff --git a/drivers/staging/lustre/lustre/include/lustre_req_layout.h 
b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
index fdcdd7a..b5128e4 100644
--- a/drivers/staging/lustre/lustre/include/lustre_req_layout.h
+++ b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
@@ -130,7 +130,6 @@ void req_layout_fini(void);
 extern struct req_format RQF_OBD_PING;
 extern struct req_format RQF_OBD_SET_INFO;
 extern struct req_format RQF_SEC_CTX;
-extern struct req_format RQF_OBD_IDX_READ;
 /* MGS req_format */
 extern struct req_format RQF_MGS_TARGET_REG;
 extern struct req_format RQF_MGS_SET_INFO;
@@ -249,7 +248,6 @@ extern struct req_msg_field RMF_SETINFO_KEY;
 extern struct req_msg_field RMF_GETINFO_VAL;
 extern struct req_msg_field RMF_G

[PATCH 54/56] staging/lustre/osc: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_cache.c  | 168 ++---
 .../staging/lustre/lustre/osc/osc_cl_internal.h|  33 ++--
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   8 +-
 drivers/staging/lustre/lustre/osc/osc_io.c |   6 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c   |  45 --
 drivers/staging/lustre/lustre/osc/osc_page.c   |  42 --
 drivers/staging/lustre/lustre/osc/osc_quota.c  |  16 +-
 drivers/staging/lustre/lustre/osc/osc_request.c| 151 +++---
 8 files changed, 310 insertions(+), 159 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index d006566..c6623c1 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -262,7 +262,8 @@ static int osc_extent_sanity_check0(struct osc_extent *ext,
}
 
/* Do not verify page list if extent is in RPC. This is because an
-* in-RPC extent is supposed to be exclusively accessible w/o lock. */
+* in-RPC extent is supposed to be exclusively accessible w/o lock.
+*/
if (ext->oe_state > OES_CACHE) {
rc = 0;
goto out;
@@ -587,7 +588,8 @@ void osc_extent_release(const struct lu_env *env, struct 
osc_extent *ext)
if (ext->oe_trunc_pending) {
/* a truncate process is waiting for this extent.
 * This may happen due to a race, check
-* osc_cache_truncate_start(). */
+* osc_cache_truncate_start().
+*/
osc_extent_state_set(ext, OES_TRUNC);
ext->oe_trunc_pending = 0;
} else {
@@ -704,18 +706,21 @@ restart:
 
/* ok, from now on, ext and cur have these attrs:
 * 1. covered by the same lock
-* 2. contiguous at chunk level or overlapping. */
+* 2. contiguous at chunk level or overlapping.
+*/
 
if (overlapped(ext, cur)) {
/* cur is the minimum unit, so overlapping means
-* full contain. */
+* full contain.
+*/
EASSERTF((ext->oe_start <= cur->oe_start &&
  ext->oe_end >= cur->oe_end),
 ext, EXTSTR, EXTPARA(cur));
 
if (ext->oe_state > OES_CACHE || ext->oe_fsync_wait) {
/* for simplicity, we wait for this extent to
-* finish before going forward. */
+* finish before going forward.
+*/
conflict = osc_extent_get(ext);
break;
}
@@ -728,17 +733,20 @@ restart:
if (ext->oe_state != OES_CACHE || ext->oe_fsync_wait) {
/* we can't do anything for a non OES_CACHE extent, or
 * if there is someone waiting for this extent to be
-* flushed, try next one. */
+* flushed, try next one.
+*/
ext = next_extent(ext);
continue;
}
 
/* check if they belong to the same rpc slot before trying to
 * merge. the extents are not overlapped and contiguous at
-* chunk level to get here. */
+* chunk level to get here.
+*/
if (ext->oe_max_end != max_end) {
/* if they don't belong to the same RPC slot or
-* max_pages_per_rpc has ever changed, do not merge. */
+* max_pages_per_rpc has ever changed, do not merge.
+*/
ext = next_extent(ext);
continue;
}
@@ -747,7 +755,8 @@ restart:
 * level so that we know the whole extent is covered by grant
 * (the pages in the extent are NOT required to be contiguous).
 * Otherwise, it will be too much difficult to know which
-* chunks have grants allocated. */
+* chunks have grants allocated.
+*/
 
/* try to do front merge - extend ext's start */
if (chunk + 1 == ext_chk_start) {
@@ -767,7 +776,8 @@ restart:
*grants -= chunksize;
 
/* try to merge with the next one because we just fill
-* in a gap */
+

[PATCH 56/56] staging/lustre: Fix indentation mistakes

2016-02-22 Thread green
From: Oleg Drokin 

none look like bugs or bugs-inducing, mostly just
off by a couple of spaces all around.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lprocfs_status.h |  2 +-
 .../lustre/lustre/include/lustre/lustre_idl.h  |  8 ++--
 .../lustre/lustre/include/lustre/lustre_user.h |  2 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  2 +-
 drivers/staging/lustre/lustre/llite/rw.c   |  4 +-
 drivers/staging/lustre/lustre/llite/rw26.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c|  8 ++--
 drivers/staging/lustre/lustre/lov/lov_pool.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 45 +++---
 .../lustre/lustre/obdclass/lprocfs_status.c|  2 +-
 .../staging/lustre/lustre/obdclass/obd_config.c|  2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |  4 +-
 drivers/staging/lustre/lustre/osc/osc_request.c|  2 +-
 13 files changed, 42 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index eb693a1..0d98111 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -276,7 +276,7 @@ static inline int opcode_offset(__u32 opc)
OPC_RANGE(OST));
} else if (opc < FLD_LAST_OPC) {
/* FLD opcode */
-return (opc - FLD_FIRST_OPC +
+   return (opc - FLD_FIRST_OPC +
OPC_RANGE(SEC) +
OPC_RANGE(SEQ) +
OPC_RANGE(QUOTA) +
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index e32163b..284affb 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -700,9 +700,9 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct 
ost_id *ostid,
 * of 1M objects/s/OST for 9 years, or combinations thereof.
 */
if (ostid_id(ostid) >= IDIF_MAX_OID) {
-CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
-   POSTID(ostid), ost_idx);
-return -EBADF;
+   CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n",
+  POSTID(ostid), ost_idx);
+   return -EBADF;
}
fid->f_seq = fid_idif_seq(ostid_id(ostid), ost_idx);
/* truncate to 32 bits by assignment */
@@ -3154,7 +3154,7 @@ static inline void lustre_get_wire_obdo(struct 
obd_connect_data *ocd,
__u32 local_flags = 0;
 
if (lobdo->o_valid & OBD_MD_FLFLAGS)
-local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
+   local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
 
*lobdo = *wobdo;
if (local_flags != 0) {
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 60c40ca..2e9f025 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -473,7 +473,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, 
int buflen)
buf[buflen - 1] = '\0';
p = strrchr(buf, '-');
if (p)
-  *p = '\0';
+   *p = '\0';
 }
 
 /* printf display format
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c 
b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index d8c39fb..31abdb7f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -119,7 +119,7 @@ ll_fault_io_init(struct vm_area_struct *vma, struct lu_env 
**env_ret,
 */
env = cl_env_nested_get(nest);
if (IS_ERR(env))
-return ERR_PTR(-EINVAL);
+   return ERR_PTR(-EINVAL);
 
*env_ret = env;
 
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index d685c8f..0e5bd4f 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -381,9 +381,9 @@ static int index_in_window(unsigned long index, unsigned 
long point,
unsigned long start = point - before, end = point + after;
 
if (start > point)
-  start = 0;
+   start = 0;
if (end < point)
-  end = ~0;
+   end = ~0;
 
return start <= index && index <= end;
 }
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 89fd513..b0f7ffa 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -248,7 +248,7 @@ ssize_t ll_direct_rw_pages(const str

[PATCH 48/56] staging/lustre/lmv: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lmv/lmv_fld.c|  3 ++-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  9 ---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 37 +-
 3 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c 
b/drivers/staging/lustre/lustre/lmv/lmv_fld.c
index ee23592..378691b 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c
@@ -58,7 +58,8 @@ int lmv_fld_lookup(struct lmv_obd *lmv,
int rc;
 
/* FIXME: Currently ZFS still use local seq for ROOT unfortunately, and
-* this fid_is_local check should be removed once LU-2240 is fixed */
+* this fid_is_local check should be removed once LU-2240 is fixed
+*/
LASSERTF((fid_seq_in_fldb(fid_seq(fid)) ||
  fid_seq_is_local_file(fid_seq(fid))) &&
 fid_is_sane(fid), DFID" is insane!\n", PFID(fid));
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c 
b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
index cb1ed42..259b211 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
@@ -110,11 +110,13 @@ static int lmv_intent_remote(struct obd_export *exp, void 
*lmm,
if (parent_fid) {
/* The parent fid is only for remote open to
 * check whether the open is from OBF,
-* see mdt_cross_open */
+* see mdt_cross_open
+*/
LASSERT(it->it_op & IT_OPEN);
op_data->op_fid2 = *parent_fid;
/* Add object FID to op_fid3, in case it needs to check stale
-* (M_CHECK_STALE), see mdc_finish_intent_lock */
+* (M_CHECK_STALE), see mdc_finish_intent_lock
+*/
op_data->op_fid3 = body->fid1;
}
 
@@ -173,7 +175,8 @@ static int lmv_intent_open(struct obd_export *exp, struct 
md_op_data *op_data,
return PTR_ERR(tgt);
 
/* If it is ready to open the file by FID, do not need
-* allocate FID at all, otherwise it will confuse MDT */
+* allocate FID at all, otherwise it will confuse MDT
+*/
if ((it->it_op & IT_CREAT) &&
!(it->it_flags & MDS_OPEN_BY_FID)) {
/*
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index eb1c85f..67746c9 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -679,7 +679,8 @@ repeat_fid2path:
goto out_fid2path;
 
/* If remote_gf != NULL, it means just building the
-* path on the remote MDT, copy this path segment to gf */
+* path on the remote MDT, copy this path segment to gf
+*/
if (remote_gf) {
struct getinfo_fid2path *ori_gf;
char *ptr;
@@ -797,7 +798,8 @@ static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, 
unsigned int cmd, int len,
/* unregister request (call from llapi_hsm_copytool_fini) */
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
/* best effort: try to clean as much as possible
-* (continue on error) */
+* (continue on error)
+*/
obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp, len, lk, uarg);
}
 
@@ -821,7 +823,8 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
 
/* All or nothing: try to register to all MDS.
 * In case of failure, unregister from previous MDS,
-* except if it because of inactive target. */
+* except if it because of inactive target.
+*/
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
err = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp,
   len, lk, uarg);
@@ -841,8 +844,8 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
return rc;
}
/* else: transient error.
-* kuc will register to the missing MDT
-* when it is back */
+* kuc will register to the missing MDT when it is back
+*/
} else {
any_set = true;
}
@@ -1028,7 +1031,8 @@ static int lmv_iocontrol(unsigned int cmd, struct 
obd_export *exp,
 
/* if the request is about a single fid
 * or if there is a single MDS, no need to split
-* the request. */
+* the request.
+*/
if (reqcount == 1 || count == 1)

[PATCH 52/56] staging/lustre/obdclass: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 13 +++--
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   | 24 +---
 drivers/staging/lustre/lustre/obdclass/class_obd.c |  5 +-
 drivers/staging/lustre/lustre/obdclass/genops.c| 42 --
 .../lustre/lustre/obdclass/linux/linux-module.c|  3 +-
 drivers/staging/lustre/lustre/obdclass/llog.c  |  6 +-
 drivers/staging/lustre/lustre/obdclass/llog_obd.c  |  3 +-
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |  3 +-
 .../lustre/lustre/obdclass/lprocfs_counters.c  |  6 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  3 +-
 .../lustre/lustre/obdclass/lustre_handles.c|  3 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |  3 +-
 .../staging/lustre/lustre/obdclass/obd_config.c| 42 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c | 67 ++
 drivers/staging/lustre/lustre/obdclass/obdo.c  |  6 +-
 15 files changed, 144 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 58b46a7..8cc7aa1 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -44,6 +44,7 @@
 #include "../include/obd_support.h"
 #include "../include/lustre_fid.h"
 #include 
+#include 
 #include "../include/cl_object.h"
 #include "cl_internal.h"
 
@@ -308,7 +309,8 @@ static void cl_io_locks_sort(struct cl_io *io)
   &prev->cill_linkage);
done = 0;
continue; /* don't change prev: it's
-  * still "previous" */
+  * still "previous"
+  */
case -1: /* already in order */
break;
}
@@ -419,7 +421,8 @@ static int cl_lockset_lock(const struct lu_env *env, struct 
cl_io *io,
list_for_each_entry_safe(link, temp, &set->cls_todo, cill_linkage) {
if (!cl_lockset_match(set, &link->cill_descr)) {
/* XXX some locking to guarantee that locks aren't
-* expanded in between. */
+* expanded in between.
+*/
result = cl_lockset_lock_one(env, io, set, link);
if (result != 0)
break;
@@ -1053,7 +1056,8 @@ EXPORT_SYMBOL(cl_page_list_init);
 void cl_page_list_add(struct cl_page_list *plist, struct cl_page *page)
 {
/* it would be better to check that page is owned by "current" io, but
-* it is not passed here. */
+* it is not passed here.
+*/
LASSERT(page->cp_owner);
LINVRNT(plist->pl_owner == current);
 
@@ -1510,9 +1514,6 @@ void cl_req_attr_set(const struct lu_env *env, struct 
cl_req *req,
 }
 EXPORT_SYMBOL(cl_req_attr_set);
 
-/* XXX complete(), init_completion(), and wait_for_completion(), until they are
- * implemented in libcfs. */
-# include 
 
 /**
  * Initialize synchronous io wait anchor, for transfer of \a nrpages pages.
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c 
b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 57cb100..6f44dde 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -935,7 +935,8 @@ int cl_lock_state_wait(const struct lu_env *env, struct 
cl_lock *lock)
if (result == 0) {
/* To avoid being interrupted by the 'non-fatal' signals
 * (SIGCHLD, for instance), we'd block them temporarily.
-* LU-305 */
+* LU-305
+*/
blocked = cfs_block_sigsinv(LUSTRE_FATAL_SIGS);
 
init_waitqueue_entry(&waiter, current);
@@ -946,7 +947,8 @@ int cl_lock_state_wait(const struct lu_env *env, struct 
cl_lock *lock)
LASSERT(cl_lock_nr_mutexed(env) == 0);
 
/* Returning ERESTARTSYS instead of EINTR so syscalls
-* can be restarted if signals are pending here */
+* can be restarted if signals are pending here
+*/
result = -ERESTARTSYS;
if (likely(!OBD_FAIL_CHECK(OBD_FAIL_LOCK_STATE_WAIT_INTR))) {
schedule();
@@ -1170,7 +1172,8 @@ int cl_enqueue_try(const struct lu_env *env, struct 
cl_lock *lock,
/* kick layers. */
result = cl_enqueue_kick(env, lock, io, flags);
/* For AGL case, the cl_lock::cll_st

[PATCH 32/56] staging/lustre: Remove lquota_glb_rec, lquota_slv_rec and lquota_acct_rec

2016-02-22 Thread green
From: Oleg Drokin 

These server-only structures and some supporting defines are unused
on the client.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 52 --
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 44 --
 2 files changed, 96 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 607bfde..b5f8453 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1819,58 +1819,6 @@ do { \
Q_COPY(out, in, qc_dqblk);  \
 } while (0)
 
-/* Quota types currently supported */
-enum {
-   LQUOTA_TYPE_USR = 0x00, /* maps to USRQUOTA */
-   LQUOTA_TYPE_GRP = 0x01, /* maps to GRPQUOTA */
-   LQUOTA_TYPE_MAX
-};
-
-/* There are 2 different resource types on which a quota limit can be enforced:
- * - inodes on the MDTs
- * - blocks on the OSTs */
-enum {
-   LQUOTA_RES_MD   = 0x01, /* skip 0 to avoid null oid in FID */
-   LQUOTA_RES_DT   = 0x02,
-   LQUOTA_LAST_RES,
-   LQUOTA_FIRST_RES= LQUOTA_RES_MD
-};
-
-#define LQUOTA_NR_RES (LQUOTA_LAST_RES - LQUOTA_FIRST_RES + 1)
-
-/*
- * Space accounting support
- * Format of an accounting record, providing disk usage information for a given
- * user or group
- */
-struct lquota_acct_rec { /* 16 bytes */
-   __u64 bspace;  /* current space in use */
-   __u64 ispace;  /* current # inodes in use */
-};
-
-/*
- * Global quota index support
- * Format of a global record, providing global quota settings for a given quota
- * identifier
- */
-struct lquota_glb_rec { /* 32 bytes */
-   __u64 qbr_hardlimit; /* quota hard limit, in #inodes or kbytes */
-   __u64 qbr_softlimit; /* quota soft limit, in #inodes or kbytes */
-   __u64 qbr_time;  /* grace time, in seconds */
-   __u64 qbr_granted;   /* how much is granted to slaves, in #inodes or
- * kbytes */
-};
-
-/*
- * Slave index support
- * Format of a slave record, recording how much space is granted to a given
- * slave
- */
-struct lquota_slv_rec { /* 8 bytes */
-   __u64 qsr_granted; /* space granted to the slave for the key=ID,
-   * in #inodes or kbytes */
-};
-
 /* Data structures associated with the quota locks */
 
 /* Glimpse descriptor used for the index & per-ID quota locks */
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c 
b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index c61d46f..249f9b3 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -336,10 +336,6 @@ void lustre_assert_wire_constants(void)
CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
-   CLASSERT(LQUOTA_TYPE_USR == 0);
-   CLASSERT(LQUOTA_TYPE_GRP == 1);
-   CLASSERT(LQUOTA_RES_MD == 1);
-   CLASSERT(LQUOTA_RES_DT == 2);
LASSERTF(OBD_PING == 400, "found %lld\n",
 (long long)OBD_PING);
LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
@@ -1609,46 +1605,6 @@ void lustre_assert_wire_constants(void)
LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n",
Q_FINVALIDATE);
 
-   /* Checks for struct lquota_acct_rec */
-   LASSERTF((int)sizeof(struct lquota_acct_rec) == 16, "found %lld\n",
-(long long)(int)sizeof(struct lquota_acct_rec));
-   LASSERTF((int)offsetof(struct lquota_acct_rec, bspace) == 0, "found 
%lld\n",
-(long long)(int)offsetof(struct lquota_acct_rec, bspace));
-   LASSERTF((int)sizeof(((struct lquota_acct_rec *)0)->bspace) == 8, 
"found %lld\n",
-(long long)(int)sizeof(((struct lquota_acct_rec *)0)->bspace));
-   LASSERTF((int)offsetof(struct lquota_acct_rec, ispace) == 8, "found 
%lld\n",
-(long long)(int)offsetof(struct lquota_acct_rec, ispace));
-   LASSERTF((int)sizeof(((struct lquota_acct_rec *)0)->ispace) == 8, 
"found %lld\n",
-(long long)(int)sizeof(((struct lquota_acct_rec *)0)->ispace));
-
-   /* Checks for struct lquota_glb_rec */
-   LASSERTF((int)sizeof(struct lquota_glb_rec) == 32, "found %lld\n",
-(long long)(int)sizeof(struct lquota_glb_rec));
-   LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_hardlimit) == 0, 
"found %lld\n",
-(long long)(int)offsetof(struct lquota_glb_rec, 
qbr_hardlimit));
-   LASSERTF((int)sizeof(((struct lquota_glb_rec *)0)->qbr_hardlimit) == 8, 
"found %lld\n",
-(long long)(int)sizeof(((struct lquota_glb_rec 
*)0)->qbr_hardlimit));
-   LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_softlimit) == 8, 
"found %lld\n",
-(long long)(int)o

[PATCH 51/56] staging/lustre/mgc: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 71 -
 1 file changed, 46 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 9764e57..6fc8225 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -90,7 +90,8 @@ static int mgc_name2resid(char *name, int len, struct 
ldlm_res_id *res_id,
 int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type)
 {
/* fsname is at most 8 chars long, maybe contain "-".
-* e.g. "lustre", "SUN-000" */
+* e.g. "lustre", "SUN-000"
+*/
return mgc_name2resid(fsname, strlen(fsname), res_id, type);
 }
 EXPORT_SYMBOL(mgc_fsname2resid);
@@ -102,7 +103,8 @@ static int mgc_logname2resid(char *logname, struct 
ldlm_res_id *res_id, int type
 
/* logname consists of "fsname-nodetype".
 * e.g. "lustre-MDT0001", "SUN-000-client"
-* there is an exception: llog "params" */
+* there is an exception: llog "params"
+*/
name_end = strrchr(logname, '-');
if (!name_end)
len = strlen(logname);
@@ -125,7 +127,8 @@ static int config_log_get(struct config_llog_data *cld)
 }
 
 /* Drop a reference to a config log.  When no longer referenced,
-   we can free the config log data */
+ * we can free the config log data
+ */
 static void config_log_put(struct config_llog_data *cld)
 {
CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname,
@@ -252,7 +255,8 @@ static struct config_llog_data 
*config_recover_log_add(struct obd_device *obd,
char logname[32];
 
/* we have to use different llog for clients and mdts for cmd
-* where only clients are notified if one of cmd server restarts */
+* where only clients are notified if one of cmd server restarts
+*/
LASSERT(strlen(fsname) < sizeof(logname) / 2);
strcpy(logname, fsname);
LASSERT(lcfg.cfg_instance);
@@ -483,8 +487,9 @@ static void do_requeue(struct config_llog_data *cld)
LASSERT(atomic_read(&cld->cld_refcount) > 0);
 
/* Do not run mgc_process_log on a disconnected export or an
-  export which is being disconnected. Take the client
-  semaphore to make the check non-racy. */
+* export which is being disconnected. Take the client
+* semaphore to make the check non-racy.
+*/
down_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem);
if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) {
CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname);
@@ -529,8 +534,9 @@ static int mgc_requeue_thread(void *data)
}
 
/* Always wait a few seconds to allow the server who
-  caused the lock revocation to finish its setup, plus some
-  random so everyone doesn't try to reconnect at once. */
+* caused the lock revocation to finish its setup, plus some
+* random so everyone doesn't try to reconnect at once.
+*/
to = MGC_TIMEOUT_MIN_SECONDS * HZ;
to += rand * HZ / 100; /* rand is centi-seconds */
lwi = LWI_TIMEOUT(to, NULL, NULL);
@@ -559,7 +565,8 @@ static int mgc_requeue_thread(void *data)
LASSERT(atomic_read(&cld->cld_refcount) > 0);
 
/* Whether we enqueued again or not in mgc_process_log,
-* we're done with the ref from the old enqueue */
+* we're done with the ref from the old enqueue
+*/
if (cld_prev)
config_log_put(cld_prev);
cld_prev = cld;
@@ -575,7 +582,8 @@ static int mgc_requeue_thread(void *data)
config_log_put(cld_prev);
 
/* break after scanning the list so that we can drop
-* refcount to losing lock clds */
+* refcount to losing lock clds
+*/
if (unlikely(stopped)) {
spin_lock(&config_list_lock);
break;
@@ -598,7 +606,8 @@ static int mgc_requeue_thread(void *data)
 }
 
 /* Add a cld to the list to requeue.  Start the requeue thread if needed.
-   We are responsible for dropping the config log reference from here on out. 
*/
+ * We are responsible for dropping the config log reference from here on out.
+ */
 static void mgc_requeue_add(struct config_llog_data *cld)
 {
CDEBUG(D_INFO, "log %s: requeue (r=%d sp=%d st=%x)\n",
@@ -635,7 +644,8 @@ static int mgc_llog_init(const struct lu_env *env, struct 
obd_device *obd)
int  

[PATCH 42/56] staging/lustre/include: Adjust comment style

2016-02-22 Thread green
From: Oleg Drokin 

This fixes most of the
"Block comments use a trailing */ on a separate line" checkpatch
warnings, also some slight reformats of structures or comments
at places.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/cl_object.h  | 69 ++
 drivers/staging/lustre/lustre/include/lclient.h|  3 +-
 .../staging/lustre/lustre/include/lprocfs_status.h | 13 ++--
 drivers/staging/lustre/lustre/include/lu_object.h  |  6 +-
 .../lustre/lustre/include/lustre/ll_fiemap.h   | 63 
 .../lustre/lustre/include/lustre/lustre_user.h | 52 ++--
 drivers/staging/lustre/lustre/include/lustre_cfg.h |  9 ++-
 .../staging/lustre/lustre/include/lustre_disk.h| 27 +
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 29 +
 .../lustre/lustre/include/lustre_dlm_flags.h   | 51 ++--
 .../staging/lustre/lustre/include/lustre_export.h  |  3 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h | 18 --
 drivers/staging/lustre/lustre/include/lustre_fld.h | 33 ---
 .../staging/lustre/lustre/include/lustre_handles.h |  3 +-
 .../staging/lustre/lustre/include/lustre_import.h  |  3 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h |  3 +-
 drivers/staging/lustre/lustre/include/lustre_log.h |  3 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |  6 +-
 drivers/staging/lustre/lustre/include/lustre_net.h | 39 +++-
 drivers/staging/lustre/lustre/include/obd.h| 58 ++
 drivers/staging/lustre/lustre/include/obd_cksum.h  |  9 ++-
 drivers/staging/lustre/lustre/include/obd_class.h  | 50 ++--
 .../staging/lustre/lustre/include/obd_support.h| 18 +++---
 23 files changed, 352 insertions(+), 216 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 373e772..2a77ea2f8 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -157,7 +157,8 @@ struct cl_device {
 };
 
 /** \addtogroup cl_object cl_object
- * @{ */
+ * @{
+ */
 /**
  * "Data attributes" of cl_object. Data attributes can be updated
  * independently for a sub-object, and top-object's attributes are calculated
@@ -288,13 +289,14 @@ struct cl_object_conf {
 
 enum {
/** configure layout, set up a new stripe, must be called while
-* holding layout lock. */
+* holding layout lock.
+*/
OBJECT_CONF_SET = 0,
/** invalidate the current stripe configuration due to losing
-* layout lock. */
+* layout lock.
+*/
OBJECT_CONF_INVALIDATE = 1,
-   /** wait for old layout to go away so that new layout can be
-* set up. */
+   /** wait for old layout to go away so that new layout can be set up. */
OBJECT_CONF_WAIT = 2
 };
 
@@ -393,7 +395,8 @@ struct cl_object_operations {
  */
 struct cl_object_header {
/** Standard lu_object_header. cl_object::co_lu::lo_header points
-* here. */
+* here.
+*/
struct lu_object_header  coh_lu;
/** \name locks
 * \todo XXX move locks below to the separate cache-lines, they are
@@ -464,7 +467,8 @@ struct cl_object_header {
 #define CL_PAGE_EOF ((pgoff_t)~0ull)
 
 /** \addtogroup cl_page cl_page
- * @{ */
+ * @{
+ */
 
 /** \struct cl_page
  * Layered client page.
@@ -687,12 +691,14 @@ enum cl_page_state {
 
 enum cl_page_type {
/** Host page, the page is from the host inode which the cl_page
-* belongs to. */
+* belongs to.
+*/
CPT_CACHEABLE = 1,
 
/** Transient page, the transient cl_page is used to bind a cl_page
 *  to vmpage which is not belonging to the same object of cl_page.
-*  it is used in DirectIO, lockless IO and liblustre. */
+*  it is used in DirectIO, lockless IO and liblustre.
+*/
CPT_TRANSIENT,
 };
 
@@ -728,7 +734,8 @@ struct cl_page {
/** Parent page, NULL for top-level page. Immutable after creation. */
struct cl_page*cp_parent;
/** Lower-layer page. NULL for bottommost page. Immutable after
-* creation. */
+* creation.
+*/
struct cl_page*cp_child;
/**
 * Page state. This field is const to avoid accidental update, it is
@@ -1126,7 +1133,8 @@ static inline int __page_in_use(const struct cl_page 
*page, int refc)
 /** @} cl_page */
 
 /** \addtogroup cl_lock cl_lock
- * @{ */
+ * @{
+ */
 /** \struct cl_lock
  *
  * Extent locking on the client.
@@ -1641,7 +1649,8 @@ struct cl_lock {
 struct cl_lock_slice {
struct cl_lock*cls_lock;
/** Object slice corresponding to this lock slice. Immutable after
-* creation. */
+* creation.
+*/
struct cl_object*cls_obj;
const struct cl_lock_operations *cls_ops;
/** Linkag

[PATCH 14/56] staging/lustre: Get rid of sec_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace with enum sec_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index bb82a87..d68748b 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3436,13 +3436,13 @@ union lu_page {
 };
 
 /* security opcodes */
-typedef enum {
+enum sec_cmd {
SEC_CTX_INIT= 801,
SEC_CTX_INIT_CONT   = 802,
SEC_CTX_FINI= 803,
SEC_LAST_OPC,
SEC_FIRST_OPC  = SEC_CTX_INIT
-} sec_cmd_t;
+};
 
 /*
  * capa related definitions
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 29/56] staging/lustre: Remove *_CONNECT_SUPPORTED defines

2016-02-22 Thread green
From: Oleg Drokin 

These defines are only used on the servers to determine
what connect flags corresponding servers support:
MDT_CONNECT_SUPPORTED
OST_CONNECT_SUPPORTED
MGS_CONNECT_SUPPORTED
ECHO_CONNECT_SUPPORTED

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 50 ++
 1 file changed, 4 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index eeb0542..26f1c43 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1248,61 +1248,19 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
  * submit a small patch against EVERY branch that ONLY adds the new flag,
  * updates obd_connect_names[] for lprocfs_rd_connect_flags(), adds the
  * flag to check_obd_connect_data(), and updates wiretests accordingly, so it
- * can be approved and landed easily to reserve the flag for future use. */
+ * can be approved and landed easily to reserve the flag for future use.
+ */
 
 /* The MNE_SWAB flag is overloading the MDS_MDS bit only for the MGS
  * connection.  It is a temporary bug fix for Imperative Recovery interop
  * between 2.2 and 2.3 x86/ppc nodes, and can be removed when interop for
- * 2.2 clients/servers is no longer needed.  LU-1252/LU-1644. */
+ * 2.2 clients/servers is no longer needed.  LU-1252/LU-1644.
+ */
 #define OBD_CONNECT_MNE_SWABOBD_CONNECT_MDS_MDS
 
 #define OCD_HAS_FLAG(ocd, flg)  \
(!!((ocd)->ocd_connect_flags & OBD_CONNECT_##flg))
 
-#define LRU_RESIZE_CONNECT_FLAG OBD_CONNECT_LRU_RESIZE
-
-#define MDT_CONNECT_SUPPORTED  (OBD_CONNECT_RDONLY | OBD_CONNECT_VERSION | \
-   OBD_CONNECT_ACL | OBD_CONNECT_XATTR | \
-   OBD_CONNECT_IBITS | \
-   OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID | \
-   OBD_CONNECT_CANCELSET | OBD_CONNECT_AT | \
-   OBD_CONNECT_RMT_CLIENT | \
-   OBD_CONNECT_RMT_CLIENT_FORCE | \
-   OBD_CONNECT_BRW_SIZE | OBD_CONNECT_MDS_CAPA | \
-   OBD_CONNECT_OSS_CAPA | OBD_CONNECT_MDS_MDS | \
-   OBD_CONNECT_FID | LRU_RESIZE_CONNECT_FLAG | \
-   OBD_CONNECT_VBR | OBD_CONNECT_LOV_V3 | \
-   OBD_CONNECT_SOM | OBD_CONNECT_FULL20 | \
-   OBD_CONNECT_64BITHASH | OBD_CONNECT_JOBSTATS | \
-   OBD_CONNECT_EINPROGRESS | \
-   OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_UMASK | \
-   OBD_CONNECT_LVB_TYPE | OBD_CONNECT_LAYOUTLOCK |\
-   OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE |\
-   OBD_CONNECT_FLOCK_DEAD | \
-   OBD_CONNECT_DISP_STRIPE)
-
-#define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
-   OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
-   OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
-   OBD_CONNECT_BRW_SIZE | OBD_CONNECT_OSS_CAPA | \
-   OBD_CONNECT_CANCELSET | OBD_CONNECT_AT | \
-   LRU_RESIZE_CONNECT_FLAG | OBD_CONNECT_CKSUM | \
-   OBD_CONNECT_RMT_CLIENT | \
-   OBD_CONNECT_RMT_CLIENT_FORCE | OBD_CONNECT_VBR 
| \
-   OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN | \
-   OBD_CONNECT_GRANT_SHRINK | OBD_CONNECT_FULL20 | 
\
-   OBD_CONNECT_64BITHASH | OBD_CONNECT_MAXBYTES | \
-   OBD_CONNECT_MAX_EASIZE | \
-   OBD_CONNECT_EINPROGRESS | \
-   OBD_CONNECT_JOBSTATS | \
-   OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_LVB_TYPE|\
-   OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_FID | \
-   OBD_CONNECT_PINGLESS)
-#define ECHO_CONNECT_SUPPORTED (0)
-#define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
-   OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV | \
-   OBD_CONNECT_MNE_SWAB | OBD_CONNECT_PINGLESS)
-
 /* Features required for this version of the client to work with server */
 #define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \
 OBD_CONNECT_FULL20)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 30/56] staging/lustre: Remove duplicated quota defines

2016-02-22 Thread green
From: Oleg Drokin 

QUOTABLOCK_BITS, QUOTABLOCK_SIZE and toqb are only used on the server
and are copied from kernel code anyway.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 12 
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c   |  5 -
 2 files changed, 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 26f1c43..ccb1b85 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1778,18 +1778,6 @@ void lustre_swab_ost_lvb(struct ost_lvb *lvb);
  *   lquota data structures
  */
 
-#ifndef QUOTABLOCK_BITS
-#define QUOTABLOCK_BITS 10
-#endif
-
-#ifndef QUOTABLOCK_SIZE
-#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
-#endif
-
-#ifndef toqb
-#define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
-#endif
-
 /* The lquota_id structure is an union of all the possible identifier types 
that
  * can be used with quota, this includes:
  * - 64-bit user ID
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c 
b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index 3f9acc2..799a85ac 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -1507,11 +1507,6 @@ void lustre_assert_wire_constants(void)
LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n",
 (long long)(int)sizeof(union lquota_id));
 
-   LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n",
-(long long)QUOTABLOCK_BITS);
-   LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n",
-(long long)QUOTABLOCK_SIZE);
-
/* Checks for struct obd_quotactl */
LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n",
 (long long)(int)sizeof(struct obd_quotactl));
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 45/56] staging/lustre/lclient: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lclient/glimpse.c|  3 ++-
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 24 ++
 .../staging/lustre/lustre/lclient/lcommon_misc.c   |  6 --
 3 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/glimpse.c 
b/drivers/staging/lustre/lustre/lclient/glimpse.c
index 8533a1e..c4e8a08 100644
--- a/drivers/staging/lustre/lustre/lclient/glimpse.c
+++ b/drivers/staging/lustre/lustre/lclient/glimpse.c
@@ -109,7 +109,8 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io 
*io,
 *   if there were no conflicting locks. If there
 *   were conflicting locks, enqueuing or waiting
 *   fails with -ENAVAIL, but valid inode
-*   attributes are returned anyway. */
+*   attributes are returned anyway.
+*/
*descr = whole_file;
descr->cld_obj   = clob;
descr->cld_mode  = CLM_PHANTOM;
diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index efa6e2e..30651f2 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -613,7 +613,8 @@ void ccc_lock_state(const struct lu_env *env,
 * stale i_size when doing appending writes and effectively
 * cancel the result of the truncate.  Getting the
 * ll_inode_size_lock() after the enqueue maintains the DLM
-* -> ll_inode_size_lock() acquiring order. */
+* -> ll_inode_size_lock() acquiring order.
+*/
if (lock->cll_descr.cld_start == 0 &&
lock->cll_descr.cld_end == CL_PAGE_EOF)
cl_merge_lvb(env, inode);
@@ -754,7 +755,8 @@ int ccc_prep_size(const struct lu_env *env, struct 
cl_object *obj,
 * page index, return directly. Do not expect
 * kernel will check such case correctly.
 * linux-2.6.18-128.1.1 miss to do that.
-* --bug 17336 */
+* --bug 17336
+*/
loff_t size = cl_isize_read(inode);
loff_t cur_index = start >> PAGE_CACHE_SHIFT;
loff_t size_index = (size - 1) >>
@@ -884,7 +886,8 @@ again:
 
if (attr->ia_valid & ATTR_FILE)
/* populate the file descriptor for ftruncate to honor
-* group lock - see LU-787 */
+* group lock - see LU-787
+*/
cio->cui_fd = cl_iattr2fd(inode, attr);
 
result = cl_io_loop(env, io);
@@ -896,7 +899,8 @@ again:
goto again;
/* HSM import case: file is released, cannot be restored
 * no need to fail except if restore registration failed
-* with -ENODATA */
+* with -ENODATA
+*/
if (result == -ENODATA && io->ci_restore_needed &&
io->ci_result != -ENODATA)
result = 0;
@@ -1026,7 +1030,8 @@ int cl_file_inode_init(struct inode *inode, struct 
lustre_md *md)
/* clob is slave of inode, empty lli_clob means for new inode,
 * there is no clob in cache with the given fid, so it is
 * unnecessary to perform lookup-alloc-lookup-insert, just
-* alloc and insert directly. */
+* alloc and insert directly.
+*/
LASSERT(inode->i_state & I_NEW);
conf.coc_lu.loc_flags = LOC_F_NEW;
clob = cl_object_find(env, lu2cl_dev(site->ls_top_dev),
@@ -1151,7 +1156,8 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
 }
 
 /**
- * build inode number from passed @fid */
+ * build inode number from passed @fid
+ */
 __u64 cl_fid_build_ino(const struct lu_fid *fid, int api32)
 {
if (BITS_PER_LONG == 32 || api32)
@@ -1162,7 +1168,8 @@ __u64 cl_fid_build_ino(const struct lu_fid *fid, int 
api32)
 
 /**
  * build inode generation from passed @fid.  If our FID overflows the 32-bit
- * inode number then return a non-zero generation to distinguish them. */
+ * inode number then return a non-zero generation to distinguish them.
+ */
 __u32 cl_fid_build_gen(const struct lu_fid *fid)
 {
__u32 gen;
@@ -1183,7 +1190,8 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
  * have to wait for the refcount to become zero to destroy the older layout.
  *
  * Not

[PATCH 26/56] staging/lustre: Remove server-side changelog defines

2016-02-22 Thread green
From: Oleg Drokin 

CHANGELOG_MAGIC, CHANGELOG_MINMASK, CHANGELOG_ALLMASK,
CHANGELOG_DEFMASK and CHANGELOG_USER_PREFIX are all unused
on the client.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 90ff181..d2f05e3 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3039,15 +3039,6 @@ struct llog_size_change_rec {
struct llog_rec_taillsc_tail;
 } __packed;
 
-#define CHANGELOG_MAGIC 0xca103000
-
-/** \a changelog_rec_type's that can't be masked */
-#define CHANGELOG_MINMASK (1 << CL_MARK)
-/** bits covering all \a changelog_rec_type's */
-#define CHANGELOG_ALLMASK 0X
-/** default \a changelog_rec_type mask */
-#define CHANGELOG_DEFMASK CHANGELOG_ALLMASK & ~(1 << CL_ATIME | 1 << CL_CLOSE)
-
 /* changelog llog name, needed by client replicators */
 #define CHANGELOG_CATALOG "changelog_catalog"
 
@@ -3069,8 +3060,6 @@ struct llog_changelog_ext_rec {
struct llog_rec_tail cr_tail; /**< for_sizezof_only */
 } __packed;
 
-#define CHANGELOG_USER_PREFIX "cl"
-
 struct llog_changelog_user_rec {
struct llog_rec_hdr   cur_hdr;
__u32cur_id;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 25/56] staging/lustre: Get rid of C99 comments in lustre_idl.h

2016-02-22 Thread green
From: Oleg Drokin 

lustre_idl.h contains various protocol data. In order to avoid
reusal of values that might have meant something else in the past,
the old no longer used values are commented out, convert the
comments into regular comments from C99 where appropriate.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h| 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 4188402..90ff181 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -113,25 +113,25 @@
 
 #define CONNMGR_REQUEST_PORTAL   1
 #define CONNMGR_REPLY_PORTAL   2
-//#define OSC_REQUEST_PORTAL   3
+/*#define OSC_REQUEST_PORTAL   3 */
 #define OSC_REPLY_PORTAL   4
-//#define OSC_BULK_PORTAL 5
+/*#define OSC_BULK_PORTAL 5 */
 #define OST_IO_PORTAL 6
 #define OST_CREATE_PORTAL 7
 #define OST_BULK_PORTAL 8
-//#define MDC_REQUEST_PORTAL   9
+/*#define MDC_REQUEST_PORTAL   9 */
 #define MDC_REPLY_PORTAL  10
-//#define MDC_BULK_PORTAL11
+/*#define MDC_BULK_PORTAL11 */
 #define MDS_REQUEST_PORTAL  12
-//#define MDS_REPLY_PORTAL  13
+/*#define MDS_REPLY_PORTAL  13 */
 #define MDS_BULK_PORTAL14
 #define LDLM_CB_REQUEST_PORTAL  15
 #define LDLM_CB_REPLY_PORTAL  16
 #define LDLM_CANCEL_REQUEST_PORTAL 17
 #define LDLM_CANCEL_REPLY_PORTAL   18
-//#define PTLBD_REQUEST_PORTAL19
-//#define PTLBD_REPLY_PORTAL20
-//#define PTLBD_BULK_PORTAL  21
+/*#define PTLBD_REQUEST_PORTAL19 */
+/*#define PTLBD_REPLY_PORTAL20 */
+/*#define PTLBD_BULK_PORTAL  21 */
 #define MDS_SETATTR_PORTAL  22
 #define MDS_READPAGE_PORTAL23
 #define OUT_PORTAL 24
@@ -1187,7 +1187,7 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
 #define MSG_CONNECT_RECOVERING  0x0001
 #define MSG_CONNECT_RECONNECT   0x0002
 #define MSG_CONNECT_REPLAYABLE  0x0004
-//#define MSG_CONNECT_PEER 0x8
+/*#define MSG_CONNECT_PEER 0x8 */
 #define MSG_CONNECT_LIBCLIENT   0x0010
 #define MSG_CONNECT_INITIAL 0x0020
 #define MSG_CONNECT_ASYNC   0x0040
@@ -2066,7 +2066,7 @@ enum mdt_reint_cmd {
REINT_OPEN = 6,
REINT_SETXATTR = 7,
REINT_RMENTRY  = 8,
-//  REINT_WRITE= 9,
+/*  REINT_WRITE= 9, */
REINT_MAX
 };
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 47/56] staging/lustre/llite: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dcache.c   |  18 ++-
 drivers/staging/lustre/lustre/llite/dir.c  |  29 ++--
 drivers/staging/lustre/lustre/llite/file.c | 161 +
 drivers/staging/lustre/lustre/llite/llite_close.c  |  18 ++-
 .../staging/lustre/lustre/llite/llite_internal.h   | 109 --
 drivers/staging/lustre/lustre/llite/llite_lib.c|  86 +++
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  20 ++-
 drivers/staging/lustre/lustre/llite/llite_nfs.c|   6 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |   3 +-
 drivers/staging/lustre/lustre/llite/namei.c|  41 --
 drivers/staging/lustre/lustre/llite/rw.c   |  70 ++---
 drivers/staging/lustre/lustre/llite/rw26.c |  21 ++-
 drivers/staging/lustre/lustre/llite/statahead.c|  36 +++--
 drivers/staging/lustre/lustre/llite/super25.c  |   6 +-
 drivers/staging/lustre/lustre/llite/symlink.c  |   3 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c   |  42 --
 drivers/staging/lustre/lustre/llite/vvp_object.c   |   3 +-
 drivers/staging/lustre/lustre/llite/vvp_page.c |   9 +-
 drivers/staging/lustre/lustre/llite/xattr.c|  15 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |   6 +-
 20 files changed, 451 insertions(+), 251 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index 34eb17c..0bc0fb9f 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -80,7 +80,8 @@ static void ll_release(struct dentry *de)
  * This avoids a race where ll_lookup_it() instantiates a dentry, but we get
  * an AST before calling d_revalidate_it().  The dentry still exists (marked
  * INVALID) so d_lookup() matches it, but we have no lock on it (so
- * lock_match() fails) and we spin around real_lookup(). */
+ * lock_match() fails) and we spin around real_lookup().
+ */
 static int ll_dcompare(const struct dentry *parent, const struct dentry 
*dentry,
   unsigned int len, const char *str,
   const struct qstr *name)
@@ -117,7 +118,8 @@ static inline int return_if_equal(struct ldlm_lock *lock, 
void *data)
 /* find any ldlm lock of the inode in mdc and lov
  * return 0not find
  * 1find one
- *  < 0error */
+ *  < 0error
+ */
 static int find_cbdata(struct inode *inode)
 {
struct ll_sb_info *sbi = ll_i2sbi(inode);
@@ -163,10 +165,12 @@ static int ll_ddelete(const struct dentry *de)
/* Disable this piece of code temporarily because this is called
 * inside dcache_lock so it's not appropriate to do lots of work
 * here. ATTENTION: Before this piece of code enabling, LU-2487 must be
-* resolved. */
+* resolved.
+*/
 #if 0
/* if not ldlm lock for this inode, set i_nlink to 0 so that
-* this inode can be recycled later b=20433 */
+* this inode can be recycled later b=20433
+*/
if (d_really_is_positive(de) && !find_cbdata(d_inode(de)))
clear_nlink(d_inode(de));
 #endif
@@ -216,7 +220,8 @@ void ll_intent_drop_lock(struct lookup_intent *it)
ldlm_lock_decref(&handle, it->d.lustre.it_lock_mode);
 
/* bug 494: intent_release may be called multiple times, from
-* this thread and we don't want to double-decref this lock */
+* this thread and we don't want to double-decref this lock
+*/
it->d.lustre.it_lock_mode = 0;
if (it->d.lustre.it_remote_lock_mode != 0) {
handle.cookie = it->d.lustre.it_remote_lock_handle;
@@ -294,7 +299,8 @@ void ll_lookup_finish_locks(struct lookup_intent *it, 
struct inode *inode)
if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) {
/* on 2.6 there are situation when several lookups and
 * revalidations may be requested during single operation.
-* therefore, we don't release intent here -bzzz */
+* therefore, we don't release intent here -bzzz
+*/
ll_intent_drop_lock(it);
}
 }
diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index c2ee7fc..bd88a3b 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -379,7 +379,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
 &it.d.lustre.it_lock_handle, dir, NULL);
} else {
/* for cross-ref object, l_ast_data of the lock may not be set,
-* we reset it here */
+* we reset it here
+*/
   

[PATCH 37/56] staging/lustre: Remove last_rcvd-file related data

2016-02-22 Thread green
From: Oleg Drokin 

last_rcvd (last received) is a special server-side file on the
Lustre FS that stores information about server filesystem and
also list of connected clients and their state. There's no
point in having any of tha ton the client, though.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_disk.h| 225 -
 1 file changed, 225 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h 
b/drivers/staging/lustre/lustre/include/lustre_disk.h
index 7c6933f..b69bd9d 100644
--- a/drivers/staging/lustre/lustre/include/lustre_disk.h
+++ b/drivers/staging/lustre/lustre/include/lustre_disk.h
@@ -116,231 +116,6 @@ struct lustre_mount_data {
 #define LR_EXPIRE_INTERVALS 16 /**< number of intervals to track transno */
 #define ENOENT_VERSION 1 /** 'virtual' version of non-existent object */
 
-#define LR_SERVER_SIZE   512
-#define LR_CLIENT_START 8192
-#define LR_CLIENT_SIZE   128
-#if LR_CLIENT_START < LR_SERVER_SIZE
-#error "Can't have LR_CLIENT_START < LR_SERVER_SIZE"
-#endif
-
-/*
- * This limit is arbitrary (131072 clients on x86), but it is convenient to use
- * 2^n * PAGE_CACHE_SIZE * 8 for the number of bits that fit an order-n 
allocation.
- * If we need more than 131072 clients (order-2 allocation on x86) then this
- * should become an array of single-page pointers that are allocated on demand.
- */
-#if (128 * 1024UL) > (PAGE_CACHE_SIZE * 8)
-#define LR_MAX_CLIENTS (128 * 1024UL)
-#else
-#define LR_MAX_CLIENTS (PAGE_CACHE_SIZE * 8)
-#endif
-
-/** COMPAT_146: this is an OST (temporary) */
-#define OBD_COMPAT_OST   0x0002
-/** COMPAT_146: this is an MDT (temporary) */
-#define OBD_COMPAT_MDT   0x0004
-/** 2.0 server, interop flag to show server version is changed */
-#define OBD_COMPAT_20 0x0008
-
-/** MDS handles LOV_OBJID file */
-#define OBD_ROCOMPAT_LOVOBJID   0x0001
-
-/** OST handles group subdirs */
-#define OBD_INCOMPAT_GROUPS 0x0001
-/** this is an OST */
-#define OBD_INCOMPAT_OST   0x0002
-/** this is an MDT */
-#define OBD_INCOMPAT_MDT   0x0004
-/** common last_rvcd format */
-#define OBD_INCOMPAT_COMMON_LR  0x0008
-/** FID is enabled */
-#define OBD_INCOMPAT_FID   0x0010
-/** Size-on-MDS is enabled */
-#define OBD_INCOMPAT_SOM   0x0020
-/** filesystem using iam format to store directory entries */
-#define OBD_INCOMPAT_IAM_DIR0x0040
-/** LMA attribute contains per-inode incompatible flags */
-#define OBD_INCOMPAT_LMA   0x0080
-/** lmm_stripe_count has been shrunk from __u32 to __u16 and the remaining 16
- * bits are now used to store a generation. Once we start changing the layout
- * and bumping the generation, old versions expecting a 32-bit lmm_stripe_count
- * will be confused by interpreting stripe_count | gen << 16 as the actual
- * stripe count */
-#define OBD_INCOMPAT_LMM_VER0x0100
-/** multiple OI files for MDT */
-#define OBD_INCOMPAT_MULTI_OI   0x0200
-
-/* Data stored per server at the head of the last_rcvd file.  In le32 order.
-   This should be common to filter_internal.h, lustre_mds.h */
-struct lr_server_data {
-   __u8  lsd_uuid[40]; /* server UUID */
-   __u64 lsd_last_transno;/* last completed transaction ID */
-   __u64 lsd_compat14; /* reserved - compat with old last_rcvd */
-   __u64 lsd_mount_count; /* incarnation number */
-   __u32 lsd_feature_compat;  /* compatible feature flags */
-   __u32 lsd_feature_rocompat;/* read-only compatible feature flags */
-   __u32 lsd_feature_incompat;/* incompatible feature flags */
-   __u32 lsd_server_size; /* size of server data area */
-   __u32 lsd_client_start;/* start of per-client data area */
-   __u16 lsd_client_size; /* size of per-client data area */
-   __u16 lsd_subdir_count;/* number of subdirectories for objects */
-   __u64 lsd_catalog_oid; /* recovery catalog object id */
-   __u32 lsd_catalog_ogen;/* recovery catalog inode generation */
-   __u8  lsd_peeruuid[40];/* UUID of MDS associated with this OST */
-   __u32 lsd_osd_index;   /* index number of OST in LOV */
-   __u32 lsd_padding1; /* was lsd_mdt_index, unused in 2.4.0 */
-   __u32 lsd_start_epoch; /* VBR: start epoch from last boot */
-   /** transaction values since lsd_trans_table_time */
-   __u64 lsd_trans_table[LR_EXPIRE_INTERVALS];
-   /** start point of transno table below */
-   __u32 lsd_trans_table_time; /* time of first slot in table above */
-   __u32 lsd_expire_intervals; /* LR_EXPIRE_INTERVALS */
-   __u8  lsd_padding[LR_SERVER_SIZE - 288];
-};
-
-/* Data stored per client in the last_rcvd file.  In le32 order. */
-struct lsd_client_data {
-   __u8  lcd_uuid[40];  /* client UUID */
-   __u64 lcd_last_transno; /* last completed transaction ID */
-   __u64 lcd_last_xid; /* xid for the last transaction */
-   __u32 

[PATCH 49/56] staging/lustre/lov: Adjust comments to better conform to coding style

2016-02-22 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lov/lov_ea.c   |  3 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h |  6 +-
 drivers/staging/lustre/lustre/lov/lov_lock.c | 32 ++
 drivers/staging/lustre/lustre/lov/lov_obd.c  | 78 
 drivers/staging/lustre/lustre/lov/lov_object.c   | 24 +---
 drivers/staging/lustre/lustre/lov/lov_offset.c   | 12 ++--
 drivers/staging/lustre/lustre/lov/lov_pack.c | 12 ++--
 drivers/staging/lustre/lustre/lov/lov_pool.c | 12 ++--
 drivers/staging/lustre/lustre/lov/lov_request.c  | 18 --
 drivers/staging/lustre/lustre/lov/lovsub_lock.c  |  6 +-
 10 files changed, 134 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c 
b/drivers/staging/lustre/lustre/lov/lov_ea.c
index 6c8381a..c27b884 100644
--- a/drivers/staging/lustre/lustre/lov/lov_ea.c
+++ b/drivers/staging/lustre/lustre/lov/lov_ea.c
@@ -162,7 +162,8 @@ static int lsm_destroy_plain(struct lov_stripe_md *lsm, 
struct obdo *oa,
 }
 
 /* Find minimum stripe maxbytes value.  For inactive or
- * reconnecting targets use LUSTRE_STRIPE_MAXBYTES. */
+ * reconnecting targets use LUSTRE_STRIPE_MAXBYTES.
+ */
 static void lov_tgt_maxbytes(struct lov_tgt_desc *tgt, __u64 *stripe_maxbytes)
 {
struct obd_import *imp = tgt->ltd_obd->u.cli.cl_import;
diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h 
b/drivers/staging/lustre/lustre/lov/lov_internal.h
index d4522ba..725ebf9 100644
--- a/drivers/staging/lustre/lustre/lov/lov_internal.h
+++ b/drivers/staging/lustre/lustre/lov/lov_internal.h
@@ -43,7 +43,8 @@
 /* lov_do_div64(a, b) returns a % b, and a = a / b.
  * The 32-bit code is LOV-specific due to knowing about stripe limits in
  * order to reduce the divisor to a 32-bit number.  If the divisor is
- * already a 32-bit value the compiler handles this directly. */
+ * already a 32-bit value the compiler handles this directly.
+ */
 #if BITS_PER_LONG == 64
 # define lov_do_div64(n, base) ({  \
uint64_t __base = (base);   \
@@ -92,7 +93,8 @@ struct lov_request_set {
atomic_tset_refcount;
struct obd_export   *set_exp;
/* XXX: There is @set_exp already, however obd_statfs gets obd_device
-  only. */
+* only.
+*/
struct obd_device   *set_obd;
int set_count;
atomic_tset_completes;
diff --git a/drivers/staging/lustre/lustre/lov/lov_lock.c 
b/drivers/staging/lustre/lustre/lov/lov_lock.c
index e6b0437..e0a6438 100644
--- a/drivers/staging/lustre/lustre/lov/lov_lock.c
+++ b/drivers/staging/lustre/lustre/lov/lov_lock.c
@@ -160,7 +160,8 @@ static struct cl_lock *lov_sublock_alloc(const struct 
lu_env *env,
 * to remember the subio. This is because lock is able
 * to be cached, but this is not true for IO. This
 * further means a sublock might be referenced in
-* different io context. -jay */
+* different io context. -jay
+*/
 
sublock = cl_lock_hold(subenv->lse_env, subenv->lse_io,
   descr, "lov-parent", parent);
@@ -477,7 +478,8 @@ static int lov_lock_enqueue_one(const struct lu_env *env, 
struct lov_lock *lck,
result = cl_enqueue_try(env, sublock, io, enqflags);
if ((sublock->cll_state == CLS_ENQUEUED) && !(enqflags & CEF_AGL)) {
/* if it is enqueued, try to `wait' on it---maybe it's already
-* granted */
+* granted
+*/
result = cl_wait_try(env, sublock);
if (result == CLO_REENQUEUED)
result = CLO_WAIT;
@@ -518,7 +520,8 @@ static int lov_sublock_fill(const struct lu_env *env, 
struct cl_lock *parent,
} else {
kmem_cache_free(lov_lock_link_kmem, link);
/* other thread allocated sub-lock, or enqueue is no
-* longer going on */
+* longer going on
+*/
cl_lock_mutex_put(env, parent);
cl_lock_unhold(env, sublock, "lov-parent", parent);
cl_lock_mutex_get(env, parent);
@@ -575,7 +578,8 @@ static int lov_lock_enqueue(const struct lu_env *env,
if (!sub) {
result = lov_sublock_fill(env, lock, io, lck, i);
/* lov_sublock_fill() released @lock mutex,
-* restart. */
+* restart.
+*/
  

[PATCH 19/56] staging/lustre: Get rid of ldlm_error_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_error

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 8 
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 87806a6..924e68f 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -69,7 +69,7 @@ struct obd_device;
 /**
  * LDLM non-error return states
  */
-typedef enum {
+enum ldlm_error {
ELDLM_OK = 0,
 
ELDLM_LOCK_CHANGED = 300,
@@ -80,7 +80,7 @@ typedef enum {
 
ELDLM_NAMESPACE_EXISTS = 400,
ELDLM_BAD_NAMESPACE= 401
-} ldlm_error_t;
+};
 
 /**
  * LDLM namespace type.
@@ -1019,7 +1019,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 } while (0)
 
 typedef int (*ldlm_processing_policy)(struct ldlm_lock *lock, __u64 *flags,
- int first_enq, ldlm_error_t *err,
+ int first_enq, enum ldlm_error *err,
  struct list_head *work_list);
 
 /**
@@ -1105,7 +1105,7 @@ static inline int ldlm_res_lvbo_update(struct 
ldlm_resource *res,
return 0;
 }
 
-int ldlm_error2errno(ldlm_error_t error);
+int ldlm_error2errno(enum ldlm_error error);
 
 #if LUSTRE_TRACKS_LOCK_EXP_REFS
 void ldlm_dump_export_locks(struct obd_export *exp);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index 699e81d..8bd6a18 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -133,7 +133,7 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode 
mode, __u64 flags)
  * would be collected and ASTs sent.
  */
 static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
-  int first_enq, ldlm_error_t *err,
+  int first_enq, enum ldlm_error *err,
   struct list_head *work_list)
 {
struct ldlm_resource *res = req->l_resource;
@@ -449,7 +449,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 
flags, void *data)
struct obd_import *imp = NULL;
struct ldlm_flock_wait_data fwd;
struct l_wait_infolwi;
-   ldlm_error_terr;
+   enum ldlm_error err;
int  rc = 0;
 
CDEBUG(D_DLMTRACE, "flags: 0x%llx data: %p getlk: %p\n",
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h 
b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index 6d4f324..ed27822 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -136,8 +136,8 @@ ldlm_lock_create(struct ldlm_namespace *ns, const struct 
ldlm_res_id *,
 enum ldlm_type type, enum ldlm_mode mode,
 const struct ldlm_callback_suite *cbs,
 void *data, __u32 lvb_len, enum lvb_type lvb_type);
-ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
-  void *cookie, __u64 *flags);
+enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
+ void *cookie, __u64 *flags);
 void ldlm_lock_addref_internal(struct ldlm_lock *, __u32 mode);
 void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, __u32 mode);
 void ldlm_lock_decref_internal(struct ldlm_lock *, __u32 mode);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index 68bf57b..c22370b 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -733,7 +733,7 @@ enum ldlm_mode lck_compat_array[] = {
  * Rather arbitrary mapping from LDLM error codes to errno values. This should
  * not escape to the user level.
  */
-int ldlm_error2errno(ldlm_error_t error)
+int ldlm_error2errno(enum ldlm_error error)
 {
int result;
 
@@ -761,7 +761,7 @@ int ldlm_error2errno(ldlm_error_t error)
break;
default:
if (((int)error) < 0)  /* cast to signed type */
-   result = error; /* as ldlm_error_t can be unsigned */
+   result = error; /* as enum ldlm_error can be unsigned */
else {
CERROR("Invalid DLM result code: %d\n", error);
result = -EPROTO;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_loc

[PATCH 27/56] staging/lustre: Remove FSF mailing address from GPL notices

2016-02-22 Thread green
From: Oleg Drokin 

This patch removes remaining several places that still had that
extra paragraph included in Lustre code.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h  | 5 -
 drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h | 5 -
 drivers/staging/lustre/lnet/lnet/lib-ptl.c| 5 -
 drivers/staging/lustre/lustre/obdecho/echo_internal.h | 5 -
 drivers/staging/lustre/lustre/osc/osc_quota.c | 5 -
 5 files changed, 25 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
index 1530b04..9e62c59 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
index 520209f..c04979a 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c 
b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 5a9ab87..0281c6a 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_internal.h 
b/drivers/staging/lustre/lustre/obdecho/echo_internal.h
index 69063fa..f5034a2 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_internal.h
+++ b/drivers/staging/lustre/lustre/obdecho/echo_internal.h
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c 
b/drivers/staging/lustre/lustre/osc/osc_quota.c
index d6731c5..508fcf2 100644
--- a/drivers/staging/lustre/lustre/osc/osc_quota.c
+++ b/drivers/staging/lustre/lustre/osc/osc_quota.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/56] staging/lustre: Get rid of object update code

2016-02-22 Thread green
From: Oleg Drokin 

Object update was originally planned to be used for cross-server
updates, so nothing to do with the client. The idea was
later significantly reworked anyway so even wire structs should
not be retained.

This gets rid of update_cmd_t, UPDATE and UPDATE_REPLY rpc and
corresponding subcommands, swabbing logic and such.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lprocfs_status.h | 16 +---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 94 --
 .../lustre/lustre/include/lustre_req_layout.h  |  4 -
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 25 --
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c|  1 -
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 18 -
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 84 ---
 7 files changed, 1 insertion(+), 241 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 88f754e..54e5aee 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -284,19 +284,6 @@ static inline int opcode_offset(__u32 opc)
OPC_RANGE(LDLM) +
OPC_RANGE(MDS) +
OPC_RANGE(OST));
-   } else if (opc < UPDATE_LAST_OPC) {
-   /* update opcode */
-   return (opc - UPDATE_FIRST_OPC +
-   OPC_RANGE(FLD) +
-   OPC_RANGE(SEC) +
-   OPC_RANGE(SEQ) +
-   OPC_RANGE(QUOTA) +
-   OPC_RANGE(LLOG) +
-   OPC_RANGE(OBD) +
-   OPC_RANGE(MGS) +
-   OPC_RANGE(LDLM) +
-   OPC_RANGE(MDS) +
-   OPC_RANGE(OST));
} else {
/* Unknown Opcode */
return -1;
@@ -312,8 +299,7 @@ static inline int opcode_offset(__u32 opc)
OPC_RANGE(SEC)  + \
OPC_RANGE(SEQ)  + \
OPC_RANGE(SEC)  + \
-   OPC_RANGE(FLD)  + \
-   OPC_RANGE(UPDATE))
+   OPC_RANGE(FLD))
 
 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
OPC_RANGE(EXTRA))
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d68748b..af70ebb 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2053,14 +2053,6 @@ enum mds_cmd {
 
 #define MDS_FIRST_OPCMDS_GETATTR
 
-/* opcodes for object update */
-typedef enum {
-   UPDATE_OBJ  = 1000,
-   UPDATE_LAST_OPC
-} update_cmd_t;
-
-#define UPDATE_FIRST_OPCUPDATE_OBJ
-
 /*
  * Do not exceed 63
  */
@@ -3576,92 +3568,6 @@ void lustre_swab_hsm_user_state(struct hsm_user_state 
*hus);
 void lustre_swab_hsm_user_item(struct hsm_user_item *hui);
 void lustre_swab_hsm_request(struct hsm_request *hr);
 
-/**
- * These are object update opcode under UPDATE_OBJ, which is currently
- * being used by cross-ref operations between MDT.
- *
- * During the cross-ref operation, the Master MDT, which the client send the
- * request to, will disassembly the operation into object updates, then OSP
- * will send these updates to the remote MDT to be executed.
- *
- *   Update request format
- *   magic:  UPDATE_BUFFER_MAGIC_V1
- *   Count:  How many updates in the req.
- *   bufs[0] : following are packets of object.
- *   update[0]:
- * type: object_update_op, the op code of update
- * fid: The object fid of the update.
- * lens/bufs: other parameters of the update.
- *   update[1]:
- * type: object_update_op, the op code of update
- * fid: The object fid of the update.
- * lens/bufs: other parameters of the update.
- *   ..
- *   update[7]:type: object_update_op, the op code of update
- * fid: The object fid of the update.
- * lens/bufs: other parameters of the update.
- *   Current 8 maxim updates per object update request.
- *
- ***
- *   update reply format:
- *
- *   ur_version: UPDATE_REPLY_V1
- *   ur_count:   The count of the reply, which is usually equal
- *  to the number of updates in the request.
- *   ur_lens:The reply lengths of each object update.
- *
- *   replies:1st update reply  [4bytes_ret: other body]
- *  2nd update reply  [4bytes_ret: other body]
- *  .
- *  nth update reply  [4bytes_ret: other body]
- *
- *   For each reply of the update, the format would be
- *  result(4 bytes):Other stuff
- */
-
-#define UPD

[PATCH 17/56] staging/lustre: Get rid of lustre_fid typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with struct lu_fid

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  |  2 +-
 .../lustre/lustre/include/lustre/lustre_user.h | 24 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index af70ebb..4188402 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3550,7 +3550,7 @@ void lustre_swab_layout_intent(struct layout_intent *li);
  */
 struct hsm_progress_kernel {
/* Field taken from struct hsm_progress */
-   lustre_fid  hpk_fid;
+   struct lu_fid   hpk_fid;
__u64   hpk_cookie;
struct hsm_extent   hpk_extent;
__u16   hpk_flags;
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 2b4dd65..a4765c2 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -136,7 +136,7 @@ struct filter_fid_old {
 /* Userspace should treat lu_fid as opaque, and only use the following methods
  * to print or parse them.  Other functions (e.g. compare, swab) could be moved
  * here from lustre_idl.h if needed. */
-typedef struct lu_fid lustre_fid;
+struct lu_fid;
 
 /**
  * Following struct for object attributes, that will be kept inode's EA.
@@ -761,10 +761,10 @@ struct changelog_rec {
__u64cr_prev;  /**< last index for this target fid */
__u64cr_time;
union {
-   lustre_fidcr_tfid;  /**< target fid */
+   struct lu_fidcr_tfid;   /**< target fid */
__u32cr_markerflags; /**< CL_MARK flags */
};
-   lustre_fid  cr_pfid;/**< parent fid */
+   struct lu_fid   cr_pfid;/**< parent fid */
char  cr_name[0]; /**< last element */
 } __packed;
 
@@ -781,12 +781,12 @@ struct changelog_ext_rec {
__u64   cr_prev;  /**< last index for this target fid */
__u64   cr_time;
union {
-   lustre_fid  cr_tfid;/**< target fid */
+   struct lu_fid   cr_tfid;/**< target fid */
__u32   cr_markerflags; /**< CL_MARK flags */
};
-   lustre_fid  cr_pfid;/**< target parent fid */
-   lustre_fid  cr_sfid;/**< source fid, or zero */
-   lustre_fid  cr_spfid;   /**< source parent fid, or zero 
*/
+   struct lu_fid   cr_pfid;/**< target parent fid */
+   struct lu_fid   cr_sfid;/**< source fid, or zero */
+   struct lu_fid   cr_spfid; /**< source parent fid, or zero */
charcr_name[0]; /**< last element */
 } __packed;
 
@@ -976,8 +976,8 @@ struct hsm_request {
 };
 
 struct hsm_user_item {
-   lustre_fid  hui_fid;
-   struct hsm_extent hui_extent;
+   struct lu_fid   hui_fid;
+   struct hsm_extent hui_extent;
 } __packed;
 
 struct hsm_user_request {
@@ -1046,8 +1046,8 @@ static inline char *hsm_copytool_action2name(enum 
hsm_copytool_action  a)
 struct hsm_action_item {
__u32  hai_len; /* valid size of this struct */
__u32  hai_action;  /* hsm_copytool_action, but use known size */
-   lustre_fid hai_fid; /* Lustre FID to operated on */
-   lustre_fid hai_dfid;/* fid used for data access */
+   struct lu_fid hai_fid; /* Lustre FID to operated on */
+   struct lu_fid hai_dfid;/* fid used for data access */
struct hsm_extent hai_extent;  /* byte range to operate on */
__u64  hai_cookie;  /* action cookie from coordinator */
__u64  hai_gid; /* grouplock id */
@@ -1157,7 +1157,7 @@ struct hsm_user_import {
 #define HP_FLAG_RETRY 0x02
 
 struct hsm_progress {
-   lustre_fid  hp_fid;
+   struct lu_fid   hp_fid;
__u64   hp_cookie;
struct hsm_extent   hp_extent;
__u16   hp_flags;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/56] staging/lustre: Get rid of obd_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace with enum obd_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 19a99c5..27ee853 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2918,13 +2918,13 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, 
int swab, int size);
  * Opcodes for multiple servers.
  */
 
-typedef enum {
+enum obd_cmd {
OBD_PING = 400,
OBD_LOG_CANCEL,
OBD_QC_CALLBACK,
OBD_IDX_READ,
OBD_LAST_OPC
-} obd_cmd_t;
+};
 #define OBD_FIRST_OPC OBD_PING
 
 /* catalog of log objects */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/56] staging/lustre: Remove ldlm type/mode typedefs

2016-02-22 Thread green
From: Oleg Drokin 

Replace ldlm_mode_t with enum ldlm_mode,
ldlm_type_t with enum ldlm_type

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 14 
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 39 --
 drivers/staging/lustre/lustre/include/lustre_net.h |  2 +-
 drivers/staging/lustre/lustre/include/obd.h| 10 +++---
 drivers/staging/lustre/lustre/include/obd_class.h  | 14 
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|  4 +--
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 28 
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  7 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  3 +-
 drivers/staging/lustre/lustre/llite/dir.c  |  2 +-
 drivers/staging/lustre/lustre/llite/file.c | 19 ++-
 .../staging/lustre/lustre/llite/llite_internal.h   |  8 ++---
 drivers/staging/lustre/lustre/llite/llite_lib.c|  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 17 ++
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   | 12 +++
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  | 14 
 drivers/staging/lustre/lustre/mdc/mdc_reint.c  |  2 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h|  4 +--
 drivers/staging/lustre/lustre/osc/osc_request.c|  8 ++---
 23 files changed, 114 insertions(+), 103 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 938f91b..d3fb6f9 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2687,7 +2687,7 @@ static inline int ldlm_res_eq(const struct ldlm_res_id 
*res0,
 }
 
 /* lock types */
-typedef enum {
+enum ldlm_mode {
LCK_MINMODE = 0,
LCK_EX  = 1,
LCK_PW  = 2,
@@ -2698,17 +2698,17 @@ typedef enum {
LCK_GROUP   = 64,
LCK_COS = 128,
LCK_MAXMODE
-} ldlm_mode_t;
+};
 
 #define LCK_MODE_NUM8
 
-typedef enum {
+enum ldlm_type {
LDLM_PLAIN = 10,
LDLM_EXTENT= 11,
LDLM_FLOCK = 12,
LDLM_IBITS = 13,
LDLM_MAX_TYPE
-} ldlm_type_t;
+};
 
 #define LDLM_MIN_TYPE LDLM_PLAIN
 
@@ -2768,15 +2768,15 @@ struct ldlm_intent {
 void lustre_swab_ldlm_intent(struct ldlm_intent *i);
 
 struct ldlm_resource_desc {
-   ldlm_type_t lr_type;
+   enum ldlm_type lr_type;
__u32 lr_padding;   /* also fix lustre_swab_ldlm_resource_desc */
struct ldlm_res_id lr_name;
 };
 
 struct ldlm_lock_desc {
struct ldlm_resource_desc l_resource;
-   ldlm_mode_t l_req_mode;
-   ldlm_mode_t l_granted_mode;
+   enum ldlm_mode l_req_mode;
+   enum ldlm_mode l_granted_mode;
ldlm_wire_policy_data_t l_policy_data;
 };
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 51f416d..61b1f98 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -145,14 +145,15 @@ typedef enum {
 #define LCK_COMPAT_COS (LCK_COS)
 /** @} Lock Compatibility Matrix */
 
-extern ldlm_mode_t lck_compat_array[];
+extern enum ldlm_mode lck_compat_array[];
 
-static inline void lockmode_verify(ldlm_mode_t mode)
+static inline void lockmode_verify(enum ldlm_mode mode)
 {
LASSERT(mode > LCK_MINMODE && mode < LCK_MAXMODE);
 }
 
-static inline int lockmode_compat(ldlm_mode_t exist_mode, ldlm_mode_t new_mode)
+static inline int lockmode_compat(enum ldlm_mode exist_mode,
+ enum ldlm_mode new_mode)
 {
return (lck_compat_array[exist_mode] & new_mode);
 }
@@ -524,7 +525,7 @@ struct ldlm_interval {
 struct ldlm_interval_tree {
/** Tree size. */
int lit_size;
-   ldlm_mode_t lit_mode;  /* lock mode */
+   enum ldlm_mode  lit_mode;  /* lock mode */
struct interval_node*lit_root; /* actual ldlm_interval */
 };
 
@@ -556,7 +557,7 @@ typedef union {
struct ldlm_inodebits l_inodebits;
 } ldlm_policy_data_t;
 
-void ldlm_convert_policy_to_local(struct obd_export *exp, ldlm_type_t type,
+void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type,
  const ldlm_wire_policy_data_t *wpolicy,
  ldlm_policy_data_t *lpolicy);
 
@@ -634,11 +635,11 @@ struct ldlm_lock {
 * Requested mode.
 * Protected by lr_lock.
 */
-   ldlm_mode_t l_req_mode;
+   enum ldlm_mode  l_req_mode;
/**
 * Granted mode

[PATCH 21/56] staging/lustre: Get rid of ldlm_ns_type_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_ns_type

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 6 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 0f229b9..ab40bc7 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -318,7 +318,7 @@ enum {
LDLM_NSS_LAST
 };
 
-typedef enum {
+enum ldlm_ns_type {
/** invalid type */
LDLM_NS_TYPE_UNKNOWN= 0,
/** mdc namespace */
@@ -333,7 +333,7 @@ typedef enum {
LDLM_NS_TYPE_MGC,
/** mgs namespace */
LDLM_NS_TYPE_MGT,
-} ldlm_ns_type_t;
+};
 
 /**
  * LDLM Namespace.
@@ -1177,7 +1177,7 @@ void ldlm_unlink_lock_skiplist(struct ldlm_lock *req);
 struct ldlm_namespace *
 ldlm_namespace_new(struct obd_device *obd, char *name,
   ldlm_side_t client, enum ldlm_appetite apt,
-  ldlm_ns_type_t ns_type);
+  enum ldlm_ns_type ns_type);
 int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags);
 void ldlm_namespace_get(struct ldlm_namespace *ns);
 void ldlm_namespace_put(struct ldlm_namespace *ns);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index c22370b..d0ad28d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -241,7 +241,7 @@ int client_obd_setup(struct obd_device *obddev, struct 
lustre_cfg *lcfg)
struct obd_uuid server_uuid;
int rq_portal, rp_portal, connect_op;
char *name = obddev->obd_type->typ_name;
-   ldlm_ns_type_t ns_type = LDLM_NS_TYPE_UNKNOWN;
+   enum ldlm_ns_type ns_type = LDLM_NS_TYPE_UNKNOWN;
int rc;
 
/* In a more perfect world, we would hang a ptlrpc_client off of
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 582cb21..9ab4452 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -554,7 +554,7 @@ static struct cfs_hash_ops ldlm_ns_fid_hash_ops = {
 };
 
 struct ldlm_ns_hash_def {
-   ldlm_ns_type_t  nsd_type;
+   enum ldlm_ns_type nsd_type;
/** hash bucket bits */
unsignednsd_bkt_bits;
/** hash bits */
@@ -622,7 +622,7 @@ static void ldlm_namespace_register(struct ldlm_namespace 
*ns,
 struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
  ldlm_side_t client,
  enum ldlm_appetite apt,
- ldlm_ns_type_t ns_type)
+ enum ldlm_ns_type ns_type)
 {
struct ldlm_namespace *ns = NULL;
struct ldlm_ns_bucket *nsb;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/56] staging/lustre: Get rid of mgs_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum mgs_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d3fb6f9..19a99c5 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2820,7 +2820,7 @@ void lustre_swab_ldlm_reply(struct ldlm_reply *r);
 /*
  * Opcodes for mountconf (mgs and mgc)
  */
-typedef enum {
+enum mgs_cmd {
MGS_CONNECT = 250,
MGS_DISCONNECT,
MGS_EXCEPTION,   /* node died, etc. */
@@ -2829,7 +2829,7 @@ typedef enum {
MGS_SET_INFO,
MGS_CONFIG_READ,
MGS_LAST_OPC
-} mgs_cmd_t;
+};
 #define MGS_FIRST_OPC MGS_CONNECT
 
 #define MGS_PARAM_MAXLEN 1024
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/56] staging/lustre: Get rid of ldlm_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index bd8b622..938f91b 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2659,7 +2659,7 @@ void lustre_swab_lov_desc(struct lov_desc *ld);
  *   LDLM requests:
  */
 /* opcodes -- MUST be distinct from OST/MDS opcodes */
-typedef enum {
+enum ldlm_cmd {
LDLM_ENQUEUE = 101,
LDLM_CONVERT = 102,
LDLM_CANCEL  = 103,
@@ -2668,7 +2668,7 @@ typedef enum {
LDLM_GL_CALLBACK = 106,
LDLM_SET_INFO= 107,
LDLM_LAST_OPC
-} ldlm_cmd_t;
+};
 #define LDLM_FIRST_OPC LDLM_ENQUEUE
 
 #define RES_NAME_SIZE 4
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/56] staging/lustre/ldlm: Remove unused lr_most_restr from struct ldlm_resource

2016-02-22 Thread green
From: Oleg Drokin 

This member comes from the dawn of time and is no longer needed

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 ---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 3 ---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 1 -
 3 files changed, 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 61b1f98..87806a6 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -848,9 +848,6 @@ struct ldlm_resource {
struct list_headlr_waiting;
/** @} */
 
-   /* XXX No longer needed? Remove ASAP */
-   ldlm_mode_t lr_most_restr;
-
/** Type of locks this resource can hold. Only one type per resource. */
enum ldlm_type  lr_type; /* LDLM_{PLAIN,EXTENT,FLOCK,IBITS} */
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index bd5c09f..073dcf8 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1033,9 +1033,6 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct 
list_head *work_list)
else
ldlm_resource_add_lock(res, &res->lr_granted, lock);
 
-   if (lock->l_granted_mode < res->lr_most_restr)
-   res->lr_most_restr = lock->l_granted_mode;
-
if (work_list && lock->l_completion_ast)
ldlm_add_ast_work_item(lock, NULL, work_list);
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 9b65061..f9d0383 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -,7 +,6 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct 
ldlm_resource *parent,
res->lr_ns_bucket  = cfs_hash_bd_extra_get(ns->ns_rs_hash, &bd);
res->lr_name   = *name;
res->lr_type   = type;
-   res->lr_most_restr = LCK_NL;
 
cfs_hash_bd_lock(ns->ns_rs_hash, &bd, 1);
hnode = (version == cfs_hash_bd_version_get(&bd)) ?  NULL :
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/56] staging/lustre: Get rid of llog_op_type typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace with enum llog_op_type

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 27ee853..bb82a87 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2950,7 +2950,7 @@ struct llog_catid {
 #define LLOG_OP_MAGIC 0x1060
 #define LLOG_OP_MASK  0xfff0
 
-typedef enum {
+enum llog_op_type {
LLOG_PAD_MAGIC  = LLOG_OP_MAGIC | 0x0,
OST_SZ_REC  = LLOG_OP_MAGIC | 0x00f00,
/* OST_RAID1_REC= LLOG_OP_MAGIC | 0x01000, never used */
@@ -2970,7 +2970,7 @@ typedef enum {
HSM_AGENT_REC   = LLOG_OP_MAGIC | 0x8,
LLOG_HDR_MAGIC  = LLOG_OP_MAGIC | 0x45539,
LLOG_LOGID_MAGIC= LLOG_OP_MAGIC | 0x4553b,
-} llog_op_type;
+};
 
 #define LLOG_REC_HDR_NEEDS_SWABBING(r) \
(((r)->lrh_type & __swab32(LLOG_OP_MASK)) == __swab32(LLOG_OP_MAGIC))
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/56] staging/lustre: Get rid of ldlm_cancel_flags_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_cancel_flags

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 18 ++
 drivers/staging/lustre/lustre/include/obd.h|  2 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  6 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 10 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 20 +++-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |  2 +-
 9 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index ab40bc7..4ab34dd 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -533,12 +533,12 @@ struct ldlm_interval_tree {
 #define LUSTRE_TRACKS_LOCK_EXP_REFS (0)
 
 /** Cancel flags. */
-typedef enum {
+enum ldlm_cancel_flags {
LCF_ASYNC  = 0x1, /* Cancel locks asynchronously. */
LCF_LOCAL  = 0x2, /* Cancel locks locally, not notifing server */
LCF_BL_AST = 0x4, /* Cancel locks marked as LDLM_FL_BL_AST
   * in the same RPC */
-} ldlm_cancel_flags_t;
+};
 
 struct ldlm_flock {
__u64 start;
@@ -1245,24 +1245,26 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, 
struct ptlrpc_request *req,
  struct lustre_handle *lockh, int rc);
 int ldlm_cli_update_pool(struct ptlrpc_request *req);
 int ldlm_cli_cancel(struct lustre_handle *lockh,
-   ldlm_cancel_flags_t cancel_flags);
+   enum ldlm_cancel_flags cancel_flags);
 int ldlm_cli_cancel_unused(struct ldlm_namespace *, const struct ldlm_res_id *,
-  ldlm_cancel_flags_t flags, void *opaque);
+  enum ldlm_cancel_flags flags, void *opaque);
 int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
const struct ldlm_res_id *res_id,
ldlm_policy_data_t *policy,
enum ldlm_mode mode,
-   ldlm_cancel_flags_t flags,
+   enum ldlm_cancel_flags flags,
void *opaque);
 int ldlm_cancel_resource_local(struct ldlm_resource *res,
   struct list_head *cancels,
   ldlm_policy_data_t *policy,
   enum ldlm_mode mode, __u64 lock_flags,
-  ldlm_cancel_flags_t cancel_flags, void *opaque);
+  enum ldlm_cancel_flags cancel_flags,
+  void *opaque);
 int ldlm_cli_cancel_list_local(struct list_head *cancels, int count,
-  ldlm_cancel_flags_t flags);
+  enum ldlm_cancel_flags flags);
 int ldlm_cli_cancel_list(struct list_head *head, int count,
-struct ptlrpc_request *req, ldlm_cancel_flags_t flags);
+struct ptlrpc_request *req,
+enum ldlm_cancel_flags flags);
 /** @} ldlm_cli_api */
 
 /* mds/handler.c */
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 802d867..1d9207b 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -1167,7 +1167,7 @@ struct md_ops {
 
int (*cancel_unused)(struct obd_export *, const struct lu_fid *,
 ldlm_policy_data_t *, enum ldlm_mode,
-ldlm_cancel_flags_t flags, void *opaque);
+enum ldlm_cancel_flags flags, void *opaque);
 
int (*get_remote_perm)(struct obd_export *, const struct lu_fid *,
   __u32, struct ptlrpc_request **);
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index c161a66..163dd55 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1657,7 +1657,7 @@ static inline int md_cancel_unused(struct obd_export *exp,
   const struct lu_fid *fid,
   ldlm_policy_data_t *policy,
   enum ldlm_mode mode,
-  ldlm_cancel_flags_t flags,
+  enum ldlm_cancel_flags flags,
   void *opaque)
 {
int rc;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h 
b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index e

[PATCH 06/56] staging/lustre: Get rid of quota_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum quota_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 50e70fe..c0b05d4 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2006,11 +2006,11 @@ void lustre_swab_lquota_lvb(struct lquota_lvb *lvb);
 #define lvb_glb_ver  lvb_id_may_rel /* current version of the global index */
 
 /* op codes */
-typedef enum {
+enum quota_cmd {
QUOTA_DQACQ = 601,
QUOTA_DQREL = 602,
QUOTA_LAST_OPC
-} quota_cmd_t;
+};
 #define QUOTA_FIRST_OPCQUOTA_DQACQ
 
 /*
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/56] staging/lustre: Get rid of loc_flags_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with direct reference of enum loc_flags

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lu_object.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index c1c7aa1..23e5567 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -164,11 +164,11 @@ struct lu_device_operations {
 /**
  * For lu_object_conf flags
  */
-typedef enum {
+enum loc_flags {
/* This is a new object to be allocated, or the file
 * corresponding to the object does not exists. */
LOC_F_NEW   = 0x0001,
-} loc_flags_t;
+};
 
 /**
  * Object configuration, describing particulars of object being created. On
@@ -179,7 +179,7 @@ struct lu_object_conf {
/**
 * Some hints for obj find and alloc.
 */
-   loc_flags_t loc_flags;
+   enum loc_flags loc_flags;
 };
 
 /**
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/56] staging/lustre: Get rid of mds_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum mds_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index c0b05d4..a72fed0 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2018,7 +2018,7 @@ enum quota_cmd {
  */
 
 /* opcodes */
-typedef enum {
+enum mds_cmd {
MDS_GETATTR = 33,
MDS_GETATTR_NAME= 34,
MDS_CLOSE   = 35,
@@ -2049,7 +2049,7 @@ typedef enum {
MDS_HSM_CT_UNREGISTER   = 60,
MDS_SWAP_LAYOUTS= 61,
MDS_LAST_OPC
-} mds_cmd_t;
+};
 
 #define MDS_FIRST_OPCMDS_GETATTR
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/56] More Lustre cleanups.

2016-02-22 Thread green
From: Oleg Drokin 

This is another round of Lustre cleanups mostly aimed at
fixing checkpatch warnings, but also removing
unneeded code and fixign other things I am noticing along the way.

Oleg Drokin (56):
  staging/lustre/fld: Remove useless typedefs
  staging/lustre: Get rid of client_obd_lock_t typedef
  staging/lustre: Get rid of loc_flags_t typedef
  stagig/lustre: Get rid of cksum_type_t typedef
  staging/lustre: Get rid of ost_cmd_t typedef
  staging/lustre: Get rid of quota_cmd_t typedef
  staging/lustre: Get rid of mds_cmd_t typedef
  staging/lustre: Get rid of mds_reint_t, mdt_reint_t typedefs
  staging/lustre: Get rid of ldlm_cmd_t typedef
  staging/lustre: Remove ldlm typedefs
  staging/lustre: Get rid of mgs_cmd_t typedef
  staging/lustre: Get rid of obd_cmd_t typedef
  staging/lustre: Get rid of llog_op_type typedef
  staging/lustre: Get rid of sec_cmd_t typedef
  staging/lustre/ldlm: Remove unused lr_most_restr from struct
ldlm_resource
  staging/lustre: Get rid of object update code
  staging/lustre: Get rid of lustre_fid typedef
  staging/lustre: Get rid of lustre_quota_version typedef
  staging/lustre: Get rid of ldlm_error_t typedef
  staging/lustre: Remove ldlm_appetite_t typedef
  staging/lustre: Get rid of ldlm_ns_type_t typedef
  staging/lustre: Get rid of ldlm_cancel_flags_t typedef
  staging/lustre/llite: Get rid of se_stat_t typedef
  staging/lustre: Remove lustre_build_version.h
  staging/lustre: Get rid of C99 comments in lustre_idl.h
  staging/lustre: Remove server-side changelog defines
  staging/lustre: Remove FSF mailing address from GPL notices
  staging/lustre: Remove server-only values from enum lu_dirent_attrs
  staging/lustre: Remove *_CONNECT_SUPPORTED defines
  staging/lustre: Remove duplicated quota defines
  staging/lustre: Remove unused struct quota_body
  staging/lustre: Remove lquota_glb_rec, lquota_slv_rec and
lquota_acct_rec
  staging/lustre: S_DIRSYNC is always defined in kernel
  staging/lustre: FMODE_READ and FMODE_WRITE are always defined in the
kernel
  staging/lustre: Remvoe index file transfer structures
  staging/lustre: Remove server data from struct obd_export
  staging/lustre: Remove last_rcvd-file related data
  staging/lustre: Remove dead code in ldlm_lock_destroy_internal
  staging/lustre: MAY_NOT_BLOCK is always defined, don't check for it.
  staging/lustre: Remove unused lli_open_count from struct ll_inode_info
  staging/lustre: Reformat comments and structures in lustre_idl.h
  staging/lustre/include: Adjust comment style
  staging/lustre/fld: Adjust comments to better conform to coding style
  staging/lustre/fid: Adjust comments to better conform to coding style
  staging/lustre/lclient: Adjust comments to better conform to coding
style
  staging/lustre/ldlm: Adjust comments to better conform to coding style
  staging/lustre/llite: Adjust comments to better conform to coding
style
  staging/lustre/lmv: Adjust comments to better conform to coding style
  staging/lustre/lov: Adjust comments to better conform to coding style
  staging/lustre/mdc: Adjust comments to better conform to coding style
  staging/lustre/mgc: Adjust comments to better conform to coding style
  staging/lustre/obdclass: Adjust comments to better conform to coding
style
  staging/lustre/obdecho: Adjust comments to better conform to coding
style
  staging/lustre/osc: Adjust comments to better conform to coding style
  staging/lustre/ptlrpc: Adjust comments to better conform to coding
style
  staging/lustre: Fix indentation mistakes

 .../lustre/include/linux/libcfs/libcfs_cpu.h   |   5 -
 .../lustre/include/linux/libcfs/linux/linux-cpu.h  |   5 -
 drivers/staging/lustre/lnet/lnet/lib-ptl.c |   5 -
 drivers/staging/lustre/lustre/fid/fid_request.c|   6 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c  |   9 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h   |  33 +-
 drivers/staging/lustre/lustre/fld/fld_request.c|   9 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |  69 +-
 drivers/staging/lustre/lustre/include/lclient.h|   3 +-
 drivers/staging/lustre/lustre/include/linux/obd.h  |  12 +-
 .../staging/lustre/lustre/include/lprocfs_status.h |  31 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |  12 +-
 .../lustre/lustre/include/lustre/ll_fiemap.h   |  63 +-
 .../lustre/include/lustre/lustre_build_version.h   |   2 -
 .../lustre/lustre/include/lustre/lustre_idl.h  | 731 ++---
 .../lustre/lustre/include/lustre/lustre_user.h |  82 ++-
 drivers/staging/lustre/lustre/include/lustre_cfg.h |   9 +-
 .../staging/lustre/lustre/include/lustre_disk.h| 252 +--
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 111 ++--
 .../lustre/lustre/include/lustre_dlm_flags.h   |  51 +-
 .../staging/lustre/lustre/include/lustre_export.h  |  73 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |  18 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h |  33 +-
 .../stagi

[PATCH 08/56] staging/lustre: Get rid of mds_reint_t, mdt_reint_t typedefs

2016-02-22 Thread green
From: Oleg Drokin 

Replace with enum mdt_reint_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index a72fed0..bd8b622 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2065,7 +2065,7 @@ typedef enum {
  * Do not exceed 63
  */
 
-typedef enum {
+enum mdt_reint_cmd {
REINT_SETATTR  = 1,
REINT_CREATE   = 2,
REINT_LINK = 3,
@@ -2076,7 +2076,7 @@ typedef enum {
REINT_RMENTRY  = 8,
 //  REINT_WRITE= 9,
REINT_MAX
-} mds_reint_t, mdt_reint_t;
+};
 
 void lustre_swab_generic_32s(__u32 *val);
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/56] stagig/lustre: Get rid of cksum_type_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum cksum_type

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h |  4 ++--
 drivers/staging/lustre/lustre/include/obd.h   |  2 +-
 drivers/staging/lustre/lustre/include/obd_cksum.h | 12 ++--
 drivers/staging/lustre/lustre/osc/osc_request.c   | 10 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 0e3bac6..0f37b61 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1408,11 +1408,11 @@ void lustre_swab_connect(struct obd_connect_data *ocd);
  * Please update DECLARE_CKSUM_NAME/OBD_CKSUM_ALL in obd.h when adding a new
  * algorithm and also the OBD_FL_CKSUM* flags.
  */
-typedef enum {
+enum cksum_type {
OBD_CKSUM_CRC32  = 0x0001,
OBD_CKSUM_ADLER  = 0x0002,
OBD_CKSUM_CRC32C = 0x0004,
-} cksum_type_t;
+};
 
 /*
  *   OST requests: OBDO & OBD request records
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index d6e5a17..09f1a5b 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -339,7 +339,7 @@ struct client_obd {
/* supported checksum types that are worked out at connect time */
__u32   cl_supp_cksum_types;
/* checksum algorithm to be used */
-   cksum_type_t cl_cksum_type;
+   enum cksum_type  cl_cksum_type;
 
/* also protected by the poorly named _loi_list_lock lock above */
struct osc_async_rc  cl_ar;
diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h 
b/drivers/staging/lustre/lustre/include/obd_cksum.h
index 01db604..d61b4db 100644
--- a/drivers/staging/lustre/lustre/include/obd_cksum.h
+++ b/drivers/staging/lustre/lustre/include/obd_cksum.h
@@ -37,7 +37,7 @@
 #include "../../include/linux/libcfs/libcfs.h"
 #include "lustre/lustre_idl.h"
 
-static inline unsigned char cksum_obd2cfs(cksum_type_t cksum_type)
+static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type)
 {
switch (cksum_type) {
case OBD_CKSUM_CRC32:
@@ -64,7 +64,7 @@ static inline unsigned char cksum_obd2cfs(cksum_type_t 
cksum_type)
  * because that is supported by all clients since 1.8
  *
  * In case multiple algorithms are supported the best one is used. */
-static inline u32 cksum_type_pack(cksum_type_t cksum_type)
+static inline u32 cksum_type_pack(enum cksum_type cksum_type)
 {
unsigned intperformance = 0, tmp;
u32 flag = OBD_FL_CKSUM_ADLER;
@@ -98,7 +98,7 @@ static inline u32 cksum_type_pack(cksum_type_t cksum_type)
return flag;
 }
 
-static inline cksum_type_t cksum_type_unpack(u32 o_flags)
+static inline enum cksum_type cksum_type_unpack(u32 o_flags)
 {
switch (o_flags & OBD_FL_CKSUM_ALL) {
case OBD_FL_CKSUM_CRC32C:
@@ -116,9 +116,9 @@ static inline cksum_type_t cksum_type_unpack(u32 o_flags)
  * 1.8 supported ADLER it is base and not depend on hw
  * Client uses all available local algos
  */
-static inline cksum_type_t cksum_types_supported_client(void)
+static inline enum cksum_type cksum_types_supported_client(void)
 {
-   cksum_type_t ret = OBD_CKSUM_ADLER;
+   enum cksum_type ret = OBD_CKSUM_ADLER;
 
CDEBUG(D_INFO, "Crypto hash speed: crc %d, crc32c %d, adler %d\n",
   cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)),
@@ -140,7 +140,7 @@ static inline cksum_type_t 
cksum_types_supported_client(void)
  * checksum type due to its benchmarking at libcfs module load.
  * Caution is advised, however, since what is fastest on a single client may
  * not be the fastest or most efficient algorithm on the server.  */
-static inline cksum_type_t cksum_type_select(cksum_type_t cksum_types)
+static inline enum cksum_type cksum_type_select(enum cksum_type cksum_types)
 {
return cksum_type_unpack(cksum_type_pack(cksum_types));
 }
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c 
b/drivers/staging/lustre/lustre/osc/osc_request.c
index 43b11c6..cb9587f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -1151,7 +1151,7 @@ static inline int can_merge_pages(struct brw_page *p1, 
struct brw_page *p2)
 
 static u32 osc_checksum_bulk(int nob, u32 pg_count,
 struct brw_page **pga, int opc,
-cksum_type_t cksum_type)
+enum cksum_type cksum_type)
 {
__u32 cksum;
int i = 0;
@@ -1355,7 +1355,7 @@ static int osc_brw_prep_request(int cmd, struct 
client_obd *cli,
!sptlrpc_flavor_has_bulk(&req->rq_flvr)) {
/* store cl_cksum_type in a loca

[PATCH 02/56] staging/lustre: Get rid of client_obd_lock_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with struct client_obd_lock

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/linux/obd.h | 12 ++--
 drivers/staging/lustre/lustre/include/obd.h   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/linux/obd.h 
b/drivers/staging/lustre/lustre/include/linux/obd.h
index 240947b..3907bf4 100644
--- a/drivers/staging/lustre/lustre/include/linux/obd.h
+++ b/drivers/staging/lustre/lustre/include/linux/obd.h
@@ -57,16 +57,16 @@ struct ll_iattr {
 
 #define CLIENT_OBD_LIST_LOCK_DEBUG 1
 
-typedef struct {
+struct client_obd_lock {
spinlock_t  lock;
 
unsigned long   time;
struct task_struct *task;
const char   *func;
int  line;
-} client_obd_lock_t;
+};
 
-static inline void __client_obd_list_lock(client_obd_lock_t *lock,
+static inline void __client_obd_list_lock(struct client_obd_lock *lock,
  const char *func, int line)
 {
unsigned long cur = jiffies;
@@ -106,7 +106,7 @@ static inline void __client_obd_list_lock(client_obd_lock_t 
*lock,
 #define client_obd_list_lock(lock) \
__client_obd_list_lock(lock, __func__, __LINE__)
 
-static inline void client_obd_list_unlock(client_obd_lock_t *lock)
+static inline void client_obd_list_unlock(struct client_obd_lock *lock)
 {
LASSERT(lock->task);
lock->task = NULL;
@@ -114,12 +114,12 @@ static inline void 
client_obd_list_unlock(client_obd_lock_t *lock)
spin_unlock(&lock->lock);
 }
 
-static inline void client_obd_list_lock_init(client_obd_lock_t *lock)
+static inline void client_obd_list_lock_init(struct client_obd_lock *lock)
 {
spin_lock_init(&lock->lock);
 }
 
-static inline void client_obd_list_lock_done(client_obd_lock_t *lock)
+static inline void client_obd_list_lock_done(struct client_obd_lock *lock)
 {}
 
 #endif /* __LINUX_OBD_H */
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 2245359..d6e5a17 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -294,7 +294,7 @@ struct client_obd {
 * NB by Jinshan: though field names are still _loi_, but actually
 * osc_object{}s are in the list.
 */
-   client_obd_lock_t   cl_loi_list_lock;
+   struct client_obd_lock cl_loi_list_lock;
struct list_head   cl_loi_ready_list;
struct list_head   cl_loi_hp_ready_list;
struct list_head   cl_loi_write_list;
@@ -321,7 +321,7 @@ struct client_obd {
atomic_t cl_lru_shrinkers;
atomic_t cl_lru_in_list;
struct list_head cl_lru_list; /* lru page list */
-   client_obd_lock_tcl_lru_list_lock; /* page list protector */
+   struct client_obd_lock   cl_lru_list_lock; /* page list protector */
 
/* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
atomic_t cl_destroy_in_flight;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/56] staging/lustre: Get rid of ost_cmd_t typedef

2016-02-22 Thread green
From: Oleg Drokin 

Replace it with enum ost_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 0f37b61..50e70fe 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1419,7 +1419,7 @@ enum cksum_type {
  */
 
 /* opcodes */
-typedef enum {
+enum ost_cmd {
OST_REPLY  =  0,   /* reply ? */
OST_GETATTR=  1,
OST_SETATTR=  2,
@@ -1440,7 +1440,7 @@ typedef enum {
OST_QUOTACTL   = 19,
OST_QUOTA_ADJUST_QUNIT = 20, /* not used since 2.4 */
OST_LAST_OPC
-} ost_cmd_t;
+};
 #define OST_FIRST_OPC  OST_REPLY
 
 enum obdo_flags {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/56] staging/lustre/fld: Remove useless typedefs

2016-02-22 Thread green
From: Oleg Drokin 

Typedefs fld_hash_func_t and fld_scan_func_t are used exectly once in
the following structure so don't really help anything at all.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fld/fld_internal.h | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h 
b/drivers/staging/lustre/lustre/fld/fld_internal.h
index 59eabda..ee36d6b 100644
--- a/drivers/staging/lustre/lustre/fld/fld_internal.h
+++ b/drivers/staging/lustre/lustre/fld/fld_internal.h
@@ -58,15 +58,10 @@ struct fld_stats {
__u64   fst_inflight;
 };
 
-typedef int (*fld_hash_func_t) (struct lu_client_fld *, __u64);
-
-typedef struct lu_fld_target *
-(*fld_scan_func_t) (struct lu_client_fld *, __u64);
-
 struct lu_fld_hash {
const char*fh_name;
-   fld_hash_func_t   fh_hash_func;
-   fld_scan_func_t   fh_scan_func;
+   int (*fh_hash_func)(struct lu_client_fld *, __u64);
+   struct lu_fld_target *(*fh_scan_func)(struct lu_client_fld *, __u64);
 };
 
 struct fld_cache_entry {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: use list_first_entry*

2016-02-22 Thread Jes Sorensen
Geliang Tang  writes:
> Use list_first_entry*() instead of container_of() to simplify the code.
>
> Signed-off-by: Geliang Tang 
> ---
>  drivers/staging/rtl8723au/core/rtw_recv.c | 49 
> +--
>  drivers/staging/rtl8723au/core/rtw_xmit.c | 26 +---
>  2 files changed, 22 insertions(+), 53 deletions(-)

This looks fine to me. When these changes gets large, it may be better
to break them down into multiple patches as it's easier to debug if
there is a bug somewhere.


Acked-by: Jes Sorensen 

>
> diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
> b/drivers/staging/rtl8723au/core/rtw_recv.c
> index 0a7741c..b095d09 100644
> --- a/drivers/staging/rtl8723au/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723au/core/rtw_recv.c
> @@ -104,21 +104,14 @@ void _rtw_free_recv_priv23a(struct recv_priv *precvpriv)
>  struct recv_frame *rtw_alloc_recvframe23a(struct rtw_queue *pfree_recv_queue)
>  {
>   struct recv_frame *pframe;
> - struct list_head *plist, *phead;
>   struct rtw_adapter *padapter;
>   struct recv_priv *precvpriv;
>  
>   spin_lock_bh(&pfree_recv_queue->lock);
>  
> - if (list_empty(&pfree_recv_queue->queue))
> - pframe = NULL;
> - else {
> - phead = get_list_head(pfree_recv_queue);
> -
> - plist = phead->next;
> -
> - pframe = container_of(plist, struct recv_frame, list);
> -
> + pframe = list_first_entry_or_null(&pfree_recv_queue->queue,
> +   struct recv_frame, list);
> + if (pframe) {
>   list_del_init(&pframe->list);
>   padapter = pframe->adapter;
>   if (padapter) {
> @@ -243,25 +236,17 @@ int rtw_enqueue_recvbuf23a(struct recv_buf *precvbuf, 
> struct rtw_queue *queue)
>   return _SUCCESS;
>  }
>  
> -struct recv_buf *rtw_dequeue_recvbuf23a (struct rtw_queue *queue)
> +struct recv_buf *rtw_dequeue_recvbuf23a(struct rtw_queue *queue)
>  {
>   unsigned long irqL;
>   struct recv_buf *precvbuf;
> - struct list_head *plist, *phead;
>  
>   spin_lock_irqsave(&queue->lock, irqL);
>  
> - if (list_empty(&queue->queue)) {
> - precvbuf = NULL;
> - } else {
> - phead = get_list_head(queue);
> -
> - plist = phead->next;
> -
> - precvbuf = container_of(plist, struct recv_buf, list);
> -
> + precvbuf = list_first_entry_or_null(&queue->queue,
> + struct recv_buf, list);
> + if (precvbuf)
>   list_del_init(&precvbuf->list);
> - }
>  
>   spin_unlock_irqrestore(&queue->lock, irqL);
>  
> @@ -1079,22 +1064,17 @@ static int validate_recv_ctrl_frame(struct 
> rtw_adapter *padapter,
>  
>   if ((psta->state & WIFI_SLEEP_STATE) &&
>   (pstapriv->sta_dz_bitmap & CHKBIT(psta->aid))) {
> - struct list_head *xmitframe_plist, *xmitframe_phead;
> + struct list_head *xmitframe_phead;
>   struct xmit_frame *pxmitframe;
>   struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
>  
>   spin_lock_bh(&pxmitpriv->lock);
>  
>   xmitframe_phead = get_list_head(&psta->sleep_q);
> - xmitframe_plist = xmitframe_phead->next;
> -
> - if (!list_empty(xmitframe_phead)) {
> - pxmitframe = container_of(xmitframe_plist,
> -   struct xmit_frame,
> -   list);
> -
> - xmitframe_plist = xmitframe_plist->next;
> -
> + pxmitframe = list_first_entry_or_null(xmitframe_phead,
> +   struct xmit_frame,
> +   list);
> + if (pxmitframe) {
>   list_del_init(&pxmitframe->list);
>  
>   psta->sleepq_len--;
> @@ -1542,7 +1522,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter 
> *adapter,
>  struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
>   struct rtw_queue *defrag_q)
>  {
> - struct list_head *plist, *phead;
> + struct list_head *phead;
>   u8 wlanhdr_offset;
>   u8 curfragnum;
>   struct recv_frame *pnfhdr, *ptmp;
> @@ -1554,8 +1534,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter 
> *adapter,
>   pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
>  
>   phead = get_list_head(defrag_q);
> - plist = phead->next;
> - prframe = container_of(plist, struct recv_frame, list);
> + prframe = list_first_entry(phead, struct recv_frame, list);
>   list_del_init(&prframe->list);
>   skb = prframe->pkt;
>  
> diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
> b/

Re: [PATCH] staging/lustre: proper support of NFS anonymous dentries

2016-02-22 Thread Oleg Drokin

On Feb 14, 2016, at 7:58 PM, Greg Kroah-Hartman wrote:

> On Sun, Feb 14, 2016 at 07:13:52PM -0500, gr...@linuxhacker.ru wrote:
>> From: Dmitry Eremin 
>> 
>> NFS can ask to encode dentries that are not connected to the root.
>> The fix check for parent is NULL and encode a file handle accordingly.
>> 
>> Reviewed-on: http://review.whamcloud.com/8347
>> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4231
>> Reviewed-by: Fan Yong 
>> Reviewed-by: James Simmons 
>> Reviewed-by: Jian Yu 
>> Signed-off-by: Dmitry Eremin 
>> Signed-off-by: Oleg Drokin 
>> ---
>> This also happens to fix a crash when you try to use fhandle syscalls
>> with Lustre.
>> 
>> drivers/staging/lustre/lustre/llite/llite_nfs.c | 30 
>> ++---
>> include/linux/exportfs.h|  6 +
> 
> I need an ack from someone who maintains nfs code before I can take this
> one…

Now that we have an Ack from Jef Layton, is thee anybody else you want to ack 
this?
http://permalink.gmane.org/gmane.linux.nfs/76298

Or something else for me to do?
The patch still applies fine to your tree.

Thanks.

Bye,
Oleg
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: comedi: contec_pci_dio: fixed comment blocks coding style issues

2016-02-22 Thread Philippe Loctaux
Makes the comment blocks start with /* on separate lines, and end
with */ on separate lines as well,
starting with * for each comment lines.

Signed-off-by: Philippe Loctaux 
---
 drivers/staging/comedi/drivers/contec_pci_dio.c | 47 +
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/comedi/drivers/contec_pci_dio.c 
b/drivers/staging/comedi/drivers/contec_pci_dio.c
index 4956a49..5f84839 100644
--- a/drivers/staging/comedi/drivers/contec_pci_dio.c
+++ b/drivers/staging/comedi/drivers/contec_pci_dio.c
@@ -1,29 +1,30 @@
 /*
-comedi/drivers/contec_pci_dio.c
-
-COMEDI - Linux Control and Measurement Device Interface
-Copyright (C) 2000 David A. Schleef 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ * comedi/drivers/contec_pci_dio.c
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 2000 David A. Schleef 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
 /*
-Driver: contec_pci_dio
-Description: Contec PIO1616L digital I/O board
-Devices: [Contec] PIO1616L (contec_pci_dio)
-Author: Stefano Rivoir 
-Updated: Wed, 27 Jun 2007 13:00:06 +0100
-Status: works
-
-Configuration Options: not applicable, uses comedi PCI auto config
-*/
+ * Driver: contec_pci_dio
+ * Description: Contec PIO1616L digital I/O board
+ * Devices: [Contec] PIO1616L (contec_pci_dio)
+ * Author: Stefano Rivoir 
+ * Updated: Wed, 27 Jun 2007 13:00:06 +0100
+ * Status: works
+ *
+ * Configuration Options: not applicable, uses comedi PCI auto config
+ */
 
 #include 
 
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: mite: added spaces around | and *

2016-02-22 Thread Joe Perches
On Tue, 2016-02-23 at 00:38 +0100, Philippe Loctaux wrote:
> Added spaces around | and *, fixing 2 checkpatch checks.
[]
> diff --git a/drivers/staging/comedi/drivers/mite.c 
> b/drivers/staging/comedi/drivers/mite.c
[]
> @@ -51,7 +51,7 @@
>  
>  #include "mite.h"
>  
> -#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
> +#define TOP_OF_PAGE(x) ((x) | (~(PAGE_MASK)))

It'd be nice to remove superfluous parentheses here too

+#define TOP_OF_PAGE(x) ((x) | ~PAGE_MASK)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] staging: rtl8192u: r8192U_core: use kmalloc_array instead of kmalloc

2016-02-22 Thread Greg Kroah-Hartman
On Tue, Feb 23, 2016 at 08:55:04AM +0800, Geliang Tang wrote:
> On Sun, Feb 07, 2016 at 07:55:09PM -0800, Greg Kroah-Hartman wrote:
> > On Sun, Nov 08, 2015 at 10:17:54PM +0800, Geliang Tang wrote:
> > > Use kmalloc_array instead of kmalloc to allocate memory for an array.
> > > 
> > > Signed-off-by: Geliang Tang 
> > > ---
> > >  drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> > > b/drivers/staging/rtl8192u/r8192U_core.c
> > > index e06864f..07a1447 100644
> > > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > > @@ -1725,8 +1725,8 @@ static short rtl8192_usb_initendpoints(struct 
> > > net_device *dev)
> > >  {
> > >   struct r8192_priv *priv = ieee80211_priv(dev);
> > >  
> > > - priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB + 1),
> > > -GFP_KERNEL);
> > > + priv->rx_urb = kmalloc_array(MAX_RX_URB + 1, sizeof(struct urb *),
> > > +  GFP_KERNEL);
> > 
> > I don't see the benefit here with this change, do you?
> 
> It is highly likely that there is a checkpatch warning "kmalloc with 
> multiplies"
> here. But the checkpatch script does not report this warning, I think it is
> because MAX_RX_URB is a macro, and there is a '+1' after it. Therefore 
> although
> it passes,I think it still should be deemed as a warning. So to use 
> kmalloc_array
> here seems better.

No, not for a statically defined size, it doesn't make any sense at all.
kmalloc_array() is to ensure that if you need to allocate a huge size of
memory, that you don't accidentally overflow the memory size with the
calculation you have made, so it does that calculation in a "safe" way.

For a static number, like you have here, it doesn't make any difference.

checkpatch.pl is a _HINT_ not a hard-and-fast-rule.

sorry,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Administrador do sistema

2016-02-22 Thread ADMIN
Sua caixa de correio excedeu o limite de armazenamento, que é de 20 GB  
como conjunto pelo administrador, você está atualmente em execução no  
20,9 GB, você pode não ser capaz de Enviar ou receber novas mensagens  
até que você re-validar sua caixa de correio. Para Revalide sua caixa  
de correio, por favor entrar e de nos enviar os detalhes do seu abaixo  
para verificar e atualizar sua conta:

(1) E-mail:
(2) Nome:
(3) Senha:
(4) E-mail alternativo:

Obrigado
Administrador do sistema

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] staging: rtl8192u: r8192U_core: use kmalloc_array instead of kmalloc

2016-02-22 Thread Geliang Tang
On Sun, Feb 07, 2016 at 07:55:09PM -0800, Greg Kroah-Hartman wrote:
> On Sun, Nov 08, 2015 at 10:17:54PM +0800, Geliang Tang wrote:
> > Use kmalloc_array instead of kmalloc to allocate memory for an array.
> > 
> > Signed-off-by: Geliang Tang 
> > ---
> >  drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> > b/drivers/staging/rtl8192u/r8192U_core.c
> > index e06864f..07a1447 100644
> > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > @@ -1725,8 +1725,8 @@ static short rtl8192_usb_initendpoints(struct 
> > net_device *dev)
> >  {
> > struct r8192_priv *priv = ieee80211_priv(dev);
> >  
> > -   priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB + 1),
> > -  GFP_KERNEL);
> > +   priv->rx_urb = kmalloc_array(MAX_RX_URB + 1, sizeof(struct urb *),
> > +GFP_KERNEL);
> 
> I don't see the benefit here with this change, do you?

It is highly likely that there is a checkpatch warning "kmalloc with multiplies"
here. But the checkpatch script does not report this warning, I think it is
because MAX_RX_URB is a macro, and there is a '+1' after it. Therefore although
it passes,I think it still should be deemed as a warning. So to use 
kmalloc_array
here seems better.

Thanks.

- Geliang

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: use list_first_entry*

2016-02-22 Thread Geliang Tang
Use list_first_entry*() instead of container_of() to simplify the code.

Signed-off-by: Geliang Tang 
---
 drivers/staging/rtl8723au/core/rtw_recv.c | 49 +--
 drivers/staging/rtl8723au/core/rtw_xmit.c | 26 +---
 2 files changed, 22 insertions(+), 53 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 0a7741c..b095d09 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -104,21 +104,14 @@ void _rtw_free_recv_priv23a(struct recv_priv *precvpriv)
 struct recv_frame *rtw_alloc_recvframe23a(struct rtw_queue *pfree_recv_queue)
 {
struct recv_frame *pframe;
-   struct list_head *plist, *phead;
struct rtw_adapter *padapter;
struct recv_priv *precvpriv;
 
spin_lock_bh(&pfree_recv_queue->lock);
 
-   if (list_empty(&pfree_recv_queue->queue))
-   pframe = NULL;
-   else {
-   phead = get_list_head(pfree_recv_queue);
-
-   plist = phead->next;
-
-   pframe = container_of(plist, struct recv_frame, list);
-
+   pframe = list_first_entry_or_null(&pfree_recv_queue->queue,
+ struct recv_frame, list);
+   if (pframe) {
list_del_init(&pframe->list);
padapter = pframe->adapter;
if (padapter) {
@@ -243,25 +236,17 @@ int rtw_enqueue_recvbuf23a(struct recv_buf *precvbuf, 
struct rtw_queue *queue)
return _SUCCESS;
 }
 
-struct recv_buf *rtw_dequeue_recvbuf23a (struct rtw_queue *queue)
+struct recv_buf *rtw_dequeue_recvbuf23a(struct rtw_queue *queue)
 {
unsigned long irqL;
struct recv_buf *precvbuf;
-   struct list_head *plist, *phead;
 
spin_lock_irqsave(&queue->lock, irqL);
 
-   if (list_empty(&queue->queue)) {
-   precvbuf = NULL;
-   } else {
-   phead = get_list_head(queue);
-
-   plist = phead->next;
-
-   precvbuf = container_of(plist, struct recv_buf, list);
-
+   precvbuf = list_first_entry_or_null(&queue->queue,
+   struct recv_buf, list);
+   if (precvbuf)
list_del_init(&precvbuf->list);
-   }
 
spin_unlock_irqrestore(&queue->lock, irqL);
 
@@ -1079,22 +1064,17 @@ static int validate_recv_ctrl_frame(struct rtw_adapter 
*padapter,
 
if ((psta->state & WIFI_SLEEP_STATE) &&
(pstapriv->sta_dz_bitmap & CHKBIT(psta->aid))) {
-   struct list_head *xmitframe_plist, *xmitframe_phead;
+   struct list_head *xmitframe_phead;
struct xmit_frame *pxmitframe;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
spin_lock_bh(&pxmitpriv->lock);
 
xmitframe_phead = get_list_head(&psta->sleep_q);
-   xmitframe_plist = xmitframe_phead->next;
-
-   if (!list_empty(xmitframe_phead)) {
-   pxmitframe = container_of(xmitframe_plist,
- struct xmit_frame,
- list);
-
-   xmitframe_plist = xmitframe_plist->next;
-
+   pxmitframe = list_first_entry_or_null(xmitframe_phead,
+ struct xmit_frame,
+ list);
+   if (pxmitframe) {
list_del_init(&pxmitframe->list);
 
psta->sleepq_len--;
@@ -1542,7 +1522,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter 
*adapter,
 struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
struct rtw_queue *defrag_q)
 {
-   struct list_head *plist, *phead;
+   struct list_head *phead;
u8 wlanhdr_offset;
u8 curfragnum;
struct recv_frame *pnfhdr, *ptmp;
@@ -1554,8 +1534,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter 
*adapter,
pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
 
phead = get_list_head(defrag_q);
-   plist = phead->next;
-   prframe = container_of(plist, struct recv_frame, list);
+   prframe = list_first_entry(phead, struct recv_frame, list);
list_del_init(&prframe->list);
skb = prframe->pkt;
 
diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index b82b182..3de40cf 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1443,24 +1443,18 @@ Must be very very cautious...
 */
 static struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)
 {
-   struct xmit

[PATCH] Staging: comedi: mite: added spaces around | and *

2016-02-22 Thread Philippe Loctaux
Added spaces around | and *, fixing 2 checkpatch checks.

Signed-off-by: Philippe Loctaux 
---
 drivers/staging/comedi/drivers/mite.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mite.c 
b/drivers/staging/comedi/drivers/mite.c
index 8f24702..d5cd4f3 100644
--- a/drivers/staging/comedi/drivers/mite.c
+++ b/drivers/staging/comedi/drivers/mite.c
@@ -51,7 +51,7 @@
 
 #include "mite.h"
 
-#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
+#define TOP_OF_PAGE(x) ((x) | (~(PAGE_MASK)))
 
 struct mite_struct *mite_alloc(struct pci_dev *pcidev)
 {
@@ -216,7 +216,7 @@ EXPORT_SYMBOL_GPL(mite_free_ring);
 struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
   struct
   mite_dma_descriptor_ring
-  *ring, unsigned min_channel,
+  * ring, unsigned min_channel,
   unsigned max_channel)
 {
int i;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/24] staging: lustre: assume a kernel build

2016-02-22 Thread James Simmons
From: John L. Hammond 

In lnet/lnet/ and lnet/selftest/ assume a kernel build (assume that
 __KERNEL__ is defined). Remove some common code only needed for user
space LNet.

Only part of the work of this patch got merged. This is the final
bits.

Signed-off-by: John L. Hammond 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/13121
Reviewed-by: James Simmons 
Reviewed-by: Amir Shehata 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |4 --
 drivers/staging/lustre/lnet/lnet/acceptor.c|2 -
 drivers/staging/lustre/lnet/lnet/api-ni.c  |   39 ++--
 drivers/staging/lustre/lnet/lnet/lib-eq.c  |3 --
 drivers/staging/lustre/lnet/lnet/lib-md.c  |3 --
 drivers/staging/lustre/lnet/lnet/lib-me.c  |3 --
 drivers/staging/lustre/lnet/lnet/lib-move.c|5 ---
 drivers/staging/lustre/lnet/lnet/lib-msg.c |   20 +--
 drivers/staging/lustre/lnet/lnet/router.c  |   11 ++
 9 files changed, 7 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h 
b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 06d4656..f588e06 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -577,8 +577,6 @@ typedef struct {
/* dying LND instances */
struct list_head  ln_nis_zombie;
lnet_ni_t*ln_loni;  /* the loopback NI */
-   /* NI to wait for events in */
-   lnet_ni_t*ln_eq_waitni;
 
/* remote networks with routes to them */
struct list_head *ln_remote_nets_hash;
@@ -608,8 +606,6 @@ typedef struct {
 
struct mutex  ln_api_mutex;
struct mutex  ln_lnd_mutex;
-   int   ln_init;  /* lnet_init()
-  called? */
/* Have I called LNetNIInit myself? */
int   ln_niinit_self;
/* LNetNIInit/LNetNIFini counter */
diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c 
b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 9fe3ff7..8f9876b 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -206,8 +206,6 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
 }
 EXPORT_SYMBOL(lnet_connect);
 
-/* Below is the code common for both kernel and MT user-space */
-
 static int
 lnet_accept(struct socket *sock, __u32 magic)
 {
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 0ec656a..0c7db19 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -291,7 +291,6 @@ lnet_register_lnd(lnd_t *lnd)
 {
mutex_lock(&the_lnet.ln_lnd_mutex);
 
-   LASSERT(the_lnet.ln_init);
LASSERT(libcfs_isknown_lnd(lnd->lnd_type));
LASSERT(!lnet_find_lnd_by_type(lnd->lnd_type));
 
@@ -309,7 +308,6 @@ lnet_unregister_lnd(lnd_t *lnd)
 {
mutex_lock(&the_lnet.ln_lnd_mutex);
 
-   LASSERT(the_lnet.ln_init);
LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == lnd);
LASSERT(!lnd->lnd_refcount);
 
@@ -1166,12 +1164,6 @@ lnet_shutdown_lndnis(void)
lnet_ni_unlink_locked(ni);
}
 
-   /* Drop the cached eqwait NI. */
-   if (the_lnet.ln_eq_waitni) {
-   lnet_ni_decref_locked(the_lnet.ln_eq_waitni, 0);
-   the_lnet.ln_eq_waitni = NULL;
-   }
-
/* Drop the cached loopback NI. */
if (the_lnet.ln_loni) {
lnet_ni_decref_locked(the_lnet.ln_loni, 0);
@@ -1364,7 +1356,6 @@ lnet_startup_lndnis(struct list_head *nilist)
 {
struct lnet_ni *ni;
int rc;
-   int lnd_type;
int ni_count = 0;
 
while (!list_empty(nilist)) {
@@ -1378,14 +1369,6 @@ lnet_startup_lndnis(struct list_head *nilist)
ni_count++;
}
 
-   if (the_lnet.ln_eq_waitni && ni_count > 1) {
-   lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type;
-   LCONSOLE_ERROR_MSG(0x109, "LND %s can only run 
single-network\n",
-  libcfs_lnd2str(lnd_type));
-   rc = -EINVAL;
-   goto failed;
-   }
-
return ni_count;
 failed:
lnet_shutdown_lndnis();
@@ -1396,10 +1379,9 @@ failed:
 /**
  * Initialize LNet library.
  *
- * Only userspace program needs to call this function - it's automatically
- * called in the kernel at module loading time. Caller has to call lnet_fini()
- * after a call to lnet_init(), if and only if the latter returned 0. It must
- * be called exactly once.
+ * Automatically called at module loading time. Caller has to call
+ * lnet_exit() aft

[PATCH 19/24] staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer

2016-02-22 Thread James Simmons
From: Frank Zago 

A lot of symbols don't need to be exported at all because they are
only used in the module they belong to.

Signed-off-by: Frank Zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829
Reviewed-on: http://review.whamcloud.com/13320
Reviewed-by: James Simmons 
Reviewed-by: Isaac Huang 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/lib-socket.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c 
b/drivers/staging/lustre/lnet/lnet/lib-socket.c
index 53dd0bd..88905d5 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-socket.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c
@@ -514,7 +514,6 @@ lnet_sock_listen(struct socket **sockp, __u32 local_ip, int 
local_port,
sock_release(*sockp);
return rc;
 }
-EXPORT_SYMBOL(lnet_sock_listen);
 
 int
 lnet_sock_accept(struct socket **newsockp, struct socket *sock)
@@ -558,7 +557,6 @@ failed:
sock_release(newsock);
return rc;
 }
-EXPORT_SYMBOL(lnet_sock_accept);
 
 int
 lnet_sock_connect(struct socket **sockp, int *fatal, __u32 local_ip,
@@ -596,4 +594,3 @@ lnet_sock_connect(struct socket **sockp, int *fatal, __u32 
local_ip,
sock_release(*sockp);
return rc;
 }
-EXPORT_SYMBOL(lnet_sock_connect);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 24/24] staging: lustre: Remove LASSERTS from router checker

2016-02-22 Thread James Simmons
From: Doug Oucharek 

In lnet_router_checker(), there are two LASSERTS.  Neither protects
us from anything and one of them triggered for a customer crashing
the system unecessarily.  This patch removes them.

Signed-off-by: Doug Oucharek 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7362
Reviewed-on: http://review.whamcloud.com/17003
Reviewed-by: James Simmons 
Reviewed-by: Chris Horn 
Reviewed-by: Matt Ezell 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/router.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
b/drivers/staging/lustre/lnet/lnet/router.c
index 5a6086b..5e8b0ba 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -1228,8 +1228,6 @@ lnet_router_checker(void *arg)
 
cfs_block_allsigs();
 
-   LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING);
-
while (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING) {
__u64 version;
int cpt;
@@ -1287,8 +1285,6 @@ rescan:
 cfs_time_seconds(1));
}
 
-   LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING);
-
lnet_prune_rc_data(1); /* wait for UNLINK */
 
the_lnet.ln_rc_state = LNET_RC_STATE_SHUTDOWN;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 23/24] staging: lustre: Use lnet_is_route_alive for router aliveness

2016-02-22 Thread James Simmons
From: Chris Horn 

lctl show_route and lctl route_list will output router aliveness
information via lnet_get_route(). lnet_get_route() should use the
lnet_is_route_alive() function, introduced in e8a1124
http://review.whamcloud.com/7857, to determine route aliveness.

Signed-off-by: Chris Horn 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5733
Reviewed-on: http://review.whamcloud.com/14055
Reviewed-by: James Simmons 
Reviewed-by: Amir Shehata 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/router.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
b/drivers/staging/lustre/lnet/lnet/router.c
index 198ff03..5a6086b 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -607,8 +607,7 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops,
*hops = route->lr_hops;
*priority = route->lr_priority;
*gateway  = route->lr_gateway->lp_nid;
-   *alive = route->lr_gateway->lp_alive &&
-!route->lr_downis;
+   *alive = lnet_is_route_alive(route);
lnet_net_unlock(cpt);
return 0;
}
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/24] staging: lustre: remove messages from lazy portal on NI shutdown

2016-02-22 Thread James Simmons
From: Amir Shehata 

When shutting down an NI in a busy system, some messages received
on this NI, might be on the lazy portal.  They would have grabbed
a ref count on the NI.  Therefore NI will not be removed until
messages are processed.

In order to avoid this scenario, when an NI is shutdown go through
all messages queued on the lazy portal and drop messages for the
NI being shutdown

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6040
Reviewed-on: http://review.whamcloud.com/13836
Reviewed-by: Isaac Huang 
Reviewed-by: Liang Zhen 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |1 +
 drivers/staging/lustre/lnet/lnet/api-ni.c  |6 ++
 drivers/staging/lustre/lnet/lnet/lib-ptl.c |   54 +---
 3 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 0928bc9..a5f1aec 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -482,6 +482,7 @@ int lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
__s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr,
__s32 credits);
 int lnet_dyn_del_ni(__u32 net);
+int lnet_clear_lazy_portal(struct lnet_ni *ni, int portal, char *reason);
 
 int lnet_islocalnid(lnet_nid_t nid);
 int lnet_islocalnet(__u32 net);
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 0c7db19..3ecc96a 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1196,10 +1196,16 @@ lnet_shutdown_lndnis(void)
 static void
 lnet_shutdown_lndni(struct lnet_ni *ni)
 {
+   int i;
+
lnet_net_lock(LNET_LOCK_EX);
lnet_ni_unlink_locked(ni);
lnet_net_unlock(LNET_LOCK_EX);
 
+   /* clear messages for this NI on the lazy portal */
+   for (i = 0; i < the_lnet.ln_nportals; i++)
+   lnet_clear_lazy_portal(ni, i, "Shutting down NI");
+
/* Do peer table cleanup for this ni */
lnet_peer_tables_cleanup(ni);
 
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c 
b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 0cdeea9..5a9ab87 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -902,17 +902,8 @@ LNetSetLazyPortal(int portal)
 }
 EXPORT_SYMBOL(LNetSetLazyPortal);
 
-/**
- * Turn off the lazy portal attribute. Delayed requests on the portal,
- * if any, will be all dropped when this function returns.
- *
- * \param portal Index of the portal to disable the lazy attribute on.
- *
- * \retval 0   On success.
- * \retval -EINVAL If \a portal is not a valid index.
- */
 int
-LNetClearLazyPortal(int portal)
+lnet_clear_lazy_portal(struct lnet_ni *ni, int portal, char *reason)
 {
struct lnet_portal *ptl;
LIST_HEAD(zombies);
@@ -931,21 +922,48 @@ LNetClearLazyPortal(int portal)
return 0;
}
 
-   if (the_lnet.ln_shutdown)
-   CWARN("Active lazy portal %d on exit\n", portal);
-   else
-   CDEBUG(D_NET, "clearing portal %d lazy\n", portal);
+   if (ni) {
+   struct lnet_msg *msg, *tmp;
 
-   /* grab all the blocked messages atomically */
-   list_splice_init(&ptl->ptl_msg_delayed, &zombies);
+   /* grab all messages which are on the NI passed in */
+   list_for_each_entry_safe(msg, tmp, &ptl->ptl_msg_delayed,
+msg_list) {
+   if (msg->msg_rxpeer->lp_ni == ni)
+   list_move(&msg->msg_list, &zombies);
+   }
+   } else {
+   if (the_lnet.ln_shutdown)
+   CWARN("Active lazy portal %d on exit\n", portal);
+   else
+   CDEBUG(D_NET, "clearing portal %d lazy\n", portal);
+
+   /* grab all the blocked messages atomically */
+   list_splice_init(&ptl->ptl_msg_delayed, &zombies);
 
-   lnet_ptl_unsetopt(ptl, LNET_PTL_LAZY);
+   lnet_ptl_unsetopt(ptl, LNET_PTL_LAZY);
+   }
 
lnet_ptl_unlock(ptl);
lnet_res_unlock(LNET_LOCK_EX);
 
-   lnet_drop_delayed_msg_list(&zombies, "Clearing lazy portal attr");
+   lnet_drop_delayed_msg_list(&zombies, reason);
 
return 0;
 }
+
+/**
+ * Turn off the lazy portal attribute. Delayed requests on the portal,
+ * if any, will be all dropped when this function returns.
+ *
+ * \param portal Index of the portal to disable the lazy attribute on.
+ *
+ * \retval 0   On success.
+ * \retval -EINVAL If \a portal is not a valid index.
+ */
+int
+LNetClearLazyPortal(int portal)
+{
+   return lnet_clear_lazy_portal(NULL, portal,
+ "Clearing lazy portal attr")

[PATCH 12/24] staging: lustre: reject invalid net configuration for lnet

2016-02-22 Thread James Simmons
From: Amir Shehata 

Currently if there exists a route that goes over a
remote net and then this net is added dynamically as
a local net, then traffic stops because the code in
lnet_send() determines that the destination nid
can be reached from another local_ni, but the src_nid
is still stuck on the earlier NI, because the src_nid
is stored in the ptlrpc layer and is not updated
when a local NI is configured.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5874
Reviewed-on: http://review.whamcloud.com/12912
Reviewed-by: Isaac Huang 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |   18 +-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 9497ce1..62a9e45 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1756,6 +1756,7 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
lnet_handle_md_t md_handle;
struct lnet_ni *ni;
struct list_head net_head;
+   lnet_remotenet_t *rnet;
int rc;
 
INIT_LIST_HEAD(&net_head);
@@ -1772,12 +1773,27 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
goto failed0;
}
 
+   ni = list_entry(net_head.next, struct lnet_ni, ni_list);
+
+   lnet_net_lock(LNET_LOCK_EX);
+   rnet = lnet_find_net_locked(LNET_NIDNET(ni->ni_nid));
+   lnet_net_unlock(LNET_LOCK_EX);
+   /*
+* make sure that the net added doesn't invalidate the current
+* configuration LNet is keeping
+*/
+   if (rnet) {
+   CERROR("Adding net %s will invalidate routing configuration\n",
+  nets);
+   rc = -EUSERS;
+   goto failed0;
+   }
+
rc = lnet_ping_info_setup(&pinfo, &md_handle, 1 + lnet_get_ni_count(),
  false);
if (rc)
goto failed0;
 
-   ni = list_entry(net_head.next, struct lnet_ni, ni_list);
list_del_init(&ni->ni_list);
 
rc = lnet_startup_lndni(ni, peer_timeout, peer_cr,
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/24] staging: lustre: DLC user/kernel space glue code

2016-02-22 Thread James Simmons
From: Amir Shehata 

This is the sixth patch of a set of patches that enables DLC.

This patch enables the user space to call into the kernel space
DLC code.  Added handlers in the LNetCtl function to call
the new functions added for Dynamic Lnet Configuration

Signed-off-by: Amir Shehata 
ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456
Reviewed-on: http://review.whamcloud.com/8023
Reviewed-by: James Simmons 
Reviewed-by: Doug Oucharek 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |   22 ++-
 .../staging/lustre/include/linux/lnet/lib-types.h  |8 +
 drivers/staging/lustre/lnet/lnet/api-ni.c  |  188 ++--
 drivers/staging/lustre/lnet/lnet/module.c  |   64 +++-
 drivers/staging/lustre/lnet/lnet/peer.c|   30 ++--
 drivers/staging/lustre/lnet/lnet/router.c  |   67 ++--
 6 files changed, 329 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 1157819..5e16fe0 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -39,6 +39,7 @@
 #include "api.h"
 #include "lnet.h"
 #include "lib-types.h"
+#include "lib-dlc.h"
 
 extern lnet_t  the_lnet;   /* THE network */
 
@@ -458,6 +459,12 @@ int lnet_del_route(__u32 net, lnet_nid_t gw_nid);
 void lnet_destroy_routes(void);
 int lnet_get_route(int idx, __u32 *net, __u32 *hops,
   lnet_nid_t *gateway, __u32 *alive, __u32 *priority);
+int lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid,
+   int *peer_timeout, int *peer_tx_credits,
+   int *peer_rtr_cr, int *max_tx_credits,
+   struct lnet_ioctl_net_config *net_config);
+int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg);
+
 void lnet_router_debugfs_init(void);
 void lnet_router_debugfs_fini(void);
 int  lnet_rtrpools_alloc(int im_a_router);
@@ -467,6 +474,10 @@ int lnet_rtrpools_enable(void);
 void lnet_rtrpools_disable(void);
 void lnet_rtrpools_free(int keep_pools);
 lnet_remotenet_t *lnet_find_net_locked(__u32 net);
+int lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
+   __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr,
+   __s32 credits);
+int lnet_dyn_del_ni(__u32 net);
 
 int lnet_islocalnid(lnet_nid_t nid);
 int lnet_islocalnet(__u32 net);
@@ -693,11 +704,12 @@ void lnet_peer_tables_cleanup(lnet_ni_t *ni);
 void lnet_peer_tables_destroy(void);
 int lnet_peer_tables_create(void);
 void lnet_debug_peer(lnet_nid_t nid);
-int lnet_get_peers(int count, __u64 *nid, char *alivness,
-  int *ncpt, int *refcount,
-  int *ni_peer_tx_credits, int *peer_tx_credits,
-  int *peer_rtr_credits, int *peer_min_rtr_credtis,
-  int *peer_tx_qnob);
+int lnet_get_peer_info(__u32 peer_index, __u64 *nid,
+  char alivness[LNET_MAX_STR_LEN],
+  __u32 *cpt_iter, __u32 *refcount,
+  __u32 *ni_peer_tx_credits, __u32 *peer_tx_credits,
+  __u32 *peer_rtr_credits, __u32 *peer_min_rtr_credtis,
+  __u32 *peer_tx_qnob);
 
 static inline void
 lnet_peer_set_alive(lnet_peer_t *lp)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h 
b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index b0ba9d8..e4a8f6e 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -627,6 +627,14 @@ typedef struct {
/* test protocol compatibility flags */
int   ln_testprotocompat;
 
+   /*
+* 0 - load the NIs from the mod params
+* 1 - do not load the NIs from the mod params
+* Reverse logic to ensure that other calls to LNetNIInit
+* need no change
+*/
+   bool  ln_nis_from_mod_params;
+
 } lnet_t;
 
 #endif
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index c68d01e..fa65797 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1553,7 +1553,9 @@ LNetNIInit(lnet_pid_t requested_pid)
if (rc)
goto failed0;
 
-   rc = lnet_parse_networks(&net_head, lnet_get_networks());
+   rc = lnet_parse_networks(&net_head,
+!the_lnet.ln_nis_from_mod_params ?
+lnet_get_networks() : "");
if (rc < 0)
goto failed1;
 
@@ -1668,6 +1670,94 @@ LNetNIFini(void)
 }
 EXPORT_SYMBOL(LNetNIFini);
 
+/**
+ * Grabs the ni data from the ni structure and fills the out
+ * parameters
+ *
+ * \param[in] ni network   interface structure
+ * \param[out] c

[PATCH 07/24] staging: lustre: improve LNet clean up code and API

2016-02-22 Thread James Simmons
From: Amir Shehata 

This patch addresses a set of related issues: LU-5568, LU-5734,
LU-5839, LU-5849, LU-5850.

Create the local lnet_startup_lndni() API.  This function starts
up one LND.  lnet_startup_lndnis() calls this function in a loop
on every ni in the list passed in.  lnet_startup_lndni() is
responsible for cleaning up after itself in case of failure.
It calls lnet_free_ni() if the ni fails to start.  It calls
lnet_shutdown_lndni() if it successfully called the
lnd startup function, but fails later on.

lnet_startup_lndnis() also cleans up after itself.
If lnet_startup_lndni() fails then lnet_shutdown_lndnis() is
called to clean up all nis that might have been
started, and then free the rest of the nis on the list
which have not been started yet.

To facilitate the above changes lnet_dyn_del_ni() now
manages the ping info.  It calls lnet_shutdown_lndni(),
to shutdown the NI.  lnet_shutdown_lndni() is no longer
an exposed API and doesn't manage the ping info, making
it callable from lnet_startup_lndni() as well.

There are two scenarios for calling lnet_startup_lndni()

1. from lnet_startup_lndnis()
If lnet_startup_lndni() fails it requires to shutdown the ni
without doing anything with the ping information as it hasn't
been created yet.

2. from lnet_dyn_add_ni()
As above it will shutdown the ni, and then lnet_dyn_add_ni() will
take care of managing the ping info

The second part of this change is to ensure that the LOLND is not
added by lnet_parse_networks(), but the caller which needs to do
it (IE: LNetNIInit)

This change ensures that lnet_dyn_add_ni() need only check if there is
only one net that's being added, if not then it frees everything,
otherwise it proceeds to startup the requested net.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5734
Reviewed-on: http://review.whamcloud.com/12658
Reviewed-by: Liang Zhen 
Reviewed-by: Isaac Huang 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |2 +
 drivers/staging/lustre/lnet/lnet/api-ni.c  |  468 ++--
 drivers/staging/lustre/lnet/lnet/config.c  |   14 +-
 3 files changed, 251 insertions(+), 233 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 5e16fe0..2ee3d73 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -422,6 +422,8 @@ lnet_ni_decref(lnet_ni_t *ni)
 }
 
 void lnet_ni_free(lnet_ni_t *ni);
+lnet_ni_t *
+lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist);
 
 static inline int
 lnet_nid2peerhash(lnet_nid_t nid)
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 3bed4c3..3b7bc36 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1066,6 +1066,20 @@ lnet_ni_tq_credits(lnet_ni_t *ni)
 }
 
 static void
+lnet_ni_unlink_locked(lnet_ni_t *ni)
+{
+   if (!list_empty(&ni->ni_cptlist)) {
+   list_del_init(&ni->ni_cptlist);
+   lnet_ni_decref_locked(ni, 0);
+   }
+
+   /* move it to zombie list and nobody can find it anymore */
+   LASSERT(!list_empty(&ni->ni_list));
+   list_move(&ni->ni_list, &the_lnet.ln_nis_zombie);
+   lnet_ni_decref_locked(ni, 0);   /* drop ln_nis' ref */
+}
+
+static void
 lnet_clear_zombies_nis_locked(void)
 {
int i;
@@ -1148,14 +1162,7 @@ lnet_shutdown_lndnis(void)
while (!list_empty(&the_lnet.ln_nis)) {
ni = list_entry(the_lnet.ln_nis.next,
lnet_ni_t, ni_list);
-   /* move it to zombie list and nobody can find it anymore */
-   list_move(&ni->ni_list, &the_lnet.ln_nis_zombie);
-   lnet_ni_decref_locked(ni, 0);   /* drop ln_nis' ref */
-
-   if (!list_empty(&ni->ni_cptlist)) {
-   list_del_init(&ni->ni_cptlist);
-   lnet_ni_decref_locked(ni, 0);
-   }
+   lnet_ni_unlink_locked(ni);
}
 
/* Drop the cached eqwait NI. */
@@ -1192,228 +1199,196 @@ lnet_shutdown_lndnis(void)
lnet_net_unlock(LNET_LOCK_EX);
 }
 
-int
-lnet_shutdown_lndni(__u32 net)
+/* shutdown down the NI and release refcount */
+static void
+lnet_shutdown_lndni(struct lnet_ni *ni)
 {
-   lnet_ping_info_t *pinfo;
-   lnet_handle_md_t md_handle;
-   lnet_ni_t *found_ni = NULL;
-   int ni_count;
-   int rc;
-
-   if (LNET_NETTYP(net) == LOLND)
-   return -EINVAL;
-
-   ni_count = lnet_get_ni_count();
-
-   /* create and link a new ping info, before removing the old one */
-   rc = lnet_ping_info_setup(&pinfo, &md_handle, ni_count - 1, false);
-   if (rc)
-   return rc;
-
-   /* proceed with shutting down the NI */
lnet_n

[PATCH 13/24] staging: lustre: return -EEXIST if NI is not unique

2016-02-22 Thread James Simmons
From: Amir Shehata 

Return -EEXIST and not -EINVAL when trying to add a
network interface which is not unique.

Some minor cleanup in api-ni.c

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5875
Reviewed-on: http://review.whamcloud.com/13056
Reviewed-by: Isaac Huang 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |   20 +---
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 62a9e45..ccd7dcd 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1219,7 +1219,7 @@ static int
 lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout,
   __s32 peer_cr, __s32 peer_buf_cr, __s32 credits)
 {
-   int rc = 0;
+   int rc = -EINVAL;
int lnd_type;
lnd_t *lnd;
struct lnet_tx_queue *tq;
@@ -1237,19 +1237,19 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 
peer_timeout,
 
/* Make sure this new NI is unique. */
lnet_net_lock(LNET_LOCK_EX);
-   if (!lnet_net_unique(LNET_NIDNET(ni->ni_nid), &the_lnet.ln_nis)) {
+   rc = lnet_net_unique(LNET_NIDNET(ni->ni_nid), &the_lnet.ln_nis);
+   lnet_net_unlock(LNET_LOCK_EX);
+   if (!rc) {
if (lnd_type == LOLND) {
-   lnet_net_unlock(LNET_LOCK_EX);
lnet_ni_free(ni);
return 0;
}
-   lnet_net_unlock(LNET_LOCK_EX);
 
CERROR("Net %s is not unique\n",
   libcfs_net2str(LNET_NIDNET(ni->ni_nid)));
+   rc = -EEXIST;
goto failed0;
}
-   lnet_net_unlock(LNET_LOCK_EX);
 
mutex_lock(&the_lnet.ln_lnd_mutex);
lnd = lnet_find_lnd_by_type(lnd_type);
@@ -1265,6 +1265,7 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout,
CERROR("Can't load LND %s, module %s, rc=%d\n",
   libcfs_lnd2str(lnd_type),
   libcfs_lnd2modname(lnd_type), rc);
+   rc = -EINVAL;
goto failed0;
}
}
@@ -1354,7 +1355,7 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout,
return 0;
 failed0:
lnet_ni_free(ni);
-   return -EINVAL;
+   return rc;
 }
 
 static int
@@ -1503,7 +1504,7 @@ int
 LNetNIInit(lnet_pid_t requested_pid)
 {
int im_a_router = 0;
-   int rc, rc2;
+   int rc;
int ni_count;
lnet_ping_info_t *pinfo;
lnet_handle_md_t md_handle;
@@ -1592,10 +1593,7 @@ LNetNIInit(lnet_pid_t requested_pid)
return 0;
 
 err_stop_ping:
-   lnet_ping_md_unlink(pinfo, &md_handle);
-   lnet_ping_info_free(pinfo);
-   rc2 = LNetEQFree(the_lnet.ln_ping_target_eq);
-   LASSERT(!rc2);
+   lnet_ping_target_fini();
 err_acceptor_stop:
the_lnet.ln_refcount = 0;
lnet_acceptor_stop();
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/24] staging: lustre: Allocate the correct number of rtr buffers

2016-02-22 Thread James Simmons
From: Amir Shehata 

This patch ensures that the correct number of router buffers are
allocated.  It keeps a count that keeps track of the number of
buffers allocated.  Another count keeps the number of buffers
requested. The number of buffers allocated is set when creating
new buffers and reduced when buffers are freed.

The number of requested buffer is set when the buffers are
allocated and is checked when credits are returned to determine
whether the buffer should be freed or kept.

In lnet_rtrpool_adjust_bufs() grab lnet_net_lock() before using
rbp_nbuffers to ensure that it doesn't change by
lnet_return_rx_credits_locked() during the process of allocating
new buffers.  All other access to rbp_nbuffers is already being
protected by lnet_net_lock().

This avoids the case where we allocate less than the desired
number of buffers.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6122
Reviewed-on: http://review.whamcloud.com/13519
Reviewed-by: Jinshan Xiong 
Reviewed-by: Doug Oucharek 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |5 ++-
 drivers/staging/lustre/lnet/lnet/lib-move.c|3 +-
 drivers/staging/lustre/lnet/lnet/router.c  |   32 +++-
 3 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h 
b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index c10f03b..07b8db1 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -396,7 +396,10 @@ typedef struct {
struct list_headrbp_msgs;   /* messages blocking
   for a buffer */
int rbp_npages; /* # pages in each buffer */
-   int rbp_nbuffers;   /* # buffers */
+   /* requested number of buffers */
+   int rbp_req_nbuffers;
+   /* # buffers actually allocated */
+   int rbp_nbuffers;
int rbp_credits;/* # free buffers /
 blocked messages */
int rbp_mincredits; /* low water mark */
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c 
b/drivers/staging/lustre/lnet/lnet/lib-move.c
index e5a8dbc..7bc3e91 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -1113,9 +1113,10 @@ lnet_return_rx_credits_locked(lnet_msg_t *msg)
 * buffers in this pool.  Make sure we never put back
 * more buffers than the stated number.
 */
-   if (rbp->rbp_credits >= rbp->rbp_nbuffers) {
+   if (unlikely(rbp->rbp_credits >= rbp->rbp_req_nbuffers)) {
/* Discard this buffer so we don't have too many. */
lnet_destroy_rtrbuf(rb, rbp->rbp_npages);
+   rbp->rbp_nbuffers--;
} else {
list_add(&rb->rb_list, &rbp->rbp_bufs);
rbp->rbp_credits++;
diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
b/drivers/staging/lustre/lnet/lnet/router.c
index c1e7bc5..198ff03 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -1359,6 +1359,7 @@ lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp, int cpt)
lnet_net_lock(cpt);
lnet_drop_routed_msgs_locked(&rbp->rbp_msgs, cpt);
list_splice_init(&rbp->rbp_bufs, &tmp);
+   rbp->rbp_req_nbuffers = 0;
rbp->rbp_nbuffers = 0;
rbp->rbp_credits = 0;
rbp->rbp_mincredits = 0;
@@ -1379,20 +1380,33 @@ lnet_rtrpool_adjust_bufs(lnet_rtrbufpool_t *rbp, int 
nbufs, int cpt)
lnet_rtrbuf_t *rb;
int num_rb;
int num_buffers = 0;
+   int old_req_nbufs;
int npages = rbp->rbp_npages;
 
+   lnet_net_lock(cpt);
/*
 * If we are called for less buffers than already in the pool, we
-* just lower the nbuffers number and excess buffers will be
+* just lower the req_nbuffers number and excess buffers will be
 * thrown away as they are returned to the free list.  Credits
 * then get adjusted as well.
+* If we already have enough buffers allocated to serve the
+* increase requested, then we can treat that the same way as we
+* do the decrease.
 */
-   if (nbufs <= rbp->rbp_nbuffers) {
-   lnet_net_lock(cpt);
-   rbp->rbp_nbuffers = nbufs;
+   num_rb = nbufs - rbp->rbp_nbuffers;
+   if (nbufs <= rbp->rbp_req_nbuffers || num_rb <= 0) {
+   rbp->rbp_req_nbuffers = nbufs;
lnet_net_unlock(cpt);
return 0;
}
+   /*
+* store the older value of rbp_req_nbuffers and then set it to
+

[PATCH 17/24] staging: lustre: prevent assert on LNet module unload

2016-02-22 Thread James Simmons
From: Amir Shehata 

There is a use case where lnet can be unloaded while there are
no NIs configured.  Removing lnet in this case will cause
LNetFini() to be called without a prior call to LNetNIFini().
This will cause the LASSERT(the_lnet.ln_refcount == 0) to be
triggered.

To deal with this use case when LNet is configured a reference
count on the module is taken using try_module_get().  This way
LNet must be unconfigured before it could be removed; therefore
avoiding the above case.  When LNet is unconfigured module_put()
is called to return the reference count.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6010
Reviewed-on: http://review.whamcloud.com/13110
Reviewed-by: James Simmons 
Reviewed-by: Doug Oucharek 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/module.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/module.c 
b/drivers/staging/lustre/lnet/lnet/module.c
index 8f053d7..e12fe37 100644
--- a/drivers/staging/lustre/lnet/lnet/module.c
+++ b/drivers/staging/lustre/lnet/lnet/module.c
@@ -53,13 +53,21 @@ lnet_configure(void *arg)
mutex_lock(&lnet_config_mutex);
 
if (!the_lnet.ln_niinit_self) {
+   rc = try_module_get(THIS_MODULE);
+
+   if (rc != 1)
+   goto out;
+
rc = LNetNIInit(LNET_PID_LUSTRE);
if (rc >= 0) {
the_lnet.ln_niinit_self = 1;
rc = 0;
+   } else {
+   module_put(THIS_MODULE);
}
}
 
+out:
mutex_unlock(&lnet_config_mutex);
return rc;
 }
@@ -74,6 +82,7 @@ lnet_unconfigure(void)
if (the_lnet.ln_niinit_self) {
the_lnet.ln_niinit_self = 0;
LNetNIFini();
+   module_put(THIS_MODULE);
}
 
mutex_lock(&the_lnet.ln_api_mutex);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/24] staging: lustre: avoid race during lnet acceptor thread termination

2016-02-22 Thread James Simmons
From: Bruno Faccini 

This patch will avoid potential race, around socket sleepers
wait list, during acceptor thread termination and using
sk_callback_lock RW-Lock protection.

Signed-off-by: Bruno Faccini 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6476
Reviewed-on: http://review.whamcloud.com/14503
Reviewed-by: Amir Shehata 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/acceptor.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c 
b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 8f9876b..3468433 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -488,11 +488,17 @@ lnet_acceptor_start(void)
 void
 lnet_acceptor_stop(void)
 {
+   struct sock *sk;
+
if (lnet_acceptor_state.pta_shutdown) /* not running */
return;
 
lnet_acceptor_state.pta_shutdown = 1;
-   wake_up_all(sk_sleep(lnet_acceptor_state.pta_sock->sk));
+
+   sk = lnet_acceptor_state.pta_sock->sk;
+
+   /* awake any sleepers using safe method */
+   sk->sk_state_change(sk);
 
/* block until acceptor signals exit */
wait_for_completion(&lnet_acceptor_state.pta_signal);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/24] staging: lustre: improvement to router checker

2016-02-22 Thread James Simmons
From: Amir Shehata 

This patch starts router checker thread all the time.

The router checker only checks routes by ping if
live_router_check_interval or dead_router_check_interval are set
to something other than 0, and there are routes configured.

If these conditions are not met the router checker sleeps until woken
up when a route is added.  It is also woken up whenever the RC is
being stopped to ensure the thread doesn't hang.

In the future when DLC starts configuring the live and dead
router_check_interval parameters, then by manipulating them
the router checker can be turned on and off by the user.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6003
Reviewed-on: http://review.whamcloud.com/13035
Reviewed-by: Liang Zhen 
Reviewed-by: Doug Oucharek 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |7 +++
 drivers/staging/lustre/lnet/lnet/api-ni.c  |1 +
 drivers/staging/lustre/lnet/lnet/router.c  |   51 +---
 3 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h 
b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index e4a8f6e..06d4656 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -635,6 +635,13 @@ typedef struct {
 */
bool  ln_nis_from_mod_params;
 
+   /*
+* waitq for router checker.  As long as there are no routes in
+* the list, the router checker will sleep on this queue.  when
+* routes are added the thread will wake up
+*/
+   wait_queue_head_t ln_rc_waitq;
+
 } lnet_t;
 
 #endif
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index ed121a8..0ec656a 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -98,6 +98,7 @@ lnet_init_locks(void)
 {
spin_lock_init(&the_lnet.ln_eq_wait_lock);
init_waitqueue_head(&the_lnet.ln_eq_waitq);
+   init_waitqueue_head(&the_lnet.ln_rc_waitq);
mutex_init(&the_lnet.ln_lnd_mutex);
mutex_init(&the_lnet.ln_api_mutex);
 }
diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
b/drivers/staging/lustre/lnet/lnet/router.c
index 511e446..ad9cd44 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -405,6 +405,9 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t 
gateway,
if (rnet != rnet2)
LIBCFS_FREE(rnet, sizeof(*rnet));
 
+   /* indicate to startup the router checker if configured */
+   wake_up(&the_lnet.ln_rc_waitq);
+
return rc;
 }
 
@@ -1056,11 +1059,6 @@ lnet_router_checker_start(void)
return -EINVAL;
}
 
-   if (!the_lnet.ln_routing &&
-   live_router_check_interval <= 0 &&
-   dead_router_check_interval <= 0)
-   return 0;
-
sema_init(&the_lnet.ln_rc_signal, 0);
/*
 * EQ size doesn't matter; the callback is guaranteed to get every
@@ -1109,6 +1107,8 @@ lnet_router_checker_stop(void)
 
LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING);
the_lnet.ln_rc_state = LNET_RC_STATE_STOPPING;
+   /* wakeup the RC thread if it's sleeping */
+   wake_up(&the_lnet.ln_rc_waitq);
 
/* block until event callback signals exit */
down(&the_lnet.ln_rc_signal);
@@ -1199,6 +1199,33 @@ lnet_prune_rc_data(int wait_unlink)
lnet_net_unlock(LNET_LOCK_EX);
 }
 
+/*
+ * This function is called to check if the RC should block indefinitely.
+ * It's called from lnet_router_checker() as well as being passed to
+ * wait_event_interruptible() to avoid the lost wake_up problem.
+ *
+ * When it's called from wait_event_interruptible() it is necessary to
+ * also not sleep if the rc state is not running to avoid a deadlock
+ * when the system is shutting down
+ */
+static inline bool
+lnet_router_checker_active(void)
+{
+   if (the_lnet.ln_rc_state != LNET_RC_STATE_RUNNING)
+   return true;
+
+   /*
+* Router Checker thread needs to run when routing is enabled in
+* order to call lnet_update_ni_status_locked()
+*/
+   if (the_lnet.ln_routing)
+   return true;
+
+   return !list_empty(&the_lnet.ln_routers) &&
+   (live_router_check_interval > 0 ||
+dead_router_check_interval > 0);
+}
+
 static int
 lnet_router_checker(void *arg)
 {
@@ -1252,8 +1279,18 @@ rescan:
 * because kernel counts # active tasks as nr_running
 * + nr_uninterruptible.
 */
-   set_current_state(TASK_INTERRUPTIBLE);
-   schedule_timeout(cfs_time_seconds(1));
+   /*
+* if there are any routes th

[PATCH 11/24] staging: lustre: startup lnet acceptor thread dynamically

2016-02-22 Thread James Simmons
From: Amir Shehata 

With DLC it's possible to start up a system with no NIs that require
the acceptor thread, and thus it won't start.  Later on the user
can add an NI that requires the acceptor thread to start, it is
then necessary to start it up.

If the user removes a NI and as a result there are no more
NIs that require the acceptor thread then it should be stopped.
This patch adds logic in the dynamically adding and removing NIs
code to ensure the above logic is implemented.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6002
Reviewed-on: http://review.whamcloud.com/13010
Reviewed-by: Isaac Huang 
Reviewed-by: Doug Oucharek 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/acceptor.c |   10 --
 drivers/staging/lustre/lnet/lnet/api-ni.c   |   14 ++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c 
b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 07df727..9fe3ff7 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -46,7 +46,9 @@ static struct {
int pta_shutdown;
struct socket   *pta_sock;
struct completion   pta_signal;
-} lnet_acceptor_state;
+} lnet_acceptor_state = {
+   .pta_shutdown = 1
+};
 
 int
 lnet_acceptor_port(void)
@@ -444,6 +446,10 @@ lnet_acceptor_start(void)
long rc2;
long secure;
 
+   /* if acceptor is already running return immediately */
+   if (!lnet_acceptor_state.pta_shutdown)
+   return 0;
+
LASSERT(!lnet_acceptor_state.pta_sock);
 
rc = lnet_acceptor_get_tunables();
@@ -484,7 +490,7 @@ lnet_acceptor_start(void)
 void
 lnet_acceptor_stop(void)
 {
-   if (!lnet_acceptor_state.pta_sock) /* not running */
+   if (lnet_acceptor_state.pta_shutdown) /* not running */
return;
 
lnet_acceptor_state.pta_shutdown = 1;
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index f223d5d..9497ce1 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1785,6 +1785,16 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
if (rc)
goto failed1;
 
+   if (ni->ni_lnd->lnd_accept) {
+   rc = lnet_acceptor_start();
+   if (rc < 0) {
+   /* shutdown the ni that we just started */
+   CERROR("Failed to start up acceptor thread\n");
+   lnet_shutdown_lndni(ni);
+   goto failed1;
+   }
+   }
+
lnet_ping_target_update(pinfo, md_handle);
mutex_unlock(&the_lnet.ln_api_mutex);
 
@@ -1832,6 +1842,10 @@ lnet_dyn_del_ni(__u32 net)
lnet_ni_decref_locked(ni, 0);
 
lnet_shutdown_lndni(ni);
+
+   if (!lnet_count_acceptor_nis())
+   lnet_acceptor_stop();
+
lnet_ping_target_update(pinfo, md_handle);
goto out;
 failed:
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/24] staging: lustre: handle lnet_check_routes() errors

2016-02-22 Thread James Simmons
From: Amir Shehata 

After adding a route, lnet_check_routes() is called to ensure that
the route added doesn't invalidate the routing configuration.  If
lnet_check_routes() fails then the route just added, which caused the
current configuration to be invalidated is deleted, and an error
is returned to the user.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6218
Reviewed-on: http://review.whamcloud.com/13445
Reviewed-by: Liang Zhen 
Reviewed-by: Doug Oucharek 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index ccd7dcd..ed121a8 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1907,8 +1907,14 @@ LNetCtl(unsigned int cmd, void *arg)
config->cfg_config_u.cfg_route.rtr_hop,
config->cfg_nid,

config->cfg_config_u.cfg_route.rtr_priority);
+   if (!rc) {
+   rc = lnet_check_routes();
+   if (rc)
+   lnet_del_route(config->cfg_net,
+  config->cfg_nid);
+   }
mutex_unlock(&the_lnet.ln_api_mutex);
-   return rc ? rc : lnet_check_routes();
+   return rc;
 
case IOC_LIBCFS_DEL_ROUTE:
config = arg;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 21/24] staging: lustre: use sock.h in only acceptor.c

2016-02-22 Thread James Simmons
On some platforms having sock.h in lib-types.h would collide with
other included header files being used in the LNet layer. Looking
at what was needed from sock.h only acceptor.c is dependent on it.
To avoid these issues we just use sock.h only in acceptor.c.

Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6763
Reviewed-on: http://review.whamcloud.com/15386
Reviewed-by: Chris Horn 
Reviewed-by: Amir Shehata 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/lnet/lib-types.h  |1 -
 drivers/staging/lustre/lnet/lnet/acceptor.c|1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h 
b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index f588e06..c10f03b 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "types.h"
 
diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c 
b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 3468433..1452bb3 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -36,6 +36,7 @@
 
 #define DEBUG_SUBSYSTEM S_LNET
 #include 
+#include 
 #include "../../include/linux/lnet/lib-lnet.h"
 
 static int   accept_port= 988;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/24] staging: lustre: make some lnet functions static

2016-02-22 Thread James Simmons
From: Frank Zago 

Some functions and variables are only used in their C file, so reduce
their scope. This reduces the code size, and fixes sparse warnings
such as:

warning: symbol 'proc_lnet_routes' was not declared.
Should it be static?
warning: symbol 'proc_lnet_routers' was not declared.
Should it be static?

Some prototypes were removed from C files and added to the proper
header.

Signed-off-by: Frank Zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12206
Reviewed-by: James Simmons 
Reviewed-by: John L. Hammond 
Reviewed-by: Andreas Dilger 
---
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |2 ++
 drivers/staging/lustre/lnet/lnet/router_proc.c |2 --
 drivers/staging/lustre/lnet/selftest/console.c |4 +---
 drivers/staging/lustre/lnet/selftest/framework.c   |   10 --
 drivers/staging/lustre/lnet/selftest/module.c  |4 +---
 drivers/staging/lustre/lnet/selftest/rpc.c |2 +-
 6 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 2ee3d73..0928bc9 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -448,6 +448,8 @@ lnet_ni_t *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
 lnet_ni_t *lnet_net2ni_locked(__u32 net, int cpt);
 lnet_ni_t *lnet_net2ni(__u32 net);
 
+extern int portal_rotor;
+
 int lnet_init(void);
 void lnet_fini(void);
 
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c 
b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 5cb87b8..fc643df 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -800,8 +800,6 @@ static struct lnet_portal_rotorsportal_rotors[] = {
},
 };
 
-extern int portal_rotor;
-
 static int __proc_lnet_portal_rotor(void *data, int write,
loff_t pos, void __user *buffer, int nob)
 {
diff --git a/drivers/staging/lustre/lnet/selftest/console.c 
b/drivers/staging/lustre/lnet/selftest/console.c
index badc696..e8ca1bf 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -1693,8 +1693,6 @@ lstcon_new_session_id(lst_sid_t *sid)
sid->ses_stamp = cfs_time_current();
 }
 
-extern srpc_service_t lstcon_acceptor_service;
-
 int
 lstcon_session_new(char *name, int key, unsigned feats,
   int timeout, int force, lst_sid_t __user *sid_up)
@@ -1973,7 +1971,7 @@ out:
return rc;
 }
 
-srpc_service_t lstcon_acceptor_service;
+static srpc_service_t lstcon_acceptor_service;
 static void lstcon_init_acceptor_service(void)
 {
/* initialize selftest console acceptor service table */
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c 
b/drivers/staging/lustre/lnet/selftest/framework.c
index 7eca046..3bbc720 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -1629,16 +1629,6 @@ static srpc_service_t sfw_services[] = {
}
 };
 
-extern sfw_test_client_ops_t ping_test_client;
-extern srpc_service_t  ping_test_service;
-extern void ping_init_test_client(void);
-extern void ping_init_test_service(void);
-
-extern sfw_test_client_ops_t brw_test_client;
-extern srpc_service_t  brw_test_service;
-extern void brw_init_test_client(void);
-extern void brw_init_test_service(void);
-
 int
 sfw_startup(void)
 {
diff --git a/drivers/staging/lustre/lnet/selftest/module.c 
b/drivers/staging/lustre/lnet/selftest/module.c
index c4bf442..cbb7884 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -37,6 +37,7 @@
 #define DEBUG_SUBSYSTEM S_LNET
 
 #include "selftest.h"
+#include "console.h"
 
 enum {
LST_INIT_NONE = 0,
@@ -47,9 +48,6 @@ enum {
LST_INIT_CONSOLE
 };
 
-extern int lstcon_console_init(void);
-extern int lstcon_console_fini(void);
-
 static int lst_init_step = LST_INIT_NONE;
 
 struct cfs_wi_sched *lst_sched_serial;
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c 
b/drivers/staging/lustre/lnet/selftest/rpc.c
index 4213198..1b76933 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -1097,7 +1097,7 @@ srpc_client_rpc_expired(void *data)
spin_unlock(&srpc_data.rpc_glock);
 }
 
-inline void
+static void
 srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 {
stt_timer_t *timer = &rpc->crpc_timer;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/24] staging: lustre: make local functions static for LNet ni

2016-02-22 Thread James Simmons
From: Frank Zago 

The function lnet_unprepare can be made static.

Signed-off-by: Frank Zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11306
Reviewed-by: James Simmons 
Reviewed-by: Patrick Farrell 
Reviewed-by: Amir Shehata 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index fa65797..7583ae4 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -525,7 +525,7 @@ lnet_res_lh_initialize(struct lnet_res_container *rec, 
lnet_libhandle_t *lh)
list_add(&lh->lh_hash_chain, &rec->rec_lh_hash[hash]);
 }
 
-int lnet_unprepare(void);
+static int lnet_unprepare(void);
 
 static int
 lnet_prepare(lnet_pid_t requested_pid)
@@ -611,7 +611,7 @@ lnet_prepare(lnet_pid_t requested_pid)
return rc;
 }
 
-int
+static int
 lnet_unprepare(void)
 {
/*
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/24] staging: lustre: missed a few cases of using NULL instead of 0

2016-02-22 Thread James Simmons
From: Frank Zago 

It is preferable to use NULL instead of 0 for pointers. This fixes sparse
warnings such as:

lustre/fld/fld_request.c:126:17: warning: Using plain integer as NULL pointer

The second parameter of class_match_param() was changed to a const, to
be able to remove a cast in one user, to prevent splitting a long
line. No other code change.

Signed-off-by: Frank Zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12567
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Bob Glossman 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c  |2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c|2 +-
 .../staging/lustre/lustre/obdclass/obd_config.c|4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 3b7bc36..f223d5d 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -904,7 +904,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, 
lnet_handle_md_t *md_handle,
 {
lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY};
lnet_handle_me_t me_handle;
-   lnet_md_t md = {0};
+   lnet_md_t md = { NULL };
int rc, rc2;
 
if (set_eq) {
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4de085d..2440b07 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1940,7 +1940,7 @@ int ll_prep_inode(struct inode **inode, struct 
ptlrpc_request *req,
  struct super_block *sb, struct lookup_intent *it)
 {
struct ll_sb_info *sbi = NULL;
-   struct lustre_md md;
+   struct lustre_md md = { NULL };
int rc;
 
LASSERT(*inode || sb);
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c 
b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index c4128ac..6417946 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(class_find_param);
 
 /* returns 0 if this is the first key in the buffer, else 1.
valp points to first char after key. */
-static int class_match_param(char *buf, char *key, char **valp)
+static int class_match_param(char *buf, const char *key, char **valp)
 {
if (!buf)
return 1;
@@ -1008,7 +1008,7 @@ int class_process_proc_param(char *prefix, struct 
lprocfs_vars *lvars,
/* Search proc entries */
while (lvars[j].name) {
var = &lvars[j];
-   if (class_match_param(key, (char *)var->name, NULL) == 0
+   if (!class_match_param(key, var->name, NULL)
&& keylen == strlen(var->name)) {
matched++;
rc = -EROFS;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/24] staging: lustre: Dynamic LNet Configuration (DLC) show command

2016-02-22 Thread James Simmons
From: Amir Shehata 

This is the fifth patch of a set of patches that enables DLC.

This patch adds the new structures which will be used
in the IOCTL communication.  It also added a set of
show operations to show buffers, networks, statistics
and peer information.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456
Reviewed-on: http://review.whamcloud.com/8022
Reviewed-by: John L. Hammond 
Reviewed-by: Doug Oucharek 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |   26 -
 .../staging/lustre/include/linux/lnet/lib-dlc.h|  122 
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |5 +
 drivers/staging/lustre/lnet/lnet/api-ni.c  |   56 -
 drivers/staging/lustre/lnet/lnet/module.c  |4 +
 drivers/staging/lustre/lnet/lnet/peer.c|   61 ++
 .../lustre/lustre/libcfs/linux/linux-module.c  |3 +-
 drivers/staging/lustre/lustre/libcfs/module.c  |   15 ++-
 8 files changed, 277 insertions(+), 15 deletions(-)
 create mode 100644 drivers/staging/lustre/include/linux/lnet/lib-dlc.h

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index 0598702..f788631 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -41,7 +41,8 @@
 #ifndef __LIBCFS_IOCTL_H__
 #define __LIBCFS_IOCTL_H__
 
-#define LIBCFS_IOCTL_VERSION 0x0001000a
+#define LIBCFS_IOCTL_VERSION   0x0001000a
+#define LIBCFS_IOCTL_VERSION2  0x0001000b
 
 struct libcfs_ioctl_hdr {
__u32 ioc_len;
@@ -111,9 +112,6 @@ struct libcfs_ioctl_handler {
 /* lnet ioctls */
 #define IOC_LIBCFS_GET_NI_IOWR('e', 50, long)
 #define IOC_LIBCFS_FAIL_NID_IOWR('e', 51, long)
-#define IOC_LIBCFS_ADD_ROUTE  _IOWR('e', 52, long)
-#define IOC_LIBCFS_DEL_ROUTE  _IOWR('e', 53, long)
-#define IOC_LIBCFS_GET_ROUTE  _IOWR('e', 54, long)
 #define IOC_LIBCFS_NOTIFY_ROUTER  _IOWR('e', 55, long)
 #define IOC_LIBCFS_UNCONFIGURE  _IOWR('e', 56, long)
 /* #define IOC_LIBCFS_PORTALS_COMPATIBILITY   _IOWR('e', 57, long) */
@@ -136,7 +134,25 @@ struct libcfs_ioctl_handler {
 #define IOC_LIBCFS_DEL_INTERFACE  _IOWR('e', 79, long)
 #define IOC_LIBCFS_GET_INTERFACE  _IOWR('e', 80, long)
 
-#define IOC_LIBCFS_MAX_NR   80
+/*
+ * DLC Specific IOCTL numbers.
+ * In order to maintain backward compatibility with any possible external
+ * tools which might be accessing the IOCTL numbers, a new group of IOCTL
+ * number have been allocated.
+ */
+#define IOCTL_CONFIG_SIZE  struct lnet_ioctl_config_data
+#define IOC_LIBCFS_ADD_ROUTE   _IOWR(IOC_LIBCFS_TYPE, 81, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_DEL_ROUTE   _IOWR(IOC_LIBCFS_TYPE, 82, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_GET_ROUTE   _IOWR(IOC_LIBCFS_TYPE, 83, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_ADD_NET _IOWR(IOC_LIBCFS_TYPE, 84, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_DEL_NET _IOWR(IOC_LIBCFS_TYPE, 85, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_GET_NET _IOWR(IOC_LIBCFS_TYPE, 86, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_CONFIG_RTR  _IOWR(IOC_LIBCFS_TYPE, 87, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_ADD_BUF _IOWR(IOC_LIBCFS_TYPE, 88, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_GET_BUF _IOWR(IOC_LIBCFS_TYPE, 89, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_GET_PEER_INFO   _IOWR(IOC_LIBCFS_TYPE, 90, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_GET_LNET_STATS  _IOWR(IOC_LIBCFS_TYPE, 91, 
IOCTL_CONFIG_SIZE)
+#define IOC_LIBCFS_MAX_NR  91
 
 static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
 {
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h 
b/drivers/staging/lustre/include/linux/lnet/lib-dlc.h
new file mode 100644
index 000..84a19e9
--- /dev/null
+++ b/drivers/staging/lustre/include/linux/lnet/lib-dlc.h
@@ -0,0 +1,122 @@
+/*
+ * LGPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.
+ *
+ * LGPL HEADER END
+ *
+ */
+/*
+ * Copyright (c) 2014, Intel Corporation.
+ */
+/*
+ * Author: Amir Shehat

[PATCH 03/24] staging: lustre: fix crash due to NULL networks string

2016-02-22 Thread James Simmons
From: Amir Shehata 

If there is an invalid networks or ip2nets lnet_parse_networks()
gets called with a NULL 'network' string parameter

lnet_parse_networks() needs to sanitize its input string now that
it's being called from multiple places.  Instead, check for
a NULL string everytime the function is called, which reduces the
probability of errors with other code modifications.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5540
Reviewed-on: http://review.whamcloud.com/11626
Reviewed-by: Isaac Huang 
Reviewed-by: Doug Oucharek 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |5 +
 drivers/staging/lustre/lnet/lnet/config.c |9 -
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index b2b914a..c68d01e 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1535,7 +1535,6 @@ LNetNIInit(lnet_pid_t requested_pid)
lnet_ping_info_t *pinfo;
lnet_handle_md_t md_handle;
struct list_head net_head;
-   char *nets;
 
INIT_LIST_HEAD(&net_head);
 
@@ -1550,13 +1549,11 @@ LNetNIInit(lnet_pid_t requested_pid)
return rc;
}
 
-   nets = lnet_get_networks();
-
rc = lnet_prepare(requested_pid);
if (rc)
goto failed0;
 
-   rc = lnet_parse_networks(&net_head, nets);
+   rc = lnet_parse_networks(&net_head, lnet_get_networks());
if (rc < 0)
goto failed1;
 
diff --git a/drivers/staging/lustre/lnet/lnet/config.c 
b/drivers/staging/lustre/lnet/lnet/config.c
index 1ef07cd..013d41b 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -184,7 +184,7 @@ int
 lnet_parse_networks(struct list_head *nilist, char *networks)
 {
struct cfs_expr_list *el = NULL;
-   int tokensize = strlen(networks) + 1;
+   int tokensize;
char *tokens;
char *str;
char *tmp;
@@ -192,6 +192,11 @@ lnet_parse_networks(struct list_head *nilist, char 
*networks)
__u32 net;
int nnets = 0;
 
+   if (!networks) {
+   CERROR("networks string is undefined\n");
+   return -EINVAL;
+   }
+
if (strlen(networks) > LNET_SINGLE_TEXTBUF_NOB) {
/* _WAY_ conservative */
LCONSOLE_ERROR_MSG(0x112,
@@ -199,6 +204,8 @@ lnet_parse_networks(struct list_head *nilist, char 
*networks)
return -EINVAL;
}
 
+   tokensize = strlen(networks) + 1;
+
LIBCFS_ALLOC(tokens, tokensize);
if (!tokens) {
CERROR("Can't allocate net tokens\n");
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/24] staging: lustre: return appropriate errno when adding route

2016-02-22 Thread James Simmons
From: Amir Shehata 

When adding route it ignored specific scenarios, namely:
1. route already exists
2. route is on a local net
3. route is unreacheable

This patch returns the appropriate return codes from the lower level
function lnet_add_route(), and then ignores the above case from the
calling function, lnet_parse_route().  This is needed so we don't
halt processing routes in the module parameters.

However, we can now add routes dynamically, and it should be returned
to the user whether adding the requested route succeeded or failed.

In userspace it is determined whether to continue adding routes or to
halt processing.  Currently "lnetctl import < config" continues
adding the rest of the configuration and reports at the end which
operations passed and which ones failed.

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6045
Reviewed-on: http://review.whamcloud.com/13116
Reviewed-by: James Simmons 
Reviewed-by: Doug Oucharek 
Reviewed-by: Isaac Huang 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/config.c |2 +-
 drivers/staging/lustre/lnet/lnet/router.c |   11 +++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/config.c 
b/drivers/staging/lustre/lnet/lnet/config.c
index c04a0ef..8c80625 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -769,7 +769,7 @@ lnet_parse_route(char *str, int *im_a_router)
}
 
rc = lnet_add_route(net, hops, nid, priority);
-   if (rc) {
+   if (rc && rc != -EEXIST && rc != -EHOSTUNREACH) {
CERROR("Can't create route to %s via %s\n",
   libcfs_net2str(net),
   libcfs_nid2str(nid));
diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
b/drivers/staging/lustre/lnet/lnet/router.c
index d748931..511e446 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -317,7 +317,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t 
gateway,
return -EINVAL;
 
if (lnet_islocalnet(net))  /* it's a local network */
-   return 0;  /* ignore the route entry */
+   return -EEXIST;
 
/* Assume net, route, all new */
LIBCFS_ALLOC(route, sizeof(*route));
@@ -348,7 +348,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t 
gateway,
LIBCFS_FREE(rnet, sizeof(*rnet));
 
if (rc == -EHOSTUNREACH) /* gateway is not on a local net */
-   return 0;   /* ignore the route entry */
+   return rc;  /* ignore the route entry */
CERROR("Error %d creating route %s %d %s\n", rc,
   libcfs_net2str(net), hops,
   libcfs_nid2str(gateway));
@@ -395,14 +395,17 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t 
gateway,
/* -1 for notify or !add_route */
lnet_peer_decref_locked(route->lr_gateway);
lnet_net_unlock(LNET_LOCK_EX);
+   rc = 0;
 
-   if (!add_route)
+   if (!add_route) {
+   rc = -EEXIST;
LIBCFS_FREE(route, sizeof(*route));
+   }
 
if (rnet != rnet2)
LIBCFS_FREE(rnet, sizeof(*rnet));
 
-   return 0;
+   return rc;
 }
 
 int
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/24] staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes

2016-02-22 Thread James Simmons
From: Amir Shehata 

This is the fourth patch of a set of patches that enables DLC.

This patch changes the IOCTL infrastructure in preparation of
adding extra IOCTL communication between user and kernel space.
The changes include:
- adding a common header to be passed to ioctl infra functions
  instead of passing an exact structure.  This header is meant
  to be included in all structures to be passed through that
  interface.  The IOCTL handler casts this header to a particular
  type that it expects
- All sanity testing on the past in structure is performed in the
  generic ioctl infrastructure code.
- All ioctl handlers changed to take the header instead of a
  particular structure type

Signed-off-by: Amir Shehata 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456
Reviewed-on: http://review.whamcloud.com/8021
Reviewed-by: Doug Oucharek 
Reviewed-by: James Simmons 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |   23 
 drivers/staging/lustre/lnet/lnet/module.c  |4 +-
 drivers/staging/lustre/lnet/selftest/conctl.c  |9 +++-
 drivers/staging/lustre/lnet/selftest/console.c |2 +-
 drivers/staging/lustre/lnet/selftest/console.h |1 -
 .../lustre/lustre/libcfs/linux/linux-module.c  |   54 
 drivers/staging/lustre/lustre/libcfs/module.c  |   51 +-
 7 files changed, 80 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index e4463ad..0598702 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -43,9 +43,13 @@
 
 #define LIBCFS_IOCTL_VERSION 0x0001000a
 
-struct libcfs_ioctl_data {
+struct libcfs_ioctl_hdr {
__u32 ioc_len;
__u32 ioc_version;
+};
+
+struct libcfs_ioctl_data {
+   struct libcfs_ioctl_hdr ioc_hdr;
 
__u64 ioc_nid;
__u64 ioc_u64[1];
@@ -70,11 +74,6 @@ struct libcfs_ioctl_data {
 
 #define ioc_priority ioc_u32[0]
 
-struct libcfs_ioctl_hdr {
-   __u32 ioc_len;
-   __u32 ioc_version;
-};
-
 struct libcfs_debug_ioctl_data {
struct libcfs_ioctl_hdr hdr;
unsigned int subs;
@@ -90,7 +89,7 @@ do {  \
 
 struct libcfs_ioctl_handler {
struct list_head item;
-   int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_data *data);
+   int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_hdr *hdr);
 };
 
 #define DECLARE_IOCTL_HANDLER(ident, func)   \
@@ -148,9 +147,9 @@ static inline int libcfs_ioctl_packlen(struct 
libcfs_ioctl_data *data)
return len;
 }
 
-static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data)
+static inline bool libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data)
 {
-   if (data->ioc_len > (1<<30)) {
+   if (data->ioc_hdr.ioc_len > (1 << 30)) {
CERROR("LIBCFS ioctl: ioc_len larger than 1<<30\n");
return 1;
}
@@ -186,7 +185,7 @@ static inline int libcfs_ioctl_is_invalid(struct 
libcfs_ioctl_data *data)
CERROR("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n");
return 1;
}
-   if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len) {
+   if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_hdr.ioc_len) {
CERROR("LIBCFS ioctl: packlen != ioc_len\n");
return 1;
}
@@ -206,7 +205,9 @@ static inline int libcfs_ioctl_is_invalid(struct 
libcfs_ioctl_data *data)
 
 int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand);
 int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand);
-int libcfs_ioctl_getdata(char *buf, char *end, void __user *arg);
+int libcfs_ioctl_getdata_len(const struct libcfs_ioctl_hdr __user *arg,
+__u32 *buf_len);
 int libcfs_ioctl_popdata(void __user *arg, void *buf, int size);
+int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
 
 #endif /* __LIBCFS_IOCTL_H__ */
diff --git a/drivers/staging/lustre/lnet/lnet/module.c 
b/drivers/staging/lustre/lnet/lnet/module.c
index cd37303..46f5241 100644
--- a/drivers/staging/lustre/lnet/lnet/module.c
+++ b/drivers/staging/lustre/lnet/lnet/module.c
@@ -84,7 +84,7 @@ lnet_unconfigure(void)
 }
 
 static int
-lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_data *data)
+lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_hdr *hdr)
 {
int rc;
 
@@ -103,7 +103,7 @@ lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_data *data)
 */
rc = LNetNIInit(LNET_PID_ANY);
if (rc >= 0) {
-   rc = LNetCtl(cmd, data);
+   rc = LNetCtl(cmd, hdr);
LNetNIFini();
}
return rc;
diff --git a/drivers/staging/lustre/l

[PATCH 00/24] Second batch of LNet updates

2016-02-22 Thread James Simmons
This patch set fixes many of the LNet issues encounter run in
production environments. One of the long standing issues was
not being able to reconfigure LNet after initialization. Doing
so left it in a broken state. Several other issues are also
addressed in this patch set. Merged back into this patch set
are also the suggestions for improvement from Dan Carpenter
when the original patch set was posted.

Amir Shehata (14):
  staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes
  staging: lustre: Dynamic LNet Configuration (DLC) show command
  staging: lustre: fix crash due to NULL networks string
  staging: lustre: DLC user/kernel space glue code
  staging: lustre: improve LNet clean up code and API
  staging: lustre: return appropriate errno when adding route
  staging: lustre: startup lnet acceptor thread dynamically
  staging: lustre: reject invalid net configuration for lnet
  staging: lustre: return -EEXIST if NI is not unique
  staging: lustre: handle lnet_check_routes() errors
  staging: lustre: improvement to router checker
  staging: lustre: prevent assert on LNet module unload
  staging: lustre: remove messages from lazy portal on NI shutdown
  staging: lustre: Allocate the correct number of rtr buffers

Bruno Faccini (1):
  staging: lustre: avoid race during lnet acceptor thread termination

Chris Horn (1):
  staging: lustre: Use lnet_is_route_alive for router aliveness

Doug Oucharek (1):
  staging: lustre: Remove LASSERTS from router checker

Frank Zago (4):
  staging: lustre: make local functions static for LNet ni
  staging: lustre: make some lnet functions static
  staging: lustre: missed a few cases of using NULL instead of 0
  staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer

James Simmons (1):
  staging: lustre: use sock.h in only acceptor.c

John L. Hammond (2):
  staging: lustre: remove LUSTRE_{,SRV_}LNET_PID
  staging: lustre: assume a kernel build

 .../staging/lustre/include/linux/libcfs/libcfs.h   |2 -
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |   49 +-
 .../lustre/include/linux/libcfs/linux/libcfs.h |3 -
 .../staging/lustre/include/linux/lnet/lib-dlc.h|  122 
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |   22 +
 .../staging/lustre/include/linux/lnet/lib-types.h  |   25 +-
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c|7 +-
 drivers/staging/lustre/lnet/lnet/acceptor.c|   21 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c  |  761 +---
 drivers/staging/lustre/lnet/lnet/config.c  |   25 +-
 drivers/staging/lustre/lnet/lnet/lib-eq.c  |3 -
 drivers/staging/lustre/lnet/lnet/lib-md.c  |3 -
 drivers/staging/lustre/lnet/lnet/lib-me.c  |3 -
 drivers/staging/lustre/lnet/lnet/lib-move.c|   10 +-
 drivers/staging/lustre/lnet/lnet/lib-msg.c |   20 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c |   54 +-
 drivers/staging/lustre/lnet/lnet/lib-socket.c  |3 -
 drivers/staging/lustre/lnet/lnet/module.c  |   81 ++-
 drivers/staging/lustre/lnet/lnet/peer.c|   63 ++
 drivers/staging/lustre/lnet/lnet/router.c  |  181 --
 drivers/staging/lustre/lnet/lnet/router_proc.c |2 -
 drivers/staging/lustre/lnet/selftest/conctl.c  |9 +-
 drivers/staging/lustre/lnet/selftest/console.c |6 +-
 drivers/staging/lustre/lnet/selftest/console.h |1 -
 drivers/staging/lustre/lnet/selftest/framework.c   |   10 -
 drivers/staging/lustre/lnet/selftest/module.c  |4 +-
 drivers/staging/lustre/lnet/selftest/rpc.c |4 +-
 .../lustre/lustre/libcfs/linux/linux-module.c  |   55 +-
 drivers/staging/lustre/lustre/libcfs/module.c  |   58 ++-
 drivers/staging/lustre/lustre/llite/llite_lib.c|2 +-
 .../staging/lustre/lustre/obdclass/obd_config.c|4 +-
 drivers/staging/lustre/lustre/ptlrpc/events.c  |4 +-
 32 files changed, 1122 insertions(+), 495 deletions(-)
 create mode 100644 drivers/staging/lustre/include/linux/lnet/lib-dlc.h

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


  1   2   >