Re: [staging:staging-testing 959/962] drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit declaration of function 'memset'
On Wed, Sep 30, 2015 at 3:01 PM, Greg Kroah-Hartman wrote: > On Wed, Sep 30, 2015 at 01:15:51PM +0800, kbuild test robot wrote: >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git >> staging-testing >> head: 7477929566b65f692b79974b784ee59e8b2b9f18 >> commit: e215a871255f9256de77e1b9c32b84d3a80122c1 [959/962] staging: >> wilc1000: remove wilc_platform include file >> config: openrisc-allmodconfig (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 >> git checkout e215a871255f9256de77e1b9c32b84d3a80122c1 >> # save the attached .config to linux build tree >> make.cross ARCH=openrisc >> >> All error/warnings (new ones prefixed by >>): >> >>drivers/staging/wilc1000/wilc_sdio.c: In function 'sdio_init': >> >> drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit declaration >> >> of function 'memset' >> >> drivers/staging/wilc1000/wilc_sdio.c:584:2: warning: incompatible >> >> implicit declaration of built-in function 'memset' >> -- > > Chaehyun, can you send me a fix-up patch for this? > > thanks, > > greg k-h Dear Greg I'm sorry for the inconvenience of this error. I assume this error occurs due to missing a standard header file as . While trying to compile with the following procedure suggested by kbuild test robot, I got a new error so that I cannot compilation is done. make CROSS_COMPILE=/opt/gcc-4.5.1-nolibc/or32-linux/bin/or32-linux- --jobs=16 ARCH=openrisc rivers/vhost/vhost.c: In function 'vhost_vring_ioctl': drivers/vhost/vhost.c:818:3: error: call to '__compiletime_assert_818' declared with attribute error: BUILD_BUG_ON failed: __alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE Could you please show any guidance as compilation is completely done? Regards Chaehyun Lim ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [staging:staging-testing 959/962] drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit declaration of function 'memset'
On Wed, Sep 30, 2015 at 05:13:43PM +0900, Chaehyun Lim wrote: > On Wed, Sep 30, 2015 at 3:01 PM, Greg Kroah-Hartman > wrote: > > On Wed, Sep 30, 2015 at 01:15:51PM +0800, kbuild test robot wrote: > >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > >> staging-testing > >> head: 7477929566b65f692b79974b784ee59e8b2b9f18 > >> commit: e215a871255f9256de77e1b9c32b84d3a80122c1 [959/962] staging: > >> wilc1000: remove wilc_platform include file > >> config: openrisc-allmodconfig (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 > >> git checkout e215a871255f9256de77e1b9c32b84d3a80122c1 > >> # save the attached .config to linux build tree > >> make.cross ARCH=openrisc > >> > >> All error/warnings (new ones prefixed by >>): > >> > >>drivers/staging/wilc1000/wilc_sdio.c: In function 'sdio_init': > >> >> drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit declaration > >> >> of function 'memset' > >> >> drivers/staging/wilc1000/wilc_sdio.c:584:2: warning: incompatible > >> >> implicit declaration of built-in function 'memset' > >> -- > > > > Chaehyun, can you send me a fix-up patch for this? > > > > thanks, > > > > greg k-h > > Dear Greg > > I'm sorry for the inconvenience of this error. > I assume this error occurs due to missing a standard header file as > . Yes. > While trying to compile with the following procedure suggested by > kbuild test robot, I got a new error so that > I cannot compilation is done. > > make CROSS_COMPILE=/opt/gcc-4.5.1-nolibc/or32-linux/bin/or32-linux- > --jobs=16 ARCH=openrisc > > rivers/vhost/vhost.c: In function 'vhost_vring_ioctl': > drivers/vhost/vhost.c:818:3: error: call to '__compiletime_assert_818' > declared with attribute error: BUILD_BUG_ON failed: __alignof__ > *vq->avail > VRING_AVAIL_ALIGN_SIZE > > Could you please show any guidance as compilation is completely done? Don't worry about trying to build arches like this, if you include the .h file, it should work just fine. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wilc1000: fix build error for openrisc-allmodconfig
The kbuild test robot reports the following build error for openrisc-allmodconfig. >> drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit >> declaration of function 'memset' The error occurs due to missing a standard header file as so that three .c files are included it. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_sdio.c | 1 + drivers/staging/wilc1000/wilc_spi.c | 1 + drivers/staging/wilc1000/wilc_wlan_cfg.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 6da65e8..6e28ca0 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -7,6 +7,7 @@ /* */ /* */ +#include #include "wilc_wlan_if.h" #include "wilc_wlan.h" diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index f762770..0e06fc2 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -7,6 +7,7 @@ /* */ /* */ +#include #include "wilc_wlan_if.h" #include "wilc_wlan.h" diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c index 73a1508..d761a37 100644 --- a/drivers/staging/wilc1000/wilc_wlan_cfg.c +++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c @@ -7,6 +7,7 @@ /* */ /* / */ +#include #include "wilc_wlan_if.h" #include "wilc_wlan.h" #include "wilc_wlan_cfg.h" -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: rtl8712: rtl871x_ioctl_linux.c Move constant to right side of the comparision
On Tue, Sep 29, 2015 at 10:24:59PM +0200, Tillmann Heidsieck wrote: > On Mon, Sep 28, 2015 at 09:56:19AM -0500, Larry Finger wrote: > > The primary requirement for moving a driver out of staging is that it use > > mac80211. No amount of cosmetic fixing will ever make that change for > > rtl8712u! > > As I am pretty sure someone has done something like this before, is > there a best practice write-up on this? Or a driver that is recommended > for usage as a template? That's a good question. The rtl* drivers are basically a dozen copies of the same code. I think we have had a few escape from staging? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/32] staging: wilc1000: remove PLL_WORKAROUND
This patch removes unnecessary definition, PLL_WORKAROUND from the Makefile. There is no use throughout the driver. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index e965df9..d226ebe 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -9,7 +9,7 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ - -DPLL_WORKAROUND -DAGING_ALG \ + -DAGING_ALG \ -Wno-unused-function -DWILC_DEBUGFS #ccflags-y += -DTCP_ACK_FILTER -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/32] staging: wilc1000: remove AGING_ALG
This patch removes AGING_ALG from the Makefile because it is always in use. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/Makefile | 1 - drivers/staging/wilc1000/coreconfigurator.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index d226ebe..f495061 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -9,7 +9,6 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ - -DAGING_ALG \ -Wno-unused-function -DWILC_DEBUGFS #ccflags-y += -DTCP_ACK_FILTER diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 253c7f0..58aa13c 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -96,9 +96,7 @@ typedef struct { unsigned long u32TimeRcvdInScanCached; unsigned long u32TimeRcvdInScan; bool bNewNetwork; -#ifdef AGING_ALG u8 u8Found; -#endif u32 u32Tsf; u8 *pu8IEs; u16 u16IEsLen; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/32] staging: wilc1000: rename strHostIFconnectAttr
This patch renames strHostIFconnectAttr to con_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 32 +++ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a039f04..96f0b69 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -415,7 +415,7 @@ struct sta_inactive_t { */ union message_body { struct scan_attr scan_info; - struct connect_attr strHostIFconnectAttr; + struct connect_attr con_info; struct rcvd_net_info strRcvdNetworkInfo; struct rcvd_async_info strRcvdGnrlAsyncInfo; struct key_attr strHostIFkeyAttr; @@ -4103,7 +4103,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_CONNECT: - Handle_Connect(msg.drvHandler, &msg.body.strHostIFconnectAttr); + Handle_Connect(msg.drvHandler, &msg.body.con_info); break; case HOST_IF_MSG_FLUSH_CONNECT: @@ -5084,32 +5084,32 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid, msg.id = HOST_IF_MSG_CONNECT; - msg.body.strHostIFconnectAttr.u8security = u8security; - msg.body.strHostIFconnectAttr.tenuAuth_type = tenuAuth_type; - msg.body.strHostIFconnectAttr.u8channel = u8channel; - msg.body.strHostIFconnectAttr.pfConnectResult = pfConnectResult; - msg.body.strHostIFconnectAttr.pvUserArg = pvUserArg; - msg.body.strHostIFconnectAttr.pJoinParams = pJoinParams; + msg.body.con_info.u8security = u8security; + msg.body.con_info.tenuAuth_type = tenuAuth_type; + msg.body.con_info.u8channel = u8channel; + msg.body.con_info.pfConnectResult = pfConnectResult; + msg.body.con_info.pvUserArg = pvUserArg; + msg.body.con_info.pJoinParams = pJoinParams; msg.drvHandler = hWFIDrv; if (pu8bssid != NULL) { - msg.body.strHostIFconnectAttr.pu8bssid = kmalloc(6, GFP_KERNEL); /* will be deallocated by the receiving thread */ - memcpy(msg.body.strHostIFconnectAttr.pu8bssid, + msg.body.con_info.pu8bssid = kmalloc(6, GFP_KERNEL); /* will be deallocated by the receiving thread */ + memcpy(msg.body.con_info.pu8bssid, pu8bssid, 6); } if (pu8ssid != NULL) { - msg.body.strHostIFconnectAttr.ssidLen = ssidLen; - msg.body.strHostIFconnectAttr.pu8ssid = kmalloc(ssidLen, GFP_KERNEL); /* will be deallocated by the receiving thread */ - memcpy(msg.body.strHostIFconnectAttr.pu8ssid, + msg.body.con_info.ssidLen = ssidLen; + msg.body.con_info.pu8ssid = kmalloc(ssidLen, GFP_KERNEL); /* will be deallocated by the receiving thread */ + memcpy(msg.body.con_info.pu8ssid, pu8ssid, ssidLen); } if (pu8IEs != NULL) { - msg.body.strHostIFconnectAttr.IEsLen = IEsLen; - msg.body.strHostIFconnectAttr.pu8IEs = kmalloc(IEsLen, GFP_KERNEL); /* will be deallocated by the receiving thread */ - memcpy(msg.body.strHostIFconnectAttr.pu8IEs, + msg.body.con_info.IEsLen = IEsLen; + msg.body.con_info.pu8IEs = kmalloc(IEsLen, GFP_KERNEL); /* will be deallocated by the receiving thread */ + memcpy(msg.body.con_info.pu8IEs, pu8IEs, IEsLen); } if (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTING) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/32] staging: wilc1000: rename strHostIFscanAttr
This patch renames strHostIFscanAttr to scan_info in order to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index be01de5..a039f04 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -414,7 +414,7 @@ struct sta_inactive_t { * @version 1.0 */ union message_body { - struct scan_attr strHostIFscanAttr; + struct scan_attr scan_info; struct connect_attr strHostIFconnectAttr; struct rcvd_net_info strRcvdNetworkInfo; struct rcvd_async_info strRcvdGnrlAsyncInfo; @@ -4099,7 +4099,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_SCAN: - Handle_Scan(msg.drvHandler, &msg.body.strHostIFscanAttr); + Handle_Scan(msg.drvHandler, &msg.body.scan_info); break; case HOST_IF_MSG_CONNECT: @@ -5789,26 +5789,26 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, msg.id = HOST_IF_MSG_SCAN; if (pstrHiddenNetwork != NULL) { - msg.body.strHostIFscanAttr.strHiddenNetwork.pstrHiddenNetworkInfo = pstrHiddenNetwork->pstrHiddenNetworkInfo; - msg.body.strHostIFscanAttr.strHiddenNetwork.u8ssidnum = pstrHiddenNetwork->u8ssidnum; + msg.body.scan_info.strHiddenNetwork.pstrHiddenNetworkInfo = pstrHiddenNetwork->pstrHiddenNetworkInfo; + msg.body.scan_info.strHiddenNetwork.u8ssidnum = pstrHiddenNetwork->u8ssidnum; } else PRINT_D(HOSTINF_DBG, "pstrHiddenNetwork IS EQUAL TO NULL\n"); msg.drvHandler = hWFIDrv; - msg.body.strHostIFscanAttr.u8ScanSource = u8ScanSource; - msg.body.strHostIFscanAttr.u8ScanType = u8ScanType; - msg.body.strHostIFscanAttr.pfScanResult = ScanResult; - msg.body.strHostIFscanAttr.pvUserArg = pvUserArg; - - msg.body.strHostIFscanAttr.u8ChnlListLen = u8ChnlListLen; - msg.body.strHostIFscanAttr.pu8ChnlFreqList = kmalloc(u8ChnlListLen, GFP_KERNEL);/* will be deallocated by the receiving thread */ - memcpy(msg.body.strHostIFscanAttr.pu8ChnlFreqList, + msg.body.scan_info.u8ScanSource = u8ScanSource; + msg.body.scan_info.u8ScanType = u8ScanType; + msg.body.scan_info.pfScanResult = ScanResult; + msg.body.scan_info.pvUserArg = pvUserArg; + + msg.body.scan_info.u8ChnlListLen = u8ChnlListLen; + msg.body.scan_info.pu8ChnlFreqList = kmalloc(u8ChnlListLen, GFP_KERNEL);/* will be deallocated by the receiving thread */ + memcpy(msg.body.scan_info.pu8ChnlFreqList, pu8ChnlFreqList, u8ChnlListLen); - msg.body.strHostIFscanAttr.IEsLen = IEsLen; - msg.body.strHostIFscanAttr.pu8IEs = kmalloc(IEsLen, GFP_KERNEL); /* will be deallocated by the receiving thread */ - memcpy(msg.body.strHostIFscanAttr.pu8IEs, + msg.body.scan_info.IEsLen = IEsLen; + msg.body.scan_info.pu8IEs = kmalloc(IEsLen, GFP_KERNEL);/* will be deallocated by the receiving thread */ + memcpy(msg.body.scan_info.pu8IEs, pu8IEs, IEsLen); /* send the message */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/32] staging: wilc1000: rename strRcvdNetworkInfo
This patch renames strRcvdNetworkInfo to net_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 96f0b69..8a93112 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -416,7 +416,7 @@ struct sta_inactive_t { union message_body { struct scan_attr scan_info; struct connect_attr con_info; - struct rcvd_net_info strRcvdNetworkInfo; + struct rcvd_net_info net_info; struct rcvd_async_info strRcvdGnrlAsyncInfo; struct key_attr strHostIFkeyAttr; struct cfg_param_attr strHostIFCfgParamAttr; @@ -4111,7 +4111,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_RCVD_NTWRK_INFO: - Handle_RcvdNtwrkInfo(msg.drvHandler, &msg.body.strRcvdNetworkInfo); + Handle_RcvdNtwrkInfo(msg.drvHandler, &msg.body.net_info); break; case HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO: @@ -6302,9 +6302,9 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length) msg.id = HOST_IF_MSG_RCVD_NTWRK_INFO; msg.drvHandler = pstrWFIDrv; - msg.body.strRcvdNetworkInfo.u32Length = u32Length; - msg.body.strRcvdNetworkInfo.pu8Buffer = kmalloc(u32Length, GFP_KERNEL); /* will be deallocated by the receiving thread */ - memcpy(msg.body.strRcvdNetworkInfo.pu8Buffer, + msg.body.net_info.u32Length = u32Length; + msg.body.net_info.pu8Buffer = kmalloc(u32Length, GFP_KERNEL); /* will be deallocated by the receiving thread */ + memcpy(msg.body.net_info.pu8Buffer, pu8Buffer, u32Length); /* send the message */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/32] staging: wilc1000: rename strRcvdGnrlAsyncInfo
This patch renames strRcvdGnrlAsyncInfo to async_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 8a93112..b24c022 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -417,7 +417,7 @@ union message_body { struct scan_attr scan_info; struct connect_attr con_info; struct rcvd_net_info net_info; - struct rcvd_async_info strRcvdGnrlAsyncInfo; + struct rcvd_async_info async_info; struct key_attr strHostIFkeyAttr; struct cfg_param_attr strHostIFCfgParamAttr; struct set_channel strHostIFSetChan; @@ -4115,7 +4115,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO: - Handle_RcvdGnrlAsyncInfo(msg.drvHandler, &msg.body.strRcvdGnrlAsyncInfo); + Handle_RcvdGnrlAsyncInfo(msg.drvHandler, &msg.body.async_info); break; case HOST_IF_MSG_KEY: @@ -6359,9 +6359,9 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length) msg.drvHandler = pstrWFIDrv; - msg.body.strRcvdGnrlAsyncInfo.u32Length = u32Length; - msg.body.strRcvdGnrlAsyncInfo.pu8Buffer = kmalloc(u32Length, GFP_KERNEL); /* will be deallocated by the receiving thread */ - memcpy(msg.body.strRcvdGnrlAsyncInfo.pu8Buffer, + msg.body.async_info.u32Length = u32Length; + msg.body.async_info.pu8Buffer = kmalloc(u32Length, GFP_KERNEL); /* will be deallocated by the receiving thread */ + memcpy(msg.body.async_info.pu8Buffer, pu8Buffer, u32Length); /* send the message */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/32] staging: wilc1000: rename strHostIFkeyAttr
This patch renames strHostIFkeyAttr to key_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 100 +++--- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b24c022..d4e8122 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -418,7 +418,7 @@ union message_body { struct connect_attr con_info; struct rcvd_net_info net_info; struct rcvd_async_info async_info; - struct key_attr strHostIFkeyAttr; + struct key_attr key_info; struct cfg_param_attr strHostIFCfgParamAttr; struct set_channel strHostIFSetChan; struct get_channel strHostIFGetChan; @@ -4119,7 +4119,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_KEY: - Handle_Key(msg.drvHandler, &msg.body.strHostIFkeyAttr); + Handle_Key(msg.drvHandler, &msg.body.key_info); break; case HOST_IF_MSG_CFG_PARAMS: @@ -4363,13 +4363,13 @@ s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8keyIdx) msg.id = HOST_IF_MSG_KEY; - msg.body.strHostIFkeyAttr.enuKeyType = WEP; - msg.body.strHostIFkeyAttr.u8KeyAction = REMOVEKEY; + msg.body.key_info.enuKeyType = WEP; + msg.body.key_info.u8KeyAction = REMOVEKEY; msg.drvHandler = hWFIDrv; - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8keyIdx; /* send the message */ @@ -4411,12 +4411,12 @@ s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index) msg.id = HOST_IF_MSG_KEY; - msg.body.strHostIFkeyAttr.enuKeyType = WEP; - msg.body.strHostIFkeyAttr.u8KeyAction = DEFAULTKEY; + msg.body.key_info.enuKeyType = WEP; + msg.body.key_info.u8KeyAction = DEFAULTKEY; msg.drvHandler = hWFIDrv; - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Index; /* send the message */ @@ -4465,22 +4465,22 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, msg.id = HOST_IF_MSG_KEY; - msg.body.strHostIFkeyAttr.enuKeyType = WEP; - msg.body.strHostIFkeyAttr.u8KeyAction = ADDKEY; + msg.body.key_info.enuKeyType = WEP; + msg.body.key_info.u8KeyAction = ADDKEY; msg.drvHandler = hWFIDrv; - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey = kmalloc(u8WepKeylen, GFP_KERNEL); - memcpy(msg.body.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey, + memcpy(msg.body.key_info.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey, pu8WepKey, u8WepKeylen); - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen = (u8WepKeylen); - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Keyidx; /* send the message */ @@ -4531,29 +4531,29 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u PRINT_INFO(HOSTAPD_DBG, "KEY is %x\n", pu8WepKey[i]); } msg.id = HOST_IF_MSG_KEY; - msg.body.strHostIFkeyAttr.enuKeyType = WEP; - msg.body.strHostIFkeyAttr.u8KeyAction = ADDKEY_AP; + msg.body.key_info.enuKeyType = WEP; + msg.body.key_info.u8KeyAction = ADDKEY_AP; msg.drvHandler = hWFIDrv; - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey = kmalloc(u8WepKeylen, GFP_KERNEL); - memcpy(msg.body.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey, + memcpy(msg.body.key_info.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey, pu8WepKey, (u8WepKeylen)); - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen = (u8WepKeylen); - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Keyidx; - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.u8mode = u8mode; - msg.body.strHostIFkeyAttr. + msg.body.key_info. uniHostIFkeyAttr.strHostIFwepAttr.tenuAuth_type = tenuAuth_type; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); @@ -4606,26 +4606,26 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen, msg.id = HOST_IF_MSG_KEY; - msg.body.strHostIFkeyAttr.enuKeyType = WPAPtk;
[PATCH 08/32] staging: wilc1000: rename strHostIFCfgParamAttr
This patch renames strHostIFCfgParamAttr to cfg_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d4e8122..76e82e6 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -419,7 +419,7 @@ union message_body { struct rcvd_net_info net_info; struct rcvd_async_info async_info; struct key_attr key_info; - struct cfg_param_attr strHostIFCfgParamAttr; + struct cfg_param_attr cfg_info; struct set_channel strHostIFSetChan; struct get_channel strHostIFGetChan; struct set_beacon strHostIFSetBeacon; @@ -4124,7 +4124,7 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_CFG_PARAMS: - Handle_CfgParam(msg.drvHandler, &msg.body.strHostIFCfgParamAttr); + Handle_CfgParam(msg.drvHandler, &msg.body.cfg_info); break; case HOST_IF_MSG_SET_CHANNEL: @@ -5854,7 +5854,7 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal) /* prepare the WiphyParams Message */ memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_CFG_PARAMS; - msg.body.strHostIFCfgParamAttr.pstrCfgParamVal = *pstrCfgParamVal; + msg.body.cfg_info.pstrCfgParamVal = *pstrCfgParamVal; msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/32] staging: wilc1000: rename struct set_channel
This patch renames struct set_channel to channel_attr to keep the naming convention such as scan_attr and connect_attr. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e715f54..e66118a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -218,7 +218,7 @@ struct rcvd_async_info { }; /*! - * @struct set_channel + * @structchannel_attr * @brief Set Channel message body * @details * @todo @@ -227,7 +227,7 @@ struct rcvd_async_info { * @date 25 March 2012 * @version 1.0 */ -struct set_channel { +struct channel_attr { u8 u8SetChan; }; @@ -406,7 +406,7 @@ union message_body { struct rcvd_async_info async_info; struct key_attr key_info; struct cfg_param_attr cfg_info; - struct set_channel strHostIFSetChan; + struct channel_attr strHostIFSetChan; struct set_beacon strHostIFSetBeacon; struct del_beacon strHostIFDelBeacon; struct add_sta_param strAddStaParam; @@ -599,14 +599,14 @@ static tstrWILC_WFIDrv *get_handler_from_id(int id) /** * @brief Handle_SetChannel * @detailsSending config packet to firmware to set channel - * @param[in] struct set_channel *pstrHostIFSetChan + * @param[in] struct channel_attr *pstrHostIFSetChan * @return Error code. * @author * @date * @version 1.0 */ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, -struct set_channel *pstrHostIFSetChan) +struct channel_attr *pstrHostIFSetChan) { s32 s32Error = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/32] staging: wilc1000: rename struct set_beacon
This patch renames struct set_beacon to beacon_attr to keep the naming convention as scan_attr, connect_attr and channel_attr. Signed-off-by: Tony Cho --- 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 686402a9..2f211f9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -248,7 +248,7 @@ struct channel_attr { * } tstrScanComplete;*/ /*! - * @struct set_beacon + * @struct beacon_attr * @brief Set Beacon message body * @details * @todo @@ -257,7 +257,7 @@ struct channel_attr { * @date 10 July 2012 * @version 1.0 */ -struct set_beacon { +struct beacon_attr { u32 u32Interval;/*!< Beacon Interval. Period between two successive beacons on air */ u32 u32DTIMPeriod; /*!< DTIM Period. Indicates how many Beacon frames * (including the current frame) appear before the next DTIM*/ @@ -391,7 +391,7 @@ union message_body { struct key_attr key_info; struct cfg_param_attr cfg_info; struct channel_attr channel_info; - struct set_beacon strHostIFSetBeacon; + struct beacon_attr strHostIFSetBeacon; struct add_sta_param strAddStaParam; struct del_sta strDelStaParam; struct add_sta_param strEditStaParam; @@ -3158,14 +3158,14 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler, /** * @brief Handle_AddBeacon * @details Sending config packet to add beacon - * @param[in]struct set_beacon *pstrSetBeaconParam + * @param[in]struct beacon_attr *pstrSetBeaconParam * @return NONE * @author * @date * @version 1.0 */ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler, -struct set_beacon *pstrSetBeaconParam) +struct beacon_attr *pstrSetBeaconParam) { s32 s32Error = 0; tstrWID strWID; @@ -6548,7 +6548,7 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval, s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct set_beacon *pstrSetBeaconParam = &msg.body.strHostIFSetBeacon; + struct beacon_attr *pstrSetBeaconParam = &msg.body.strHostIFSetBeacon; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/32] staging: wilc1000: rename strHostIFSetBeacon
This patch renames strHostIFSetBeacon to beacon_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2f211f9..7e53aa9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -391,7 +391,7 @@ union message_body { struct key_attr key_info; struct cfg_param_attr cfg_info; struct channel_attr channel_info; - struct beacon_attr strHostIFSetBeacon; + struct beacon_attr beacon_info; struct add_sta_param strAddStaParam; struct del_sta strDelStaParam; struct add_sta_param strEditStaParam; @@ -4134,7 +4134,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_ADD_BEACON: - Handle_AddBeacon(msg.drvHandler, &msg.body.strHostIFSetBeacon); + Handle_AddBeacon(msg.drvHandler, &msg.body.beacon_info); break; case HOST_IF_MSG_DEL_BEACON: @@ -6548,7 +6548,7 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval, s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct beacon_attr *pstrSetBeaconParam = &msg.body.strHostIFSetBeacon; + struct beacon_attr *pstrSetBeaconParam = &msg.body.beacon_info; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/32] staging: wilc1000: rename strHostIFSetChan
This patch renames strHostIFSetChan to channel_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e66118a..4559ed5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -406,7 +406,7 @@ union message_body { struct rcvd_async_info async_info; struct key_attr key_info; struct cfg_param_attr cfg_info; - struct channel_attr strHostIFSetChan; + struct channel_attr channel_info; struct set_beacon strHostIFSetBeacon; struct del_beacon strHostIFDelBeacon; struct add_sta_param strAddStaParam; @@ -4113,7 +4113,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_SET_CHANNEL: - Handle_SetChannel(msg.drvHandler, &msg.body.strHostIFSetChan); + Handle_SetChannel(msg.drvHandler, &msg.body.channel_info); break; case HOST_IF_MSG_DISCONNECT: @@ -5368,7 +5368,7 @@ s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum) /* prepare the set channel message */ memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_CHANNEL; - msg.body.strHostIFSetChan.u8SetChan = u8ChNum; + msg.body.channel_info.u8SetChan = u8ChNum; msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/32] staging: wilc1000: remove struct del_beacon
This patch removes struct del_beacon which is not necessary. This patch also changes Handle_DelBeacon function by removing 2nd parameter, struct del_beacon because it is not used inside. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4559ed5..686402a9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -269,22 +269,6 @@ struct set_beacon { * after the TIM inormation element */ }; - - -/*! - * @struct del_beacon - * @brief Del Beacon message body - * @details - * @todo - * @sa - * @authorAdham Abozaeid - * @date 15 July 2012 - * @version 1.0 - */ -struct del_beacon { - u8 u8dummy; -}; - /*! * @struct set_multicast * @brief set Multicast filter Address @@ -408,7 +392,6 @@ union message_body { struct cfg_param_attr cfg_info; struct channel_attr channel_info; struct set_beacon strHostIFSetBeacon; - struct del_beacon strHostIFDelBeacon; struct add_sta_param strAddStaParam; struct del_sta strDelStaParam; struct add_sta_param strEditStaParam; @@ -3244,14 +3227,13 @@ ERRORHANDLER: /** * @brief Handle_AddBeacon * @details Sending config packet to delete beacon - * @param[in] struct del_beacon *pstrDelBeacon + * @param[in] tstrWILC_WFIDrv *drvHandler * @return NONE * @author * @date * @version 1.0 */ -static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler, -struct del_beacon *pstrDelBeacon) +static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler) { s32 s32Error = 0; tstrWID strWID; @@ -4156,7 +4138,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_DEL_BEACON: - Handle_DelBeacon(msg.drvHandler, &msg.body.strHostIFDelBeacon); + Handle_DelBeacon(msg.drvHandler); break; case HOST_IF_MSG_ADD_STATION: -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/32] staging: wilc1000: rename strEditStaParam
This patch renames strEditStaParam to edit_sta_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 94559bd..da8e589 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -394,7 +394,7 @@ union message_body { struct beacon_attr beacon_info; struct add_sta_param add_sta_info; struct del_sta del_sta_info; - struct add_sta_param strEditStaParam; + struct add_sta_param edit_sta_info; struct timer_cb strTimerCb; struct power_mgmt_param strPowerMgmtparam; struct sta_inactive_t strHostIfStaInactiveT; @@ -4150,7 +4150,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_EDIT_STATION: - Handle_EditStation(msg.drvHandler, &msg.body.strEditStaParam); + Handle_EditStation(msg.drvHandler, &msg.body.edit_sta_info); break; case HOST_IF_MSG_GET_INACTIVETIME: -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/32] staging: wilc1000: remove struct get_channel
This patch removes struct get_channel from the driver because it is not used anywhere. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 76e82e6..e715f54 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -232,20 +232,6 @@ struct set_channel { }; /*! - * @struct get_channel - * @brief Get Channel message body - * @details - * @todo - * @sa - * @authorMai Daftedar - * @date 01 Jule 2012 - * @version 1.0 - */ -struct get_channel { - u8 u8GetChan; -}; - -/*! * @struct tstrScanComplete * @brief hold received Async. Scan Complete message body * @details @@ -421,7 +407,6 @@ union message_body { struct key_attr key_info; struct cfg_param_attr cfg_info; struct set_channel strHostIFSetChan; - struct get_channel strHostIFGetChan; struct set_beacon strHostIFSetBeacon; struct del_beacon strHostIFDelBeacon; struct add_sta_param strAddStaParam; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/32] staging: wilc1000: rename strDelStaParam
This patch renames strDelStaParam to del_sta_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d9d0b2d..94559bd 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -393,7 +393,7 @@ union message_body { struct channel_attr channel_info; struct beacon_attr beacon_info; struct add_sta_param add_sta_info; - struct del_sta strDelStaParam; + struct del_sta del_sta_info; struct add_sta_param strEditStaParam; struct timer_cb strTimerCb; struct power_mgmt_param strPowerMgmtparam; @@ -4146,7 +4146,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_DEL_STATION: - Handle_DelStation(msg.drvHandler, &msg.body.strDelStaParam); + Handle_DelStation(msg.drvHandler, &msg.body.del_sta_info); break; case HOST_IF_MSG_EDIT_STATION: @@ -6700,7 +6700,7 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr) s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct del_sta *pstrDelStationMsg = &msg.body.strDelStaParam; + struct del_sta *pstrDelStationMsg = &msg.body.del_sta_info; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/32] staging: wilc1000: rename strAddStaParam
This patch renames strAddStaParam to add_sta_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7e53aa9..d9d0b2d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -392,7 +392,7 @@ union message_body { struct cfg_param_attr cfg_info; struct channel_attr channel_info; struct beacon_attr beacon_info; - struct add_sta_param strAddStaParam; + struct add_sta_param add_sta_info; struct del_sta strDelStaParam; struct add_sta_param strEditStaParam; struct timer_cb strTimerCb; @@ -4142,7 +4142,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_ADD_STATION: - Handle_AddStation(msg.drvHandler, &msg.body.strAddStaParam); + Handle_AddStation(msg.drvHandler, &msg.body.add_sta_info); break; case HOST_IF_MSG_DEL_STATION: @@ -6651,7 +6651,7 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct add_sta_param *pstrAddStationMsg = &msg.body.strAddStaParam; + struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info; if (pstrWFIDrv == NULL) { @@ -6802,7 +6802,7 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct add_sta_param *pstrAddStationMsg = &msg.body.strAddStaParam; + struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/32] staging: wilc1000: remove struct timer_cb
This patch removes struct timer_cb which is not used. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index da8e589..7d51122 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -315,20 +315,6 @@ struct del_sta { }; /*! - * @struct timer_cb - * @brief Timer callback message body - * @details - * @todo - * @sa - * @authorMostafa Abu Bakr - * @date 25 March 2012 - * @version 1.0 - */ -struct timer_cb { - void *pvUsrArg; /*!< Private data passed at timer start */ -}; - -/*! * @struct power_mgmt_param * @brief Power management message body * @details @@ -395,7 +381,6 @@ union message_body { struct add_sta_param add_sta_info; struct del_sta del_sta_info; struct add_sta_param edit_sta_info; - struct timer_cb strTimerCb; struct power_mgmt_param strPowerMgmtparam; struct sta_inactive_t strHostIfStaInactiveT; struct set_ip_addr strHostIfSetIP; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/32] staging: wilc1000: rename strHostIfStaInactiveT
This patch renames strHostIfStaInactiveT to mac_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index de64bd2..5a54608 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -382,7 +382,7 @@ union message_body { struct del_sta del_sta_info; struct add_sta_param edit_sta_info; struct power_mgmt_param pwr_mgmt_info; - struct sta_inactive_t strHostIfStaInactiveT; + struct sta_inactive_t mac_info; struct set_ip_addr strHostIfSetIP; struct drv_handler strHostIfSetDrvHandler; struct set_multicast strHostIfSetMulti; @@ -4139,7 +4139,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_GET_INACTIVETIME: - Handle_Get_InActiveTime(msg.drvHandler, &msg.body.strHostIfStaInactiveT); + Handle_Get_InActiveTime(msg.drvHandler, &msg.body.mac_info); break; case HOST_IF_MSG_SCAN_TIMER_FIRED: @@ -5533,7 +5533,7 @@ s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu3 memset(&msg, 0, sizeof(struct host_if_msg)); - memcpy(msg.body.strHostIfStaInactiveT.mac, + memcpy(msg.body.mac_info.mac, mac, ETH_ALEN); msg.id = HOST_IF_MSG_GET_INACTIVETIME; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/32] staging: wilc1000: rename strPowerMgmtparam
This patch renames strPowerMgmtparam to pwr_mgmt_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7d51122..de64bd2 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -381,7 +381,7 @@ union message_body { struct add_sta_param add_sta_info; struct del_sta del_sta_info; struct add_sta_param edit_sta_info; - struct power_mgmt_param strPowerMgmtparam; + struct power_mgmt_param pwr_mgmt_info; struct sta_inactive_t strHostIfStaInactiveT; struct set_ip_addr strHostIfSetIP; struct drv_handler strHostIfSetDrvHandler; @@ -4154,7 +4154,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_POWER_MGMT: - Handle_PowerManagement(msg.drvHandler, &msg.body.strPowerMgmtparam); + Handle_PowerManagement(msg.drvHandler, &msg.body.pwr_mgmt_info); break; case HOST_IF_MSG_SET_WFIDRV_HANDLER: @@ -6826,7 +6826,7 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.strPowerMgmtparam; + struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info; PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", bIsEnabled); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/32] staging: wilc1000: rename strHostIfSetDrvHandler
This patch renames strHostIfSetDrvHandler to drv to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 5a54608..b8ef165 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -384,7 +384,7 @@ union message_body { struct power_mgmt_param pwr_mgmt_info; struct sta_inactive_t mac_info; struct set_ip_addr strHostIfSetIP; - struct drv_handler strHostIfSetDrvHandler; + struct drv_handler drv; struct set_multicast strHostIfSetMulti; struct op_mode strHostIfSetOperationMode; struct set_mac_addr strHostIfSetMacAddress; @@ -4159,7 +4159,7 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_SET_WFIDRV_HANDLER: Handle_SetWfiDrvHandler(msg.drvHandler, - &msg.body.strHostIfSetDrvHandler); + &msg.body.drv); break; case HOST_IF_MSG_SET_OPERATION_MODE: @@ -5382,7 +5382,7 @@ s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER; - msg.body.strHostIfSetDrvHandler.u32Address = get_id_from_handler(u32address); + msg.body.drv.u32Address = get_id_from_handler(u32address); msg.drvHandler = u32address; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/32] staging: wilc1000: rename strHostIfSetIP
This patch renames strHostIfSetIP to ip_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b8ef165..596d68f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -383,7 +383,7 @@ union message_body { struct add_sta_param edit_sta_info; struct power_mgmt_param pwr_mgmt_info; struct sta_inactive_t mac_info; - struct set_ip_addr strHostIfSetIP; + struct set_ip_addr ip_info; struct drv_handler drv; struct set_multicast strHostIfSetMulti; struct op_mode strHostIfSetOperationMode; @@ -4168,12 +4168,12 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_SET_IPADDRESS: PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n"); - Handle_set_IPAddress(msg.drvHandler, msg.body.strHostIfSetIP.au8IPAddr, msg.body.strHostIfSetIP.idx); + Handle_set_IPAddress(msg.drvHandler, msg.body.ip_info.au8IPAddr, msg.body.ip_info.idx); break; case HOST_IF_MSG_GET_IPADDRESS: PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n"); - Handle_get_IPAddress(msg.drvHandler, msg.body.strHostIfSetIP.au8IPAddr, msg.body.strHostIfSetIP.idx); + Handle_get_IPAddress(msg.drvHandler, msg.body.ip_info.au8IPAddr, msg.body.ip_info.idx); break; case HOST_IF_MSG_SET_MAC_ADDRESS: @@ -7232,9 +7232,9 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx) /* prepare the WiphyParams Message */ msg.id = HOST_IF_MSG_SET_IPADDRESS; - msg.body.strHostIfSetIP.au8IPAddr = u16ipadd; + msg.body.ip_info.au8IPAddr = u16ipadd; msg.drvHandler = hWFIDrv; - msg.body.strHostIfSetIP.idx = idx; + msg.body.ip_info.idx = idx; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); if (s32Error) @@ -7269,9 +7269,9 @@ s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx) /* prepare the WiphyParams Message */ msg.id = HOST_IF_MSG_GET_IPADDRESS; - msg.body.strHostIfSetIP.au8IPAddr = u16ipadd; + msg.body.ip_info.au8IPAddr = u16ipadd; msg.drvHandler = hWFIDrv; - msg.body.strHostIfSetIP.idx = idx; + msg.body.ip_info.idx = idx; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); if (s32Error) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/32] staging: wilc1000: rename strHostIfSetMulti
This patch renames strHostIfSetMulti to multicast_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 596d68f..034e3d9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -385,7 +385,7 @@ union message_body { struct sta_inactive_t mac_info; struct set_ip_addr ip_info; struct drv_handler drv; - struct set_multicast strHostIfSetMulti; + struct set_multicast multicast_info; struct op_mode strHostIfSetOperationMode; struct set_mac_addr strHostIfSetMacAddress; struct get_mac_addr strHostIfGetMacAddress; @@ -4200,7 +4200,7 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_SET_MULTICAST_FILTER: PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_MULTICAST_FILTER\n"); - Handle_SetMulticastFilter(msg.drvHandler, &msg.body.strHostIfSetMulti); + Handle_SetMulticastFilter(msg.drvHandler, &msg.body.multicast_info); break; case HOST_IF_MSG_ADD_BA_SESSION: @@ -6860,7 +6860,7 @@ s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct set_multicast *pstrMulticastFilterParam = &msg.body.strHostIfSetMulti; + struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info; if (pstrWFIDrv == NULL) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/32] staging: wilc1000: rename strHostIfSetMacAddress
This patch renames strHostIfSetMacAddress to set_mac_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a66f78d..2fa1158 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -387,7 +387,7 @@ union message_body { struct drv_handler drv; struct set_multicast multicast_info; struct op_mode mode; - struct set_mac_addr strHostIfSetMacAddress; + struct set_mac_addr set_mac_info; struct get_mac_addr strHostIfGetMacAddress; struct ba_session_info strHostIfBASessionInfo; struct remain_ch strHostIfRemainOnChan; @@ -4177,7 +4177,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_SET_MAC_ADDRESS: - Handle_SetMacAddress(msg.drvHandler, &msg.body.strHostIfSetMacAddress); + Handle_SetMacAddress(msg.drvHandler, &msg.body.set_mac_info); break; case HOST_IF_MSG_GET_MAC_ADDRESS: @@ -4892,7 +4892,7 @@ s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress) /* prepare setting mac address message */ memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_MAC_ADDRESS; - memcpy(msg.body.strHostIfSetMacAddress.u8MacAddress, pu8MacAddress, ETH_ALEN); + memcpy(msg.body.set_mac_info.u8MacAddress, pu8MacAddress, ETH_ALEN); msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 30/32] staging: wilc1000: rename pUserData
This patch renames pUserData to data to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 79957f9..3769595 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -392,7 +392,7 @@ union message_body { struct ba_session_info session_info; struct remain_ch remain_on_ch; struct reg_frame reg_f; - char *pUserData; + char *data; struct del_all_sta strHostIFDelAllSta; }; @@ -4111,7 +4111,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_GET_STATISTICS: - Handle_GetStatistics(msg.drvHandler, (tstrStatistics *)msg.body.pUserData); + Handle_GetStatistics(msg.drvHandler, (tstrStatistics *)msg.body.data); break; case HOST_IF_MSG_GET_CHNL: @@ -5689,7 +5689,7 @@ s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatis memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_GET_STATISTICS; - msg.body.pUserData = (char *)pstrStatistics; + msg.body.data = (char *)pstrStatistics; msg.drvHandler = hWFIDrv; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/32] staging: wilc1000: rename strHostIfGetMacAddress
This patch renames strHostIfGetMacAddress to get_mac_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2fa1158..a6702dd 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -388,7 +388,7 @@ union message_body { struct set_multicast multicast_info; struct op_mode mode; struct set_mac_addr set_mac_info; - struct get_mac_addr strHostIfGetMacAddress; + struct get_mac_addr get_mac_info; struct ba_session_info strHostIfBASessionInfo; struct remain_ch strHostIfRemainOnChan; struct reg_frame strHostIfRegisterFrame; @@ -4181,7 +4181,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_GET_MAC_ADDRESS: - Handle_GetMacAddress(msg.drvHandler, &msg.body.strHostIfGetMacAddress); + Handle_GetMacAddress(msg.drvHandler, &msg.body.get_mac_info); break; case HOST_IF_MSG_REMAIN_ON_CHAN: @@ -4858,7 +4858,7 @@ s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_GET_MAC_ADDRESS; - msg.body.strHostIfGetMacAddress.u8MacAddress = pu8MacAddress; + msg.body.get_mac_info.u8MacAddress = pu8MacAddress; msg.drvHandler = hWFIDrv; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/32] staging: wilc1000: rename strHostIFDelAllSta
This patch renames strHostIFDelAllSta to del_all_sta_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 3769595..aad0f5d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -393,7 +393,7 @@ union message_body { struct remain_ch remain_on_ch; struct reg_frame reg_f; char *data; - struct del_all_sta strHostIFDelAllSta; + struct del_all_sta del_all_sta_info; }; /*! @@ -4212,7 +4212,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_DEL_ALL_STA: - Handle_DelAllSta(msg.drvHandler, &msg.body.strHostIFDelAllSta); + Handle_DelAllSta(msg.drvHandler, &msg.body.del_all_sta_info); break; default: @@ -6726,7 +6726,7 @@ s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]) s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct del_all_sta *pstrDelAllStationMsg = &msg.body.strHostIFDelAllSta; + struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info; u8 au8Zero_Buff[ETH_ALEN] = {0}; u32 i; u8 u8AssocNumb = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/32] staging: wilc1000: rename strHostIfSetOperationMode
This patch renames strHostIfSetOperationMode to mode to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 034e3d9..a66f78d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -386,7 +386,7 @@ union message_body { struct set_ip_addr ip_info; struct drv_handler drv; struct set_multicast multicast_info; - struct op_mode strHostIfSetOperationMode; + struct op_mode mode; struct set_mac_addr strHostIfSetMacAddress; struct get_mac_addr strHostIfGetMacAddress; struct ba_session_info strHostIfBASessionInfo; @@ -4163,7 +4163,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_SET_OPERATION_MODE: - Handle_SetOperationMode(msg.drvHandler, &msg.body.strHostIfSetOperationMode); + Handle_SetOperationMode(msg.drvHandler, &msg.body.mode); break; case HOST_IF_MSG_SET_IPADDRESS: @@ -5407,7 +5407,7 @@ s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_OPERATION_MODE; - msg.body.strHostIfSetOperationMode.u32Mode = u32mode; + msg.body.mode.u32Mode = u32mode; msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/32] staging: wilc1000: fix kernel fail after ifconfig wlan0 up
From: Leo Kim This patch fix kernel fail after ifconfig wlan0 up. - if normal operation, kfree functions don't execute. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/wilc_msgqueue.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index d5ebd6d..f412121 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -76,8 +76,10 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, /* construct a new message */ pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); - if (!pstrMessage) - return -ENOMEM; + if (!pstrMessage) { + result = -ENOMEM; + goto ERRORHANDLER; + } pstrMessage->u32Length = u32SendBufferSize; pstrMessage->pstrNext = NULL; pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC); @@ -104,10 +106,12 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, up(&pHandle->hSem); ERRORHANDLER: - /* error occured, free any allocations */ - if (pstrMessage) { - kfree(pstrMessage->pvBuffer); - kfree(pstrMessage); + if (result) { + /* error occured, free any allocations */ + if (pstrMessage) { + kfree(pstrMessage->pvBuffer); + kfree(pstrMessage); + } } return result; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/32] staging: wilc1000: rename strHostIfBASessionInfo
This patch renames strHostIfBASessionInfo to session_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- 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 a6702dd..b7797a5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -389,7 +389,7 @@ union message_body { struct op_mode mode; struct set_mac_addr set_mac_info; struct get_mac_addr get_mac_info; - struct ba_session_info strHostIfBASessionInfo; + struct ba_session_info session_info; struct remain_ch strHostIfRemainOnChan; struct reg_frame strHostIfRegisterFrame; char *pUserData; @@ -4204,11 +4204,11 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_ADD_BA_SESSION: - Handle_AddBASession(msg.drvHandler, &msg.body.strHostIfBASessionInfo); + Handle_AddBASession(msg.drvHandler, &msg.body.session_info); break; case HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS: - Handle_DelAllRxBASessions(msg.drvHandler, &msg.body.strHostIfBASessionInfo); + Handle_DelAllRxBASessions(msg.drvHandler, &msg.body.session_info); break; case HOST_IF_MSG_DEL_ALL_STA: @@ -7119,7 +7119,7 @@ static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TI s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct ba_session_info *pBASessionInfo = &msg.body.strHostIfBASessionInfo; + struct ba_session_info *pBASessionInfo = &msg.body.session_info; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); @@ -7150,7 +7150,7 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID) s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct ba_session_info *pBASessionInfo = &msg.body.strHostIfBASessionInfo; + struct ba_session_info *pBASessionInfo = &msg.body.session_info; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); @@ -7180,7 +7180,7 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct ba_session_info *pBASessionInfo = &msg.body.strHostIfBASessionInfo; + struct ba_session_info *pBASessionInfo = &msg.body.session_info; if (pstrWFIDrv == NULL) { PRINT_ER("driver is null\n"); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/32] staging: wilc1000: rename strHostIfRegisterFrame
This patch renames strHostIfRegisterFrame to reg_f to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- 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 9dac906..79957f9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -391,7 +391,7 @@ union message_body { struct get_mac_addr get_mac_info; struct ba_session_info session_info; struct remain_ch remain_on_ch; - struct reg_frame strHostIfRegisterFrame; + struct reg_frame reg_f; char *pUserData; struct del_all_sta strHostIFDelAllSta; }; @@ -4191,7 +4191,7 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_REGISTER_FRAME: PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_REGISTER_FRAME\n"); - Handle_RegisterFrame(msg.drvHandler, &msg.body.strHostIfRegisterFrame); + Handle_RegisterFrame(msg.drvHandler, &msg.body.reg_f); break; case HOST_IF_MSG_LISTEN_TIMER_FIRED: @@ -6489,20 +6489,20 @@ s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bRe switch (u16FrameType) { case ACTION: PRINT_D(HOSTINF_DBG, "ACTION\n"); - msg.body.strHostIfRegisterFrame.u8Regid = ACTION_FRM_IDX; + msg.body.reg_f.u8Regid = ACTION_FRM_IDX; break; case PROBE_REQ: PRINT_D(HOSTINF_DBG, "PROBE REQ\n"); - msg.body.strHostIfRegisterFrame.u8Regid = PROBE_REQ_IDX; + msg.body.reg_f.u8Regid = PROBE_REQ_IDX; break; default: PRINT_D(HOSTINF_DBG, "Not valid frame type\n"); break; } - msg.body.strHostIfRegisterFrame.u16FrameType = u16FrameType; - msg.body.strHostIfRegisterFrame.bReg = bReg; + msg.body.reg_f.u16FrameType = u16FrameType; + msg.body.reg_f.bReg = bReg; msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/32] staging: wilc1000: rename strHostIfRemainOnChan
This patch renames strHostIfRemainOnChan to remain_on_ch to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b7797a5..9dac906 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -390,7 +390,7 @@ union message_body { struct set_mac_addr set_mac_info; struct get_mac_addr get_mac_info; struct ba_session_info session_info; - struct remain_ch strHostIfRemainOnChan; + struct remain_ch remain_on_ch; struct reg_frame strHostIfRegisterFrame; char *pUserData; struct del_all_sta strHostIFDelAllSta; @@ -3693,7 +3693,7 @@ static void ListenTimerCB(unsigned long arg) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED; msg.drvHandler = pstrWFIDrv; - msg.body.strHostIfRemainOnChan.u32ListenSessionID = pstrWFIDrv->strHostIfRemainOnChan.u32ListenSessionID; + msg.body.remain_on_ch.u32ListenSessionID = pstrWFIDrv->strHostIfRemainOnChan.u32ListenSessionID; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); @@ -4098,7 +4098,7 @@ static int hostIFthread(void *pvArg) Handle_ScanDone(msg.drvHandler, SCAN_EVENT_DONE); if (pstrWFIDrv->u8RemainOnChan_pendingreq) - Handle_RemainOnChan(msg.drvHandler, &msg.body.strHostIfRemainOnChan); + Handle_RemainOnChan(msg.drvHandler, &msg.body.remain_on_ch); break; @@ -4186,7 +4186,7 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_REMAIN_ON_CHAN: PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_REMAIN_ON_CHAN\n"); - Handle_RemainOnChan(msg.drvHandler, &msg.body.strHostIfRemainOnChan); + Handle_RemainOnChan(msg.drvHandler, &msg.body.remain_on_ch); break; case HOST_IF_MSG_REGISTER_FRAME: @@ -4195,7 +4195,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_LISTEN_TIMER_FIRED: - Handle_ListenStateExpired(msg.drvHandler, &msg.body.strHostIfRemainOnChan); + Handle_ListenStateExpired(msg.drvHandler, &msg.body.remain_on_ch); break; case HOST_IF_MSG_SET_MULTICAST_FILTER: @@ -6407,12 +6407,12 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u /* prepare the WiphyParams Message */ msg.id = HOST_IF_MSG_REMAIN_ON_CHAN; - msg.body.strHostIfRemainOnChan.u16Channel = chan; - msg.body.strHostIfRemainOnChan.pRemainOnChanExpired = RemainOnChanExpired; - msg.body.strHostIfRemainOnChan.pRemainOnChanReady = RemainOnChanReady; - msg.body.strHostIfRemainOnChan.pVoid = pvUserArg; - msg.body.strHostIfRemainOnChan.u32duration = u32duration; - msg.body.strHostIfRemainOnChan.u32ListenSessionID = u32SessionID; + msg.body.remain_on_ch.u16Channel = chan; + msg.body.remain_on_ch.pRemainOnChanExpired = RemainOnChanExpired; + msg.body.remain_on_ch.pRemainOnChanReady = RemainOnChanReady; + msg.body.remain_on_ch.pVoid = pvUserArg; + msg.body.remain_on_ch.u32duration = u32duration; + msg.body.remain_on_ch.u32ListenSessionID = u32SessionID; msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); @@ -6454,7 +6454,7 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED; msg.drvHandler = hWFIDrv; - msg.body.strHostIfRemainOnChan.u32ListenSessionID = u32SessionID; + msg.body.remain_on_ch.u32ListenSessionID = u32SessionID; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); if (s32Error) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 32/32] staging: wilc1000: fix kernel fail after ifconfig wlan0 up
Ugh... No. Just do this: diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 869736a..52d8f95 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -102,6 +102,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, up(&pHandle->hSem); + return 0; + ERRORHANDLER: /* error occured, free any allocations */ if (pstrMessage) { ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wilc1000: fix build error for openrisc-allmodconfig
On Wed, Sep 30, 2015 at 05:52:14PM +0900, Chaehyun Lim wrote: > The kbuild test robot reports the following build error for > openrisc-allmodconfig. > > >> drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit > >> declaration of function 'memset' > > The error occurs due to missing a standard header file as > so that three .c files are included it. > > Signed-off-by: Chaehyun Lim You forgot to add a Reported-by: line giving credit to kbuild, I've done that by hand. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wilc1000: fix build error for openrisc-allmodconfig
On Wed, Sep 30, 2015 at 7:20 PM, Greg KH wrote: > On Wed, Sep 30, 2015 at 05:52:14PM +0900, Chaehyun Lim wrote: >> The kbuild test robot reports the following build error for >> openrisc-allmodconfig. >> >> >> drivers/staging/wilc1000/wilc_sdio.c:584:2: error: implicit >> >> declaration of function 'memset' >> >> The error occurs due to missing a standard header file as >> so that three .c files are included it. >> >> Signed-off-by: Chaehyun Lim > > You forgot to add a Reported-by: line giving credit to kbuild, I've done > that by hand. > > thanks, > > greg k-h I understood. I will keep it in my mind to send patch. Regards Chaehyun Lim ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 29/32] staging: wilc1000: rename strHostIfRegisterFrame
On Wed, Sep 30, 2015 at 06:55:11PM +0900, Tony Cho wrote: > This patch renames strHostIfRegisterFrame to reg_f to avoid CamelCase > naming convention. Could we go with "reg_frame"? f is very ambigous. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgap: fix memory leak in dgap_parsefile()
On Wed, Sep 30, 2015 at 11:39:45AM +0530, Ronit Halder wrote: > In dgap_parsefile() char pointers are set with kstrdup() > without checking that some string is allocated to that > char pointer before. Why would this happen? Wouldn't it be better to reject the invalid config file? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192e: rtl_wx: fix negative noise value
wstats->qual.noise is of type uint8, so it shouldn't be assigned a negative number. Assigning it 0x100 - 100, which is the equivalent to -100 dBm when IW_QUAL_DBM is set. Signed-off-by: Luis de Bethencourt --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 984cb9a..70df6a1 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -1225,7 +1225,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev) if (ieee->state < RTLLIB_LINKED) { wstats->qual.qual = 10; wstats->qual.level = 0; - wstats->qual.noise = -100; + wstats->qual.noise = 0x100 - 100; /* -100 dBm */ wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; return wstats; } -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 32/32] staging: wilc1000: fix kernel fail after ifconfig wlan0 up
Dear Dan, Thank you! Always helpful your advice listen carefully. I will send in the morning. Thanks, BR Leo -Original Message- From: Dan Carpenter [mailto:dan.carpen...@oracle.com] Sent: Wednesday, September 30, 2015 7:05 PM To: Cho, Tony Cc: gre...@linuxfoundation.org; de...@driverdev.osuosl.org; Kim, Rachel; Park, Chris; Shin, Austin; linux-wirel...@vger.kernel.org; Kim, Johnny; Ferre, Nicolas; Noureldin, Adel; Kim, Leo; Abozaeid, Adham Subject: Re: [PATCH 32/32] staging: wilc1000: fix kernel fail after ifconfig wlan0 up Ugh... No. Just do this: diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 869736a..52d8f95 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -102,6 +102,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, up(&pHandle->hSem); + return 0; + ERRORHANDLER: /* error occured, free any allocations */ if (pstrMessage) { ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists
On Tue, Sep 29, 2015 at 02:44:02AM +0200, Greg KH wrote: > On Mon, Sep 28, 2015 at 11:43:55PM +0530, Chandra S Gorentla wrote: > > - The message queue is replaced with standard Linux linked list > > - kmem_cache is used for list members > > Why? The list entires are of fixed type and repeatedly allocated and deallocated for messages. > > > - A check for return value of receive method is added > > - GFP_ATOMIC is changed to GFP_KERNEL > > Why? Are you sure that is safe? The allocations are moved out of 'spin_lock_irqsave' and 'spin_unlock_irqrestore'. Hence they are safe. > > > - A few other related minor changes > > Be specific please. OK. I will try to send seperate patches. > > thanks, > > greg k-h Thank you, chandra ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists
On Tue, Sep 29, 2015 at 05:31:53AM +0300, Dan Carpenter wrote: > On Mon, Sep 28, 2015 at 11:43:55PM +0530, Chandra S Gorentla wrote: > > - The message queue is replaced with standard Linux linked list > > - kmem_cache is used for list members > > - A check for return value of receive method is added > > - GFP_ATOMIC is changed to GFP_KERNEL > > - A few other related minor changes > > These should be listed and explained. OK. I will try to send seperate patches. > > > > > while (1) { > > - wilc_mq_recv(&gMsgQHostIF, &msg, sizeof(struct host_if_msg), > > &u32Ret); > > + ret = wilc_mq_recv(&gMsgQHostIF, &msg, > > + sizeof(struct host_if_msg), &u32Ret); > > + if (ret) > > + continue; > > + > > I asked before if this was a forever loop and never got a response. > Also what does this have to do with list macros? The only exit condition of this loop is to receive a message 'HOST_IF_MSG_EXIT'. If this check is not there and 'wilc_mq_recv' returns an error, the switch case below it will be executed for the previously received message. I will send this change in a different patch. > > regards, > dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: vt6655: Fixed two lines over 80 characters long
Two lines of code that were over 80 characters long is fixed by splitting them across multiple lines. The lines of code are now easier to comprehend. Issue found by checkpatch. Signed-off-by: Arjun Krishna Babu --- drivers/staging/vt6655/baseband.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c index 9e61f2d..1e6c0c4 100644 --- a/drivers/staging/vt6655/baseband.c +++ b/drivers/staging/vt6655/baseband.c @@ -2089,9 +2089,19 @@ bool BBbVT3253Init(struct vnt_private *priv) byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]); - /* Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ + /* Init ANT B select, +* TX Config CR09 = 0x61->0x45, +* 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) +*/ + /*bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41);*/ - /* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ + + /* Init ANT B select, +* RX Config CR10 = 0x28->0x2A, +* 0x2A->0x28(VC1/VC2 define, +* make the ANT_A, ANT_B inverted) +*/ + /*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/ /* Select VC1/VC2, CR215 = 0x02->0x06 */ bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists
On Wed, Sep 30, 2015 at 06:12:50PM +0530, Chandra Gorentla wrote: > > > while (1) { > > > - wilc_mq_recv(&gMsgQHostIF, &msg, sizeof(struct host_if_msg), > > > &u32Ret); > > > + ret = wilc_mq_recv(&gMsgQHostIF, &msg, > > > + sizeof(struct host_if_msg), &u32Ret); > > > + if (ret) > > > + continue; > > > + > > > > I asked before if this was a forever loop and never got a response. > > Also what does this have to do with list macros? > The only exit condition of this loop is to receive a message > 'HOST_IF_MSG_EXIT'. If this check is not there and 'wilc_mq_recv' > returns an error, the switch case below it will be executed for > the previously received message. Oh, hm... It looks like wilc_mq_recv() can return -EFAULT, -EOVERFLOW or success here. If it returns -EFUALT is calling wilc_mq_recv() again really the right thing? I suspect we should break in that case. We should probably at least sleep for a bit intsead of looping so tightly if it returns -EOVERFLOW? I'm not sure. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging/wlan-ng: Fix potential buffer overflow in firmware handling
This patch fixes a potential buffer overflow detected by smatch. pda16 has length 512, while processing an element with index < 512 we are checking for an end marker in the next element. This poses a potential buffer overflow if no end marker is present. Signed-off-by: Tillmann Heidsieck --- v2: add missing Signed-off-by line drivers/staging/wlan-ng/prism2fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index fe36613..d357b7e 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -590,7 +590,7 @@ static int mkpdrlist(struct pda *pda) pda->nrec = 0; curroff = 0; - while (curroff < (HFA384x_PDA_LEN_MAX / 2) && + while (curroff < (HFA384x_PDA_LEN_MAX / 2 - 1) && le16_to_cpu(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA) { pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]); @@ -626,7 +626,7 @@ static int mkpdrlist(struct pda *pda) curroff += le16_to_cpu(pda16[curroff]) + 1; } - if (curroff >= (HFA384x_PDA_LEN_MAX / 2)) { + if (curroff >= (HFA384x_PDA_LEN_MAX / 2 - 1)) { pr_err("no end record found or invalid lengths in PDR data, exiting. %x %d\n", curroff, pda->nrec); return 1; -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: Add missing include
In commit 0a0796eb16f3, there is no include to mon.h, a newly created header file. This omission leads to the following Sparse warnings: CHECK drivers/staging/rtl8188eu/os_dep/mon.c drivers/staging/rtl8188eu/os_dep/mon.c:81:6: warning: symbol 'rtl88eu_mon_recv_hook' was not declared. Should it be static? drivers/staging/rtl8188eu/os_dep/mon.c:113:6: warning: symbol 'rtl88eu_mon_xmit_hook' was not declared. Should it be static? drivers/staging/rtl8188eu/os_dep/mon.c:167:19: warning: symbol 'rtl88eu_mon_init' was not declared. Should it be static? drivers/staging/rtl8188eu/os_dep/mon.c:188:6: warning: symbol 'rtl88eu_mon_deinit' was not declared. Should it be static? Signed-off-by: Larry Finger Cc: Jakub Sitnicki --- drivers/staging/rtl8188eu/os_dep/mon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c index 3dd3dc0..63bb875 100644 --- a/drivers/staging/rtl8188eu/os_dep/mon.c +++ b/drivers/staging/rtl8188eu/os_dep/mon.c @@ -20,6 +20,7 @@ #include #include #include +#include /** * unprotect_frame() - unset Protected flag and strip off IV and ICV/MIC -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedi_pci.c: Fix kernel-doc Return tags
Fix the 'Return' tags in the kernel-doc comments as they currently say 'Returns', which is not recognized by kernel-doc. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_pci.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_pci.c b/drivers/staging/comedi/comedi_pci.c index 0601049..51e023a 100644 --- a/drivers/staging/comedi/comedi_pci.c +++ b/drivers/staging/comedi/comedi_pci.c @@ -28,8 +28,8 @@ * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a * a &struct device embedded in a &struct pci_dev. * - * Returns: Attached PCI device if @dev->hw_dev is non-%NULL. - * Returns %NULL if @dev->hw_dev is %NULL. + * Return: Attached PCI device if @dev->hw_dev is non-%NULL. + * Return %NULL if @dev->hw_dev is %NULL. */ struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev) { @@ -48,7 +48,7 @@ EXPORT_SYMBOL_GPL(comedi_to_pci_dev); * * Calls to comedi_pci_enable() and comedi_pci_disable() cannot be nested. * - * Returns: + * Return: * 0 on success, * -%ENODEV if @dev->hw_dev is %NULL, * -%EBUSY if regions busy, @@ -143,7 +143,7 @@ EXPORT_SYMBOL_GPL(comedi_pci_detach); * "auto_attach" handler. The "auto_attach" handler may call * comedi_to_pci_dev() on the passed in COMEDI device to recover @pcidev. * - * Returns: The result of calling comedi_auto_config() (0 on success, or + * Return: The result of calling comedi_auto_config() (0 on success, or * a negative error number on failure). */ int comedi_pci_auto_config(struct pci_dev *pcidev, @@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(comedi_pci_auto_unconfig); * to register the COMEDI driver and the PCI driver. Do not call it directly, * use the module_comedi_pci_driver() helper macro instead. * - * Returns: 0 on success, or a negative error number on failure. + * Return: 0 on success, or a negative error number on failure. */ int comedi_pci_driver_register(struct comedi_driver *comedi_driver, struct pci_driver *pci_driver) -- 2.5.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedi_pcmcia.c: improve function documentation
Expand the descriptions of the functions and document the return values. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_pcmcia.c | 104 - 1 file changed, 76 insertions(+), 28 deletions(-) diff --git a/drivers/staging/comedi/comedi_pcmcia.c b/drivers/staging/comedi/comedi_pcmcia.c index 7e78439..d7072a5 100644 --- a/drivers/staging/comedi/comedi_pcmcia.c +++ b/drivers/staging/comedi/comedi_pcmcia.c @@ -22,8 +22,14 @@ #include "comedi_pcmcia.h" /** - * comedi_to_pcmcia_dev() - comedi_device pointer to pcmcia_device pointer. - * @dev: comedi_device struct + * comedi_to_pcmcia_dev() - Return PCMCIA device attached to COMEDI device + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct pcmcia_device. + * + * Return: Attached PCMCIA device if @dev->hw_dev is non-%NULL. + * Return %NULL if @dev->hw_dev is %NULL. */ struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *dev) { @@ -41,13 +47,35 @@ static int comedi_pcmcia_conf_check(struct pcmcia_device *link, } /** - * comedi_pcmcia_enable() - Request the regions and enable the PCMCIA device. - * @dev: comedi_device struct - * @conf_check: optional callback to check the pcmcia_device configuration + * comedi_pcmcia_enable() - Request the regions and enable the PCMCIA device + * @dev: COMEDI device. + * @conf_check: Optional callback to check each configuration option of the + * PCMCIA device and request I/O regions. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a a + * &struct device embedded in a &struct pcmcia_device. The comedi PCMCIA + * driver needs to set the 'config_flags' member in the &struct pcmcia_device, + * as appropriate for that driver, before calling this function in order to + * allow pcmcia_loop_config() to do its internal autoconfiguration. + * + * If @conf_check is %NULL it is set to a default function. If is + * passed to pcmcia_loop_config() and should return %0 if the configuration + * is valid and I/O regions requested successfully, otherwise it should return + * a negative error value. The default function returns -%EINVAL if the + * 'config_index' member is %0, otherwise it calls pcmcia_request_io() and + * returns the result. + * + * If the above configuration check passes, pcmcia_enable_device() is called + * to set up and activate the PCMCIA device. * - * The comedi PCMCIA driver needs to set the link->config_flags, as - * appropriate for that driver, before calling this function in order - * to allow pcmcia_loop_config() to do its internal autoconfiguration. + * If this function returns an error, comedi_pcmcia_disable() should be called + * to release requested resources. + * + * Return: + * 0 on success, + * -%ENODEV id @dev->hw_dev is %NULL, + * a negative error number from pcmcia_loop_config() if it fails, + * or a negative error number from pcmcia_enable_device() if it fails. */ int comedi_pcmcia_enable(struct comedi_device *dev, int (*conf_check)(struct pcmcia_device *, void *)) @@ -70,8 +98,12 @@ int comedi_pcmcia_enable(struct comedi_device *dev, EXPORT_SYMBOL_GPL(comedi_pcmcia_enable); /** - * comedi_pcmcia_disable() - Disable the PCMCIA device and release the regions. - * @dev: comedi_device struct + * comedi_pcmcia_disable() - Disable the PCMCIA device and release the regions + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct pcmcia_device. Call + * pcmcia_disable_device() to disable and clean up the PCMCIA device. */ void comedi_pcmcia_disable(struct comedi_device *dev) { @@ -83,11 +115,17 @@ void comedi_pcmcia_disable(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_pcmcia_disable); /** - * comedi_pcmcia_auto_config() - Configure/probe a comedi PCMCIA driver. - * @link: pcmcia_device struct - * @driver: comedi_driver struct + * comedi_pcmcia_auto_config() - Configure/probe a PCMCIA COMEDI device + * @link: PCMCIA device. + * @driver: Registered COMEDI driver. + * + * Typically called from the pcmcia_driver (*probe) function. Auto-configure + * a COMEDI device, using a pointer to the &struct device embedded in *@link + * as the hardware device. The @driver's "auto_attach" handler may call + * comedi_to_pcmcia_dev() on the passed in COMEDI device to recover @link. * - * Typically called from the pcmcia_driver (*probe) function. + * Return: The result of calling comedi_auto_config() (0 on success, or a + * negative error number on failure). */ int comedi_pcmcia_auto_config(struct pcmcia_device *link, struct comedi_driver *driver) @@ -97,10 +135,18 @@ int comedi_pcmcia_auto_config(struct pcmcia_device *link, EXPORT_SYMBOL_GPL(comedi_pcmcia_auto_config); /** - * comedi_pcmcia_auto_unconfig() - Unconfigure/remove a comedi PCMCIA driver.
[PATCH] staging: comedi: comedi_usb.c: improve function documentation
Expand the descriptions of the functions and document the return values. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_usb.c | 75 + 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/drivers/staging/comedi/comedi_usb.c b/drivers/staging/comedi/comedi_usb.c index 68b75e8..9c946d4 100644 --- a/drivers/staging/comedi/comedi_usb.c +++ b/drivers/staging/comedi/comedi_usb.c @@ -21,8 +21,14 @@ #include "comedi_usb.h" /** - * comedi_to_usb_interface() - comedi_device pointer to usb_interface pointer. - * @dev: comedi_device struct + * comedi_to_usb_interface() - Return USB interface attached to COMEDI device + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct usb_interface. + * + * Return: Attached USB interface if @dev->hw_dev is non-%NULL. + * Return %NULL if @dev->hw_dev is %NULL. */ struct usb_interface *comedi_to_usb_interface(struct comedi_device *dev) { @@ -31,8 +37,14 @@ struct usb_interface *comedi_to_usb_interface(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_to_usb_interface); /** - * comedi_to_usb_dev() - comedi_device pointer to usb_device pointer. - * @dev: comedi_device struct + * comedi_to_usb_dev() - Return USB device attached to COMEDI device + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct usb_interface. + * + * Return: USB device to which the USB interface belongs if @dev->hw_dev is + * non-%NULL. Return %NULL if @dev->hw_dev is %NULL. */ struct usb_device *comedi_to_usb_dev(struct comedi_device *dev) { @@ -43,12 +55,19 @@ struct usb_device *comedi_to_usb_dev(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_to_usb_dev); /** - * comedi_usb_auto_config() - Configure/probe a comedi USB driver. - * @intf: usb_interface struct - * @driver: comedi_driver struct - * @context: driver specific data, passed to comedi_auto_config() + * comedi_usb_auto_config() - Configure/probe a USB COMEDI driver + * @intf: USB interface. + * @driver: Registered COMEDI driver. + * @context: Driver specific data, passed to comedi_auto_config(). * - * Typically called from the usb_driver (*probe) function. + * Typically called from the usb_driver (*probe) function. Auto-configure a + * COMEDI device, using a pointer to the &struct device embedded in *@intf as + * the hardware device. The @context value gets passed through to @driver's + * "auto_attach" handler. The "auto_attach" handler may call + * comedi_to_usb_interface() on the passed in COMEDI device to recover @intf. + * + * Return: The result of calling comedi_auto_config() (%0 on success, or + * a negative error number on failure). */ int comedi_usb_auto_config(struct usb_interface *intf, struct comedi_driver *driver, @@ -59,10 +78,18 @@ int comedi_usb_auto_config(struct usb_interface *intf, EXPORT_SYMBOL_GPL(comedi_usb_auto_config); /** - * comedi_pci_auto_unconfig() - Unconfigure/disconnect a comedi USB driver. - * @intf: usb_interface struct + * comedi_usb_auto_unconfig() - Unconfigure/disconnect a USB COMEDI device + * @intf: USB interface. * * Typically called from the usb_driver (*disconnect) function. + * Auto-unconfigure a COMEDI device attached to this USB interface, using a + * pointer to the &struct device embedded in *@intf as the hardware device. + * The COMEDI driver's "detach" handler will be called during unconfiguration + * of the COMEDI device. + * + * Note that the COMEDI device may have already been unconfigured using the + * %COMEDI_DEVCONFIG ioctl, in which case this attempt to unconfigure it + * again should be ignored. */ void comedi_usb_auto_unconfig(struct usb_interface *intf) { @@ -71,13 +98,15 @@ void comedi_usb_auto_unconfig(struct usb_interface *intf) EXPORT_SYMBOL_GPL(comedi_usb_auto_unconfig); /** - * comedi_usb_driver_register() - Register a comedi USB driver. - * @comedi_driver: comedi_driver struct - * @usb_driver: usb_driver struct + * comedi_usb_driver_register() - Register a USB COMEDI driver + * @comedi_driver: COMEDI driver to be registered. + * @usb_driver: USB driver to be registered. + * + * This function is called from the module_init() of USB COMEDI driver modules + * to register the COMEDI driver and the USB driver. Do not call it directly, + * use the module_comedi_usb_driver() helper macro instead. * - * This function is used for the module_init() of comedi USB drivers. - * Do not call it directly, use the module_comedi_usb_driver() helper - * macro instead. + * Return: %0 on success, or a negative error number on failure. */ int comedi_usb_driver_register(struct comedi_driver *comedi_driver, struct usb_driver *usb_driver) @@ -99,13 +128,13 @@ int comedi_usb_driver_register(struct comedi_driver *comedi_driver, EXPORT_SYMBOL_GPL(comedi_usb_drive
Зqpaвcтвyйтe! Bac интepecyюm бaзы данныx нoвыx kлиентoв qля Baшeгo Бизнeсa?
Зqpaвcтвyйтe! Bac интepecyюm бaзы данныx нoвыx kлиентoв qля Baшeгo Бизнeсa? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: ion: Fix error handling in ion_buffer_create
On 09/29/2015 10:37 PM, Rohit kumar wrote: This patch fixes error handling case when buffer->pages allocation fails. Also, it removes unreachable code of checking ret variable although it is not updated. Reviewed-by: Laura Abbott Signed-off-by: Rohit kumar --- drivers/staging/android/ion/ion.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 217aa53..af59e4a 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -213,10 +213,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, "heap->ops->map_dma should return ERR_PTR on error")) table = ERR_PTR(-EINVAL); if (IS_ERR(table)) { - heap->ops->free(buffer); - kfree(buffer); - return ERR_CAST(table); + ret = -EINVAL; + goto err1; } + buffer->sg_table = table; if (ion_buffer_fault_user_mappings(buffer)) { int num_pages = PAGE_ALIGN(buffer->size) / PAGE_SIZE; @@ -226,7 +226,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, buffer->pages = vmalloc(sizeof(struct page *) * num_pages); if (!buffer->pages) { ret = -ENOMEM; - goto err1; + goto err; } for_each_sg(table->sgl, sg, table->nents, i) { @@ -235,9 +235,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, for (j = 0; j < sg->length / PAGE_SIZE; j++) buffer->pages[k++] = page++; } - - if (ret) - goto err; } buffer->dev = dev; @@ -261,9 +258,8 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, err: heap->ops->unmap_dma(heap, buffer); - heap->ops->free(buffer); err1: - vfree(buffer->pages); + heap->ops->free(buffer); err2: kfree(buffer); return ERR_PTR(ret); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] staging: comedi: comedi_pci.c: Fix kernel-doc Return tags
On Wednesday, September 30, 2015 8:44 AM, Ian Abbott wrote: > Fix the 'Return' tags in the kernel-doc comments as they currently say > 'Returns', which is not recognized by kernel-doc. > > Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] staging: comedi: comedi_pcmcia.c: improve function documentation
On Wednesday, September 30, 2015 9:11 AM, Ian Abbott wrote: > Expand the descriptions of the functions and document the return values. > > Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] staging: comedi: comedi_usb.c: improve function documentation
On Wednesday, September 30, 2015 9:37 AM, Ian Abbott wrote: > Expand the descriptions of the functions and document the return values. > > Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] Staging: rts5208: Coding style warnings fix for block comments
On Tue, Sep 29, 2015 at 5:55 AM, Greg KH wrote: > On Mon, Sep 21, 2015 at 11:29:50PM +0530, Punit Vara wrote: >> This patch is to rtsx_chip.h that fixes up following warning reported >> by checkpatch.pl : >> >> -Block comments use * on subsequent lines >> -Block comments use a trailing */ on a separate line >> >> Signed-off-by: Punit Vara >> --- >> drivers/staging/rts5208/rtsx_chip.h | 66 >> +++-- >> 1 file changed, 42 insertions(+), 24 deletions(-) > > Where is patch 1/3 and 2/3? > > You have sent me almost 60 different patches, yet you gave me no idea > what order to apply them in at all, what am I supposed to do with all of > them? > > Please redo all of your outstanding patches that I have not taken and > resend them in a proper patch series, numbered correctly so that I have > a chance to know what order to apply the. I've now purged my todo queue > of all of your patches. > > thanks, > > greg k-h I will resend you all the patches whichever having block comment warnings as soon as I get some time. Thanks ! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgap: fix memory leak in dgap_parsefile()
The existing dgap_parsefile() rejects invalid config file. But before we know that config file is invalid a lot of memory leak can happen. Removing the chances of memory leak won't heart anyone. regards, Ronit Halder ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/32] staging/lustre/ldlm: Remove unused interval tree bits
From: Oleg Drokin On client side interval-tree code operations are pretty basic, so get rid of the code that is only used on the server to figure out how much to extend the locks and such. Signed-off-by: Oleg Drokin --- .../staging/lustre/lustre/include/interval_tree.h | 36 --- drivers/staging/lustre/lustre/ldlm/interval_tree.c | 271 - 2 files changed, 307 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/interval_tree.h b/drivers/staging/lustre/lustre/include/interval_tree.h index bf9027d..f6df3f3 100644 --- a/drivers/staging/lustre/lustre/include/interval_tree.h +++ b/drivers/staging/lustre/lustre/include/interval_tree.h @@ -67,11 +67,6 @@ static inline int interval_is_intree(struct interval_node *node) return node->in_intree == 1; } -static inline __u64 interval_low(struct interval_node *node) -{ - return node->in_extent.start; -} - static inline __u64 interval_high(struct interval_node *node) { return node->in_extent.end; @@ -86,39 +81,8 @@ static inline void interval_set(struct interval_node *node, node->in_max_high = end; } -/* Rules to write an interval callback. - * - the callback returns INTERVAL_ITER_STOP when it thinks the iteration - *should be stopped. It will then cause the iteration function to return - *immediately with return value INTERVAL_ITER_STOP. - * - callbacks for interval_iterate and interval_iterate_reverse: Every - *nodes in the tree will be set to @node before the callback being called - * - callback for interval_search: Only overlapped node will be set to @node - *before the callback being called. - */ -typedef enum interval_iter (*interval_callback_t)(struct interval_node *node, - void *args); - struct interval_node *interval_insert(struct interval_node *node, struct interval_node **root); void interval_erase(struct interval_node *node, struct interval_node **root); -/* Search the extents in the tree and call @func for each overlapped - * extents. */ -enum interval_iter interval_search(struct interval_node *root, - struct interval_node_extent *ex, - interval_callback_t func, void *data); - -/* Iterate every node in the tree - by reverse order or regular order. */ -enum interval_iter interval_iterate(struct interval_node *root, - interval_callback_t func, void *data); -enum interval_iter interval_iterate_reverse(struct interval_node *root, - interval_callback_t func, void *data); - -void interval_expand(struct interval_node *root, -struct interval_node_extent *ext, -struct interval_node_extent *limiter); -int interval_is_overlapped(struct interval_node *root, - struct interval_node_extent *ex); -struct interval_node *interval_find(struct interval_node *root, - struct interval_node_extent *ex); #endif diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c b/drivers/staging/lustre/lustre/ldlm/interval_tree.c index eab2bd6..3d2d85b 100644 --- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c +++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c @@ -96,12 +96,6 @@ static inline int extent_equal(struct interval_node_extent *e1, return (e1->start == e2->start) && (e1->end == e2->end); } -static inline int extent_overlapped(struct interval_node_extent *e1, - struct interval_node_extent *e2) -{ - return (e1->start <= e2->end) && (e2->start <= e1->end); -} - static inline int node_compare(struct interval_node *n1, struct interval_node *n2) { @@ -119,19 +113,6 @@ static inline __u64 max_u64(__u64 x, __u64 y) return x > y ? x : y; } -static inline __u64 min_u64(__u64 x, __u64 y) -{ - return x < y ? x : y; -} - -#define interval_for_each(node, root) \ -for (node = interval_first(root); node != NULL; \ - node = interval_next(node)) - -#define interval_for_each_reverse(node, root) \ -for (node = interval_last(root); node != NULL; \ - node = interval_prev(node)) - static struct interval_node *interval_first(struct interval_node *node) { if (!node) @@ -141,15 +122,6 @@ static struct interval_node *interval_first(struct interval_node *node) return node; } -static struct interval_node *interval_last(struct interval_node *node) -{ - if (!node) - return NULL; - while (node->in_right) - node = node->in_right; - return node; -} - static struct interval_node *interval_next(struct interval_node *node) { if (!node) @@ -161,76 +133,6 @@ static struct interval_node *interval_next(struct interval_node *node) return node->in_parent; } -static str
[PATCH 09/32] staging/lustre/ldlm: Remove ldlm_init/destroy_export()
From: Oleg Drokin These functions are used on the server-only, so get rid of them. Also get rid of ldlm export hash operations and the struct. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 105 - 2 files changed, 107 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 1ac08e1..03eea32 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1114,8 +1114,6 @@ int ldlm_del_waiting_lock(struct ldlm_lock *lock); int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout); int ldlm_get_ref(void); void ldlm_put_ref(void); -int ldlm_init_export(struct obd_export *exp); -void ldlm_destroy_export(struct obd_export *exp); struct ldlm_lock *ldlm_request_lock(struct ptlrpc_request *req); /* ldlm_lock.c */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index a78c4a4..57f6128 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -887,111 +887,6 @@ void ldlm_put_ref(void) } EXPORT_SYMBOL(ldlm_put_ref); -/* - * Export handle<->lock hash operations. - */ -static unsigned -ldlm_export_lock_hash(struct cfs_hash *hs, const void *key, unsigned mask) -{ - return cfs_hash_u64_hash(((struct lustre_handle *)key)->cookie, mask); -} - -static void * -ldlm_export_lock_key(struct hlist_node *hnode) -{ - struct ldlm_lock *lock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash); - return &lock->l_remote_handle; -} - -static void -ldlm_export_lock_keycpy(struct hlist_node *hnode, void *key) -{ - struct ldlm_lock *lock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash); - lock->l_remote_handle = *(struct lustre_handle *)key; -} - -static int -ldlm_export_lock_keycmp(const void *key, struct hlist_node *hnode) -{ - return lustre_handle_equal(ldlm_export_lock_key(hnode), key); -} - -static void * -ldlm_export_lock_object(struct hlist_node *hnode) -{ - return hlist_entry(hnode, struct ldlm_lock, l_exp_hash); -} - -static void -ldlm_export_lock_get(struct cfs_hash *hs, struct hlist_node *hnode) -{ - struct ldlm_lock *lock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash); - LDLM_LOCK_GET(lock); -} - -static void -ldlm_export_lock_put(struct cfs_hash *hs, struct hlist_node *hnode) -{ - struct ldlm_lock *lock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash); - LDLM_LOCK_RELEASE(lock); -} - -static cfs_hash_ops_t ldlm_export_lock_ops = { - .hs_hash= ldlm_export_lock_hash, - .hs_key = ldlm_export_lock_key, - .hs_keycmp = ldlm_export_lock_keycmp, - .hs_keycpy = ldlm_export_lock_keycpy, - .hs_object = ldlm_export_lock_object, - .hs_get = ldlm_export_lock_get, - .hs_put = ldlm_export_lock_put, - .hs_put_locked = ldlm_export_lock_put, -}; - -int ldlm_init_export(struct obd_export *exp) -{ - int rc; - - exp->exp_lock_hash = - cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid), - HASH_EXP_LOCK_CUR_BITS, - HASH_EXP_LOCK_MAX_BITS, - HASH_EXP_LOCK_BKT_BITS, 0, - CFS_HASH_MIN_THETA, CFS_HASH_MAX_THETA, - &ldlm_export_lock_ops, - CFS_HASH_DEFAULT | CFS_HASH_REHASH_KEY | - CFS_HASH_NBLK_CHANGE); - - if (!exp->exp_lock_hash) - return -ENOMEM; - - rc = ldlm_init_flock_export(exp); - if (rc) - goto err; - - return 0; -err: - ldlm_destroy_export(exp); - return rc; -} -EXPORT_SYMBOL(ldlm_init_export); - -void ldlm_destroy_export(struct obd_export *exp) -{ - cfs_hash_putref(exp->exp_lock_hash); - exp->exp_lock_hash = NULL; - - ldlm_destroy_flock_export(exp); -} -EXPORT_SYMBOL(ldlm_destroy_export); - extern unsigned int ldlm_cancel_unused_locks_before_replay; static ssize_t cancel_unused_locks_before_replay_show(struct kobject *kobj, -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/32] staging/lustre/llite: Remove unused ll_rmdir_entry()
From: Oleg Drokin The ioctl for this function was removed, but the function was forgotten, so kill it now. Signed-off-by: Oleg Drokin --- .../staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/namei.c| 28 -- 2 files changed, 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index d6bdfed..4c20b1e 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -687,7 +687,6 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash, int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, void *data, int flag); struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de); -int ll_rmdir_entry(struct inode *dir, char *name, int namelen); /* llite/rw.c */ int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to); diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 2e663ea..a22e252 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -870,34 +870,6 @@ static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) *fid = *ll_inode2fid(d_inode(child)); } -/** - * Remove dir entry - **/ -int ll_rmdir_entry(struct inode *dir, char *name, int namelen) -{ - struct ptlrpc_request *request = NULL; - struct md_op_data *op_data; - int rc; - - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n", - namelen, name, dir->i_ino, dir->i_generation, dir); - - op_data = ll_prep_md_op_data(NULL, dir, NULL, name, strlen(name), -S_IFDIR, LUSTRE_OPC_ANY, NULL); - if (IS_ERR(op_data)) - return PTR_ERR(op_data); - op_data->op_cli_flags |= CLI_RM_ENTRY; - rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); - ll_finish_md_op_data(op_data); - if (rc == 0) { - ll_update_times(request, dir); - ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1); - } - - ptlrpc_req_finished(request); - return rc; -} - int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir) { struct mdt_body *body; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/32] staging/lustre/lov: Remove unused lov_lsm_decref()
From: Oleg Drokin Also lov_lsm_addref is only used in the file it is defined, so make it static Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/lov/lov_cl_internal.h | 3 --- drivers/staging/lustre/lustre/lov/lov_object.c | 13 + 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h index 314ce85..9a9156e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h @@ -637,9 +637,6 @@ struct lov_io_sub*lov_page_subio(const struct lu_env *env, struct lov_io *lio, const struct cl_page_slice *slice); -void lov_lsm_decref(struct lov_object *lov, struct lov_stripe_md *lsm); -struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov); - #define lov_foreach_target(lov, var) \ for (var = 0; var < lov_targets_nr(lov); ++var) diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 4d7cd92..e67df64 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -909,7 +909,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env, return obj; } -struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) +static struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) { struct lov_stripe_md *lsm = NULL; @@ -924,17 +924,6 @@ struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) return lsm; } -void lov_lsm_decref(struct lov_object *lov, struct lov_stripe_md *lsm) -{ - if (lsm == NULL) - return; - - CDEBUG(D_INODE, "lsm %p decref %d by %p.\n", - lsm, atomic_read(&lsm->lsm_refc), current); - - lov_free_memmd(&lsm); -} - struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) { struct lu_object *luobj; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/32] Lustre (mostly locking) unused code removal
From: Oleg Drokin This continues the quest for killing unused code in the Lustre client. Main focus in this set is on Lustre LDLM code - it kills both outright unused code and code that looks like it's used, but in fact also unused as various conditions that would lead to it would only happen on the server. Also LDLM is cleaned up to remove unneeded exported symbols and (almost) all locally used functions are now declared as static. Also a few patches to llite/lov to remove some unused functions there. Please consider. Oleg Drokin (32): staging/lustre/llite: Remove unused ll_get_default/max_cookiesize() staging/lustre: KEY_DEFAULT/MAX_COOKIESIZE key is unused, remove them staging/lustre: Remove ununused ll_ra_read_get() staging/lustre/llite: Remove unused ll_rmdir_entry() staging/lustre/lov: Remove unused lov_dump_lmm/pool() staging/lustre/lov: Remove unused lov_lsm_decref() staging/lustre/ldlm: Remove unused interval tree bits staging/lustre/ldlm: Remove unused ldlm_cancel_locks_for_exports() staging/lustre/ldlm: Remove ldlm_init/destroy_export() staging/lustre/ldlm: Remove unimplemented lock conversion traces. staging/lustre/ldlm: Get rid of lr_converting queue staging/lustre/ldlm: Remove unused ldlm_cli_enqueue_local() staging/lustre/ldlm: Remove unused ldlm_init/fini_flock_export staging/lustre/ldlm: Remove unused ldlm_enqueue_pack() staging/lustre/ldlm: Remove ldlm_errno2error() staging/lustre/ldlm: Remove ldlm_glimpse_ast() staging/lustre/ldlm: Remove ldlm_lock_fail_match() staging/lustre/ldlm: Remove ldlm_namespace_free() staging/lustre/ldlm: Remove unused ldlm_pool_get_clv() staging/lustre/ldlm: Remove unused ldlm_pool_set_slv() staging/lustre/ldlm: Remove ldlm_refresh/del_waiting_lock() staging/lustre/ldlm: Remove intent policies handler. staging/lustre/ldlm: Remove unused ldlm_reprocess_all*() staging/lustre/ldlm: Remove unused ldlm_resource_insert_lock_after() staging/lustre/ldlm: Remove unused ldlm_blocking_ast/_nocheck() staging/lustre: Remove ns_is_client() staging/lustre: Remove ns_is_server() staging/lustre/ldlm: Remove server side code from pool support. staging/lustre/ldlm: Remove unused exported symbols. staging/lustre/ldlm: Remove ldlm_namespace_inactive_list() staging/lustre/ldlm: Remove posix lock (flock) deadlock detection staging/lustre/ldlm: Make ldlm_add_ast_work_item() static .../staging/lustre/lustre/include/interval_tree.h | 36 -- drivers/staging/lustre/lustre/include/lustre_dlm.h | 103 + drivers/staging/lustre/lustre/include/obd.h| 2 - drivers/staging/lustre/lustre/ldlm/interval_tree.c | 271 -- drivers/staging/lustre/lustre/ldlm/l_lock.c| 7 +- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 22 +- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 269 + drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 36 +- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 36 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 380 ++- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 122 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 416 ++--- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 338 + drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 181 +++-- .../staging/lustre/lustre/llite/llite_internal.h | 4 - drivers/staging/lustre/lustre/llite/llite_lib.c| 26 -- drivers/staging/lustre/lustre/llite/namei.c| 28 -- drivers/staging/lustre/lustre/llite/rw.c | 24 -- drivers/staging/lustre/lustre/lmv/lmv_obd.c| 2 - .../staging/lustre/lustre/lov/lov_cl_internal.h| 3 - drivers/staging/lustre/lustre/lov/lov_internal.h | 2 - drivers/staging/lustre/lustre/lov/lov_object.c | 13 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 20 - drivers/staging/lustre/lustre/lov/lov_pool.c | 22 -- drivers/staging/lustre/lustre/mdc/mdc_request.c| 20 - 25 files changed, 155 insertions(+), 2228 deletions(-) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/32] staging/lustre/ldlm: Remove unused ldlm_pool_set_slv()
From: Oleg Drokin Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 13 - 2 files changed, 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 1b5f298..ec717eb 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1402,7 +1402,6 @@ int ldlm_pool_recalc(struct ldlm_pool *pl); __u32 ldlm_pool_get_lvf(struct ldlm_pool *pl); __u64 ldlm_pool_get_slv(struct ldlm_pool *pl); __u32 ldlm_pool_get_limit(struct ldlm_pool *pl); -void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv); void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv); void ldlm_pool_set_limit(struct ldlm_pool *pl, __u32 limit); void ldlm_pool_add(struct ldlm_pool *pl, struct ldlm_lock *lock); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index cbe4b7b..94cdf5f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -1010,19 +1010,6 @@ __u64 ldlm_pool_get_slv(struct ldlm_pool *pl) EXPORT_SYMBOL(ldlm_pool_get_slv); /** - * Sets passed \a slv to \a pl. - * - * \pre ->pl_lock is not locked. - */ -void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv) -{ - spin_lock(&pl->pl_lock); - pl->pl_server_lock_volume = slv; - spin_unlock(&pl->pl_lock); -} -EXPORT_SYMBOL(ldlm_pool_set_slv); - -/** * Sets passed \a clv to \a pl. * * \pre ->pl_lock is not locked. -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/32] staging/lustre/ldlm: Remove unused ldlm_pool_get_clv()
From: Oleg Drokin Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 16 2 files changed, 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 4d81e73..1b5f298 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1401,7 +1401,6 @@ int ldlm_pool_setup(struct ldlm_pool *pl, int limit); int ldlm_pool_recalc(struct ldlm_pool *pl); __u32 ldlm_pool_get_lvf(struct ldlm_pool *pl); __u64 ldlm_pool_get_slv(struct ldlm_pool *pl); -__u64 ldlm_pool_get_clv(struct ldlm_pool *pl); __u32 ldlm_pool_get_limit(struct ldlm_pool *pl); void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv); void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 1c9d67f..cbe4b7b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -1023,22 +1023,6 @@ void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv) EXPORT_SYMBOL(ldlm_pool_set_slv); /** - * Returns current \a pl CLV. - * - * \pre ->pl_lock is not locked. - */ -__u64 ldlm_pool_get_clv(struct ldlm_pool *pl) -{ - __u64 slv; - - spin_lock(&pl->pl_lock); - slv = pl->pl_client_lock_volume; - spin_unlock(&pl->pl_lock); - return slv; -} -EXPORT_SYMBOL(ldlm_pool_get_clv); - -/** * Sets passed \a clv to \a pl. * * \pre ->pl_lock is not locked. -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/32] staging/lustre/ldlm: Remove unused ldlm_enqueue_pack()
From: Oleg Drokin Not used anywhere Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 21 - 2 files changed, 22 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index ce91ccc..72c52ef 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1307,7 +1307,6 @@ int ldlm_prep_elc_req(struct obd_export *exp, int version, int opc, int canceloff, struct list_head *cancels, int count); -struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp, int lvb_len); int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ldlm_type_t type, __u8 with_policy, ldlm_mode_t mode, __u64 *flags, void *lvb, __u32 lvb_len, diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 9856133..c73661c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -742,27 +742,6 @@ int ldlm_prep_enqueue_req(struct obd_export *exp, struct ptlrpc_request *req, } EXPORT_SYMBOL(ldlm_prep_enqueue_req); -struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp, int lvb_len) -{ - struct ptlrpc_request *req; - int rc; - - req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE); - if (req == NULL) - return ERR_PTR(-ENOMEM); - - rc = ldlm_prep_enqueue_req(exp, req, NULL, 0); - if (rc) { - ptlrpc_request_free(req); - return ERR_PTR(rc); - } - - req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len); - ptlrpc_request_set_replen(req); - return req; -} -EXPORT_SYMBOL(ldlm_enqueue_pack); - /** * Client-side lock enqueue. * -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/32] staging/lustre/lov: Remove unused lov_dump_lmm/pool()
From: Oleg Drokin These generic switch functions appear to be unused as all the individual ones are called directly. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/lov/lov_internal.h | 2 -- drivers/staging/lustre/lustre/lov/lov_pack.c | 20 drivers/staging/lustre/lustre/lov/lov_pool.c | 22 -- 3 files changed, 44 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index dde9656..0de39cc 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -220,7 +220,6 @@ int lov_free_memmd(struct lov_stripe_md **lsmp); void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm); void lov_dump_lmm_v3(int level, struct lov_mds_md_v3 *lmm); void lov_dump_lmm_common(int level, void *lmmp); -void lov_dump_lmm(int level, void *lmm); /* lov_ea.c */ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size); @@ -248,7 +247,6 @@ int lov_pool_new(struct obd_device *obd, char *poolname); int lov_pool_del(struct obd_device *obd, char *poolname); int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname); int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname); -void lov_dump_pool(int level, struct pool_desc *pool); struct pool_desc *lov_find_pool(struct lov_obd *lov, char *poolname); int lov_check_index_in_pool(__u32 idx, struct pool_desc *pool); void lov_pool_putref(struct pool_desc *pool); diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 6b1c135..05651ac 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -100,26 +100,6 @@ void lov_dump_lmm_v3(int level, struct lov_mds_md_v3 *lmm) le16_to_cpu(lmm->lmm_stripe_count)); } -void lov_dump_lmm(int level, void *lmm) -{ - int magic; - - magic = le32_to_cpu(((struct lov_mds_md *)lmm)->lmm_magic); - switch (magic) { - case LOV_MAGIC_V1: - lov_dump_lmm_v1(level, (struct lov_mds_md_v1 *)lmm); - break; - case LOV_MAGIC_V3: - lov_dump_lmm_v3(level, (struct lov_mds_md_v3 *)lmm); - break; - default: - CDEBUG(level, "unrecognized lmm_magic %x, assuming %x\n", - magic, LOV_MAGIC_V1); - lov_dump_lmm_common(level, lmm); - break; - } -} - /* Pack LOV object metadata for disk storage. It is packed in LE byte * order and is opaque to the networking layer. * diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index c59b140..f996348 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -294,28 +294,6 @@ static struct file_operations pool_proc_operations = { .release= seq_release, }; -void lov_dump_pool(int level, struct pool_desc *pool) -{ - int i; - - lov_pool_getref(pool); - - CDEBUG(level, "pool "LOV_POOLNAMEF" has %d members\n", - pool->pool_name, pool->pool_obds.op_count); - down_read(&pool_tgt_rw_sem(pool)); - - for (i = 0; i < pool_tgt_count(pool) ; i++) { - if (!pool_tgt(pool, i) || !(pool_tgt(pool, i))->ltd_exp) - continue; - CDEBUG(level, "pool "LOV_POOLNAMEF"[%d] = %s\n", - pool->pool_name, i, - obd_uuid2str(&((pool_tgt(pool, i))->ltd_uuid))); - } - - up_read(&pool_tgt_rw_sem(pool)); - lov_pool_putref(pool); -} - #define LOV_POOL_INIT_COUNT 2 int lov_ost_pool_init(struct ost_pool *op, unsigned int count) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/32] staging/lustre/ldlm: Get rid of lr_converting queue
From: Oleg Drokin Now that we removed all the lock conversion functions, also get rid of the converson queue since nothing could ever get there anyway. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 10 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 9 - drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 12 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index bea526b..40377b2 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -883,8 +883,6 @@ struct ldlm_resource { * @{ */ /** List of locks in granted state */ struct list_headlr_granted; - /** List of locks waiting to change their granted mode (converted) */ - struct list_headlr_converting; /** * List of locks that could not be granted due to conflicts and * that are waiting for conflicts to go away */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 0597fec..7f9d3c1 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1260,12 +1260,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, rc = 0; goto out; } - lock = search_queue(&res->lr_converting, &mode, policy, old_lock, - flags, unref); - if (lock != NULL) { - rc = 1; - goto out; - } lock = search_queue(&res->lr_waiting, &mode, policy, old_lock, flags, unref); if (lock != NULL) { @@ -1634,9 +1628,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns, * FIXME (bug 268): Detect obvious lies by checking compatibility in * granted/converting queues. */ if (local) { - if (*flags & LDLM_FL_BLOCK_CONV) - ldlm_resource_add_lock(res, &res->lr_converting, lock); - else if (*flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED)) + if (*flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED)) ldlm_resource_add_lock(res, &res->lr_waiting, lock); else ldlm_grant_lock(lock, NULL); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 5bd66c3..760c745 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -1878,15 +1878,6 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter, } } - list_for_each_safe(tmp, next, &res->lr_converting) { - lock = list_entry(tmp, struct ldlm_lock, l_res_link); - - if (iter(lock, closure) == LDLM_ITER_STOP) { - rc = LDLM_ITER_STOP; - goto out; - } - } - list_for_each_safe(tmp, next, &res->lr_waiting) { lock = list_entry(tmp, struct ldlm_lock, l_res_link); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index cc212b9..dac2ec2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -792,7 +792,6 @@ static int ldlm_resource_clean(struct cfs_hash *hs, struct cfs_hash_bd *bd, __u64 flags = *(__u64 *)arg; cleanup_resource(res, &res->lr_granted, flags); - cleanup_resource(res, &res->lr_converting, flags); cleanup_resource(res, &res->lr_waiting, flags); return 0; @@ -1059,7 +1058,6 @@ static struct ldlm_resource *ldlm_resource_new(void) return NULL; INIT_LIST_HEAD(&res->lr_granted); - INIT_LIST_HEAD(&res->lr_converting); INIT_LIST_HEAD(&res->lr_waiting); /* Initialize interval trees for each lock mode. */ @@ -1224,11 +1222,6 @@ static void __ldlm_resource_putref_final(struct cfs_hash_bd *bd, LBUG(); } - if (!list_empty(&res->lr_converting)) { - ldlm_resource_dump(D_ERROR, res); - LBUG(); - } - if (!list_empty(&res->lr_waiting)) { ldlm_resource_dump(D_ERROR, res); LBUG(); @@ -1451,11 +1444,6 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res) } } } - if (!list_empty(&res->lr_converting)) { - CDEBUG(level, "Converting locks:\n"); - list_for_each_entry(lock, &res->lr_converting, l_res_link) -
[PATCH 13/32] staging/lustre/ldlm: Remove unused ldlm_init/fini_flock_export
From: Oleg Drokin And all supporting export infrastructure. There's no use for it all on client. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 102 - drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 - 2 files changed, 104 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index ab670fc..bb8ecc8 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -755,105 +755,3 @@ void ldlm_flock_policy_local_to_wire(const ldlm_policy_data_t *lpolicy, wpolicy->l_flock.lfw_pid = lpolicy->l_flock.pid; wpolicy->l_flock.lfw_owner = lpolicy->l_flock.owner; } - -/* - * Export handle<->flock hash operations. - */ -static unsigned -ldlm_export_flock_hash(struct cfs_hash *hs, const void *key, unsigned mask) -{ - return cfs_hash_u64_hash(*(__u64 *)key, mask); -} - -static void * -ldlm_export_flock_key(struct hlist_node *hnode) -{ - struct ldlm_lock *lock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); - return &lock->l_policy_data.l_flock.owner; -} - -static int -ldlm_export_flock_keycmp(const void *key, struct hlist_node *hnode) -{ - return !memcmp(ldlm_export_flock_key(hnode), key, sizeof(__u64)); -} - -static void * -ldlm_export_flock_object(struct hlist_node *hnode) -{ - return hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); -} - -static void -ldlm_export_flock_get(struct cfs_hash *hs, struct hlist_node *hnode) -{ - struct ldlm_lock *lock; - struct ldlm_flock *flock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); - LDLM_LOCK_GET(lock); - - flock = &lock->l_policy_data.l_flock; - LASSERT(flock->blocking_export != NULL); - class_export_get(flock->blocking_export); - flock->blocking_refs++; -} - -static void -ldlm_export_flock_put(struct cfs_hash *hs, struct hlist_node *hnode) -{ - struct ldlm_lock *lock; - struct ldlm_flock *flock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); - LDLM_LOCK_RELEASE(lock); - - flock = &lock->l_policy_data.l_flock; - LASSERT(flock->blocking_export != NULL); - class_export_put(flock->blocking_export); - if (--flock->blocking_refs == 0) { - flock->blocking_owner = 0; - flock->blocking_export = NULL; - } -} - -static cfs_hash_ops_t ldlm_export_flock_ops = { - .hs_hash= ldlm_export_flock_hash, - .hs_key = ldlm_export_flock_key, - .hs_keycmp = ldlm_export_flock_keycmp, - .hs_object = ldlm_export_flock_object, - .hs_get = ldlm_export_flock_get, - .hs_put = ldlm_export_flock_put, - .hs_put_locked = ldlm_export_flock_put, -}; - -int ldlm_init_flock_export(struct obd_export *exp) -{ - if (strcmp(exp->exp_obd->obd_type->typ_name, LUSTRE_MDT_NAME) != 0) - return 0; - - exp->exp_flock_hash = - cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid), - HASH_EXP_LOCK_CUR_BITS, - HASH_EXP_LOCK_MAX_BITS, - HASH_EXP_LOCK_BKT_BITS, 0, - CFS_HASH_MIN_THETA, CFS_HASH_MAX_THETA, - &ldlm_export_flock_ops, - CFS_HASH_DEFAULT | CFS_HASH_NBLK_CHANGE); - if (!exp->exp_flock_hash) - return -ENOMEM; - - return 0; -} -EXPORT_SYMBOL(ldlm_init_flock_export); - -void ldlm_destroy_flock_export(struct obd_export *exp) -{ - if (exp->exp_flock_hash) { - cfs_hash_putref(exp->exp_flock_hash); - exp->exp_flock_hash = NULL; - } -} -EXPORT_SYMBOL(ldlm_destroy_flock_export); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index e870b3e..1293f13 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -188,8 +188,6 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock); int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ldlm_error_t *err, struct list_head *work_list); -int ldlm_init_flock_export(struct obd_export *exp); -void ldlm_destroy_flock_export(struct obd_export *exp); /* l_lock.c */ void l_check_ns_lock(struct ldlm_namespace *ns); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/32] staging/lustre: Remove ununused ll_ra_read_get()
From: Oleg Drokin Also ll_ra_read_get_locked that was only used by it. Signed-off-by: Oleg Drokin --- .../staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/rw.c | 24 -- 2 files changed, 25 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 59fdbed..d6bdfed 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -657,7 +657,6 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi) void ll_ra_read_in(struct file *f, struct ll_ra_read *rar); void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar); -struct ll_ra_read *ll_ra_read_get(struct file *f); /* llite/lproc_llite.c */ int ldebugfs_register_mountpoint(struct dentry *parent, diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 8c1bfd2..71be194 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -417,30 +417,6 @@ void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar) spin_unlock(&ras->ras_lock); } -static struct ll_ra_read *ll_ra_read_get_locked(struct ll_readahead_state *ras) -{ - struct ll_ra_read *scan; - - list_for_each_entry(scan, &ras->ras_read_beads, lrr_linkage) { - if (scan->lrr_reader == current) - return scan; - } - return NULL; -} - -struct ll_ra_read *ll_ra_read_get(struct file *f) -{ - struct ll_readahead_state *ras; - struct ll_ra_read*bead; - - ras = ll_ras_get(f); - - spin_lock(&ras->ras_lock); - bead = ll_ra_read_get_locked(ras); - spin_unlock(&ras->ras_lock); - return bead; -} - static int cl_read_ahead_page(const struct lu_env *env, struct cl_io *io, struct cl_page_list *queue, struct cl_page *page, struct page *vmpage) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/32] staging/lustre/ldlm: Remove ldlm_refresh/del_waiting_lock()
From: Oleg Drokin Nothing adds locks into waiting list on the client, so no point in retaining those. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 13 - 3 files changed, 23 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index ec717eb..5a72f22 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1108,8 +1108,6 @@ struct ldlm_callback_suite { }; /* ldlm_lockd.c */ -int ldlm_del_waiting_lock(struct ldlm_lock *lock); -int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout); int ldlm_get_ref(void); void ldlm_put_ref(void); struct ldlm_lock *ldlm_request_lock(struct ptlrpc_request *req); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 536f97c..133936e 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1947,17 +1947,9 @@ void ldlm_lock_cancel(struct ldlm_lock *lock) LBUG(); } - if (lock->l_flags & LDLM_FL_WAITED) - ldlm_del_waiting_lock(lock); - /* Releases cancel callback. */ ldlm_cancel_callback(lock); - /* Yes, second time, just in case it was added again while we were -* running with no res lock in ldlm_cancel_callback */ - if (lock->l_flags & LDLM_FL_WAITED) - ldlm_del_waiting_lock(lock); - ldlm_resource_unlink_lock(lock); ldlm_lock_destroy_nolock(lock); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index 57f6128..045e3c6 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -111,19 +111,6 @@ struct ldlm_bl_work_item { int blwi_mem_pressure; }; - -int ldlm_del_waiting_lock(struct ldlm_lock *lock) -{ - return 0; -} - -int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout) -{ - return 0; -} - - - /** * Callback handler for receiving incoming blocking ASTs. * -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/32] staging/lustre: KEY_DEFAULT/MAX_COOKIESIZE key is unused, remove them
From: Oleg Drokin Also remove the lmv and mdc infrastructure to query these keys. In fact this whole "unlink cookies" thing becomes irrelevant with newer servers, but since we still retain 2.[123] servers commpatibility, we cannot completely remove all traces of it yet. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/obd.h | 2 -- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 -- drivers/staging/lustre/lustre/mdc/mdc_request.c | 20 3 files changed, 24 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 314f5c7..5de9776 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -840,8 +840,6 @@ enum obd_cleanup_stage { #define KEY_LOV_IDX "lov_idx" #define KEY_MAX_EASIZE "max_easize" #define KEY_DEFAULT_EASIZE "default_easize" -#define KEY_MAX_COOKIESIZE "max_cookiesize" -#define KEY_DEFAULT_COOKIESIZE "default_cookiesize" #define KEY_MDS_CONN "mds_conn" #define KEY_MGSSEC "mgssec" #define KEY_NEXT_ID "next_id" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 8f0ffa4..7e6a060 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -2322,8 +2322,6 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp, return -EINVAL; } else if (KEY_IS(KEY_MAX_EASIZE) || KEY_IS(KEY_DEFAULT_EASIZE) || - KEY_IS(KEY_MAX_COOKIESIZE) || - KEY_IS(KEY_DEFAULT_COOKIESIZE) || KEY_IS(KEY_CONN_DATA)) { rc = lmv_check_connect(obd); if (rc) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 8726176..dc234a7 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2124,26 +2124,6 @@ static int mdc_get_info(const struct lu_env *env, struct obd_export *exp, default_easize = val; *default_easize = exp->exp_obd->u.cli.cl_default_mds_easize; return 0; - } else if (KEY_IS(KEY_MAX_COOKIESIZE)) { - int mdsize, *max_cookiesize; - - if (*vallen != sizeof(int)) - return -EINVAL; - mdsize = *(int *)val; - if (mdsize > exp->exp_obd->u.cli.cl_max_mds_cookiesize) - exp->exp_obd->u.cli.cl_max_mds_cookiesize = mdsize; - max_cookiesize = val; - *max_cookiesize = exp->exp_obd->u.cli.cl_max_mds_cookiesize; - return 0; - } else if (KEY_IS(KEY_DEFAULT_COOKIESIZE)) { - int *default_cookiesize; - - if (*vallen != sizeof(int)) - return -EINVAL; - default_cookiesize = val; - *default_cookiesize = - exp->exp_obd->u.cli.cl_default_mds_cookiesize; - return 0; } else if (KEY_IS(KEY_CONN_DATA)) { struct obd_import *imp = class_exp2cliimp(exp); struct obd_connect_data *data = val; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/32] staging/lustre/llite: Remove unused ll_get_default/max_cookiesize()
From: Oleg Drokin This was used for a function that's no longer important, but is no longer used anywhere. Signed-off-by: Oleg Drokin --- .../staging/lustre/lustre/llite/llite_internal.h | 2 -- drivers/staging/lustre/lustre/llite/llite_lib.c| 26 -- 2 files changed, 28 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index dcf7c6b..59fdbed 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -789,8 +789,6 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, int ll_obd_statfs(struct inode *inode, void *arg); int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize); int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize); -int ll_get_max_cookiesize(struct ll_sb_info *sbi, int *max_cookiesize); -int ll_get_default_cookiesize(struct ll_sb_info *sbi, int *default_cookiesize); int ll_process_config(struct lustre_cfg *lcfg); struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data, struct inode *i1, struct inode *i2, diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index b6234b2..e1d8fb0 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -604,32 +604,6 @@ int ll_get_default_mdsize(struct ll_sb_info *sbi, int *lmmsize) return rc; } -int ll_get_max_cookiesize(struct ll_sb_info *sbi, int *lmmsize) -{ - int size, rc; - - size = sizeof(int); - rc = obd_get_info(NULL, sbi->ll_md_exp, sizeof(KEY_MAX_COOKIESIZE), - KEY_MAX_COOKIESIZE, &size, lmmsize, NULL); - if (rc) - CERROR("Get max cookiesize error rc %d\n", rc); - - return rc; -} - -int ll_get_default_cookiesize(struct ll_sb_info *sbi, int *lmmsize) -{ - int size, rc; - - size = sizeof(int); - rc = obd_get_info(NULL, sbi->ll_md_exp, sizeof(KEY_DEFAULT_COOKIESIZE), - KEY_DEFAULT_COOKIESIZE, &size, lmmsize, NULL); - if (rc) - CERROR("Get default cookiesize error rc %d\n", rc); - - return rc; -} - static void client_common_put_super(struct super_block *sb) { struct ll_sb_info *sbi = ll_s2sbi(sb); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/32] staging/lustre/ldlm: Remove unimplemented lock conversion traces.
From: Oleg Drokin Lock conversion is not really implemented, so let's stop pretending here. This removes ldlm_lock_convert, ldlm_cli_lock_convert and ldlm_lock_downgrade. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 4 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 119 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 101 - 3 files changed, 224 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 03eea32..bea526b 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1228,9 +1228,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, struct lustre_handle *, int unref); ldlm_mode_t ldlm_revalidate_lock_handle(struct lustre_handle *lockh, __u64 *bits); -struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, - __u32 *flags); -void ldlm_lock_downgrade(struct ldlm_lock *lock, int new_mode); void ldlm_lock_cancel(struct ldlm_lock *lock); void ldlm_reprocess_all(struct ldlm_resource *res); void ldlm_reprocess_all_ns(struct ldlm_namespace *ns); @@ -1332,7 +1329,6 @@ int ldlm_cli_enqueue_local(struct ldlm_namespace *ns, struct lustre_handle *lockh); int ldlm_server_ast(struct lustre_handle *lockh, struct ldlm_lock_desc *new, void *data, __u32 data_len); -int ldlm_cli_convert(struct lustre_handle *, int new_mode, __u32 *flags); int ldlm_cli_update_pool(struct ptlrpc_request *req); int ldlm_cli_cancel(struct lustre_handle *lockh, ldlm_cancel_flags_t cancel_flags); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index b257b89..0597fec 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -2012,125 +2012,6 @@ struct export_cl_data { }; /** - * Downgrade an exclusive lock. - * - * A fast variant of ldlm_lock_convert for conversion of exclusive - * locks. The conversion is always successful. - * Used by Commit on Sharing (COS) code. - * - * \param lock A lock to convert - * \param new_mode new lock mode - */ -void ldlm_lock_downgrade(struct ldlm_lock *lock, int new_mode) -{ - LASSERT(lock->l_granted_mode & (LCK_PW | LCK_EX)); - LASSERT(new_mode == LCK_COS); - - lock_res_and_lock(lock); - ldlm_resource_unlink_lock(lock); - /* -* Remove the lock from pool as it will be added again in -* ldlm_grant_lock() called below. -*/ - ldlm_pool_del(&ldlm_lock_to_ns(lock)->ns_pool, lock); - - lock->l_req_mode = new_mode; - ldlm_grant_lock(lock, NULL); - unlock_res_and_lock(lock); - ldlm_reprocess_all(lock->l_resource); -} -EXPORT_SYMBOL(ldlm_lock_downgrade); - -/** - * Attempt to convert already granted lock to a different mode. - * - * While lock conversion is not currently used, future client-side - * optimizations could take advantage of it to avoid discarding cached - * pages on a file. - */ -struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, - __u32 *flags) -{ - LIST_HEAD(rpc_list); - struct ldlm_resource *res; - struct ldlm_namespace *ns; - int granted = 0; - struct ldlm_interval *node; - - /* Just return if mode is unchanged. */ - if (new_mode == lock->l_granted_mode) { - *flags |= LDLM_FL_BLOCK_GRANTED; - return lock->l_resource; - } - - /* I can't check the type of lock here because the bitlock of lock -* is not held here, so do the allocation blindly. -jay */ - OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, GFP_NOFS); - if (node == NULL) - /* Actually, this causes EDEADLOCK to be returned */ - return NULL; - - LASSERTF((new_mode == LCK_PW && lock->l_granted_mode == LCK_PR), -"new_mode %u, granted %u\n", new_mode, lock->l_granted_mode); - - lock_res_and_lock(lock); - - res = lock->l_resource; - ns = ldlm_res_to_ns(res); - - lock->l_req_mode = new_mode; - if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS) { - ldlm_resource_unlink_lock(lock); - } else { - ldlm_resource_unlink_lock(lock); - if (res->lr_type == LDLM_EXTENT) { - /* FIXME: ugly code, I have to attach the lock to a -* interval node again since perhaps it will be granted -* soon */ - INIT_LIST_HEAD(&node->li_group); - ldlm_interval_attach(node, lock); - node
[PATCH 08/32] staging/lustre/ldlm: Remove unused ldlm_cancel_locks_for_exports()
From: Oleg Drokin This is only used on the server in case a client gets disconnected. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 50 -- 2 files changed, 52 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index fa4b7c7..e870b3e 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -164,8 +164,6 @@ void ldlm_lock_add_to_lru(struct ldlm_lock *lock); void ldlm_lock_touch_in_lru(struct ldlm_lock *lock); void ldlm_lock_destroy_nolock(struct ldlm_lock *lock); -void ldlm_cancel_locks_for_export(struct obd_export *export); - /* ldlm_lockd.c */ int ldlm_bl_to_thread_lock(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld, struct ldlm_lock *lock); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 12eb5ac..b257b89 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -2012,56 +2012,6 @@ struct export_cl_data { }; /** - * Iterator function for ldlm_cancel_locks_for_export. - * Cancels passed locks. - */ -int ldlm_cancel_locks_for_export_cb(struct cfs_hash *hs, struct cfs_hash_bd *bd, - struct hlist_node *hnode, void *data) - -{ - struct export_cl_data *ecl = (struct export_cl_data *)data; - struct obd_export *exp = ecl->ecl_exp; - struct ldlm_lock *lock = cfs_hash_object(hs, hnode); - struct ldlm_resource *res; - - res = ldlm_resource_getref(lock->l_resource); - LDLM_LOCK_GET(lock); - - LDLM_DEBUG(lock, "export %p", exp); - ldlm_res_lvbo_update(res, NULL, 1); - ldlm_lock_cancel(lock); - ldlm_reprocess_all(res); - ldlm_resource_putref(res); - LDLM_LOCK_RELEASE(lock); - - ecl->ecl_loop++; - if ((ecl->ecl_loop & -ecl->ecl_loop) == ecl->ecl_loop) { - CDEBUG(D_INFO, - "Cancel lock %p for export %p (loop %d), still have %d locks left on hash table.\n", - lock, exp, ecl->ecl_loop, - atomic_read(&hs->hs_count)); - } - - return 0; -} - -/** - * Cancel all locks for given export. - * - * Typically called on client disconnection/eviction - */ -void ldlm_cancel_locks_for_export(struct obd_export *exp) -{ - struct export_cl_data ecl = { - .ecl_exp= exp, - .ecl_loop = 0, - }; - - cfs_hash_for_each_empty(exp->exp_lock_hash, - ldlm_cancel_locks_for_export_cb, &ecl); -} - -/** * Downgrade an exclusive lock. * * A fast variant of ldlm_lock_convert for conversion of exclusive -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/32] staging/lustre/ldlm: Remove unused ldlm_cli_enqueue_local()
From: Oleg Drokin This is only used on the server. Also while we are at it, remove unused prototypes for ldlm_server_ast and ldlm_handle_enqueue0() that are not defined anywhere Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 15 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 68 -- 2 files changed, 83 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 40377b2..ce91ccc 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1308,25 +1308,10 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct list_head *cancels, int count); struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp, int lvb_len); -int ldlm_handle_enqueue0(struct ldlm_namespace *ns, struct ptlrpc_request *req, -const struct ldlm_request *dlm_req, -const struct ldlm_callback_suite *cbs); int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ldlm_type_t type, __u8 with_policy, ldlm_mode_t mode, __u64 *flags, void *lvb, __u32 lvb_len, struct lustre_handle *lockh, int rc); -int ldlm_cli_enqueue_local(struct ldlm_namespace *ns, - const struct ldlm_res_id *res_id, - ldlm_type_t type, ldlm_policy_data_t *policy, - ldlm_mode_t mode, __u64 *flags, - ldlm_blocking_callback blocking, - ldlm_completion_callback completion, - ldlm_glimpse_callback glimpse, - void *data, __u32 lvb_len, enum lvb_type lvb_type, - const __u64 *client_cookie, - struct lustre_handle *lockh); -int ldlm_server_ast(struct lustre_handle *lockh, struct ldlm_lock_desc *new, - void *data, __u32 data_len); int ldlm_cli_update_pool(struct ptlrpc_request *req); int ldlm_cli_cancel(struct lustre_handle *lockh, ldlm_cancel_flags_t cancel_flags); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 760c745..9856133 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -386,74 +386,6 @@ int ldlm_glimpse_ast(struct ldlm_lock *lock, void *reqp) } EXPORT_SYMBOL(ldlm_glimpse_ast); -/** - * Enqueue a local lock (typically on a server). - */ -int ldlm_cli_enqueue_local(struct ldlm_namespace *ns, - const struct ldlm_res_id *res_id, - ldlm_type_t type, ldlm_policy_data_t *policy, - ldlm_mode_t mode, __u64 *flags, - ldlm_blocking_callback blocking, - ldlm_completion_callback completion, - ldlm_glimpse_callback glimpse, - void *data, __u32 lvb_len, enum lvb_type lvb_type, - const __u64 *client_cookie, - struct lustre_handle *lockh) -{ - struct ldlm_lock *lock; - int err; - const struct ldlm_callback_suite cbs = { .lcs_completion = completion, -.lcs_blocking = blocking, -.lcs_glimpse= glimpse, - }; - - LASSERT(!(*flags & LDLM_FL_REPLAY)); - if (unlikely(ns_is_client(ns))) { - CERROR("Trying to enqueue local lock in a shadow namespace\n"); - LBUG(); - } - - lock = ldlm_lock_create(ns, res_id, type, mode, &cbs, data, lvb_len, - lvb_type); - if (unlikely(!lock)) { - err = -ENOMEM; - goto out_nolock; - } - - ldlm_lock2handle(lock, lockh); - - /* NB: we don't have any lock now (lock_res_and_lock) -* because it's a new lock */ - ldlm_lock_addref_internal_nolock(lock, mode); - lock->l_flags |= LDLM_FL_LOCAL; - if (*flags & LDLM_FL_ATOMIC_CB) - lock->l_flags |= LDLM_FL_ATOMIC_CB; - - if (policy != NULL) - lock->l_policy_data = *policy; - if (client_cookie != NULL) - lock->l_client_cookie = *client_cookie; - if (type == LDLM_EXTENT) - lock->l_req_extent = policy->l_extent; - - err = ldlm_lock_enqueue(ns, &lock, policy, flags); - if (unlikely(err != ELDLM_OK)) - goto out; - - if (policy != NULL) - *policy = lock->l_policy_data; - - if (lock->l_completion_ast) - lock->l_completion_ast(lock, *flags, NULL); - - LDLM_DEBUG(lock, "client-side local enqueue handler, ne
[PATCH 24/32] staging/lustre/ldlm: Remove unused ldlm_resource_insert_lock_after()
From: Oleg Drokin It was only used on the server. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 26 -- 2 files changed, 28 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index 1293f13..56805d0 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -116,8 +116,6 @@ int ldlm_get_enq_timeout(struct ldlm_lock *lock); /* ldlm_resource.c */ int ldlm_resource_putref_locked(struct ldlm_resource *res); -void ldlm_resource_insert_lock_after(struct ldlm_lock *original, -struct ldlm_lock *new); void ldlm_namespace_free_prior(struct ldlm_namespace *ns, struct obd_import *imp, int force); void ldlm_namespace_free_post(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 cd65efe..9906372 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -1281,32 +1281,6 @@ void ldlm_resource_add_lock(struct ldlm_resource *res, struct list_head *head, list_add_tail(&lock->l_res_link, head); } -/** - * Insert a lock into resource after specified lock. - * - * Obtain resource description from the lock we are inserting after. - */ -void ldlm_resource_insert_lock_after(struct ldlm_lock *original, -struct ldlm_lock *new) -{ - struct ldlm_resource *res = original->l_resource; - - check_res_locked(res); - - ldlm_resource_dump(D_INFO, res); - LDLM_DEBUG(new, "About to insert this lock after %p:\n", original); - - if (new->l_flags & LDLM_FL_DESTROYED) { - CDEBUG(D_OTHER, "Lock destroyed, not adding to resource\n"); - goto out; - } - - LASSERT(list_empty(&new->l_res_link)); - - list_add(&new->l_res_link, &original->l_res_link); - out:; -} - void ldlm_resource_unlink_lock(struct ldlm_lock *lock) { int type = lock->l_resource->lr_type; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/32] staging/lustre/ldlm: Remove ldlm_errno2error()
From: Oleg Drokin This particular incarnation is only used on the server. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 36 -- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 72c52ef..43b 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1161,8 +1161,7 @@ static inline int ldlm_res_lvbo_update(struct ldlm_resource *res, } int ldlm_error2errno(ldlm_error_t error); -ldlm_error_t ldlm_errno2error(int err_no); /* don't call it `errno': this - * confuses user-space. */ + #if LUSTRE_TRACKS_LOCK_EXP_REFS void ldlm_dump_export_locks(struct obd_export *exp); #endif diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index 584c4e6..b840200 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -814,42 +814,6 @@ int ldlm_error2errno(ldlm_error_t error) } EXPORT_SYMBOL(ldlm_error2errno); -/** - * Dual to ldlm_error2errno(): maps errno values back to ldlm_error_t. - */ -ldlm_error_t ldlm_errno2error(int err_no) -{ - int error; - - switch (err_no) { - case 0: - error = ELDLM_OK; - break; - case -ESTALE: - error = ELDLM_LOCK_CHANGED; - break; - case -ENAVAIL: - error = ELDLM_LOCK_ABORTED; - break; - case -ESRCH: - error = ELDLM_LOCK_REPLACED; - break; - case -ENOENT: - error = ELDLM_NO_LOCK_DATA; - break; - case -EEXIST: - error = ELDLM_NAMESPACE_EXISTS; - break; - case -EBADF: - error = ELDLM_BAD_NAMESPACE; - break; - default: - error = err_no; - } - return error; -} -EXPORT_SYMBOL(ldlm_errno2error); - #if LUSTRE_TRACKS_LOCK_EXP_REFS void ldlm_dump_export_locks(struct obd_export *exp) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/32] staging/lustre/ldlm: Remove ldlm_lock_fail_match()
From: Oleg Drokin It's not used anywhere. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 2 files changed, 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 8b2b092..cc5ad4c1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1216,7 +1216,6 @@ int ldlm_lock_addref_try(struct lustre_handle *lockh, __u32 mode); void ldlm_lock_decref(struct lustre_handle *lockh, __u32 mode); void ldlm_lock_decref_and_cancel(struct lustre_handle *lockh, __u32 mode); void ldlm_lock_fail_match_locked(struct ldlm_lock *lock); -void ldlm_lock_fail_match(struct ldlm_lock *lock); void ldlm_lock_allow_match(struct ldlm_lock *lock); void ldlm_lock_allow_match_locked(struct ldlm_lock *lock); ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 7f9d3c1..536f97c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1158,14 +1158,6 @@ void ldlm_lock_fail_match_locked(struct ldlm_lock *lock) } EXPORT_SYMBOL(ldlm_lock_fail_match_locked); -void ldlm_lock_fail_match(struct ldlm_lock *lock) -{ - lock_res_and_lock(lock); - ldlm_lock_fail_match_locked(lock); - unlock_res_and_lock(lock); -} -EXPORT_SYMBOL(ldlm_lock_fail_match); - /** * Mark lock as "matchable" by OST. * -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/32] staging/lustre/ldlm: Remove unused ldlm_reprocess_all*()
From: Oleg Drokin They are only used on the server. Also remove helper functions and cleanup callsites. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 1 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 48 -- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 4 -- 4 files changed, 55 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index c0b2c61..9608373 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1215,8 +1215,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, ldlm_mode_t ldlm_revalidate_lock_handle(struct lustre_handle *lockh, __u64 *bits); void ldlm_lock_cancel(struct ldlm_lock *lock); -void ldlm_reprocess_all(struct ldlm_resource *res); -void ldlm_reprocess_all_ns(struct ldlm_namespace *ns); void ldlm_lock_dump_handle(int level, struct lustre_handle *); void ldlm_unlink_lock_skiplist(struct ldlm_lock *req); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index bb8ecc8..14e6782 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -523,7 +523,6 @@ reprocess: /* At this point we're granting the lock request. */ req->l_granted_mode = req->l_req_mode; - /* Add req to the granted queue before calling ldlm_reprocess_all(). */ if (!added) { list_del_init(&req->l_res_link); /* insert new lock before ownlocks in list. */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 5a07669..e586d33 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1786,54 +1786,6 @@ out: return rc; } -static int reprocess_one_queue(struct ldlm_resource *res, void *closure) -{ - ldlm_reprocess_all(res); - return LDLM_ITER_CONTINUE; -} - -static int ldlm_reprocess_res(struct cfs_hash *hs, struct cfs_hash_bd *bd, - struct hlist_node *hnode, void *arg) -{ - struct ldlm_resource *res = cfs_hash_object(hs, hnode); - intrc; - - rc = reprocess_one_queue(res, arg); - - return rc == LDLM_ITER_STOP; -} - -/** - * Iterate through all resources on a namespace attempting to grant waiting - * locks. - */ -void ldlm_reprocess_all_ns(struct ldlm_namespace *ns) -{ - if (ns != NULL) { - cfs_hash_for_each_nolock(ns->ns_rs_hash, -ldlm_reprocess_res, NULL); - } -} -EXPORT_SYMBOL(ldlm_reprocess_all_ns); - -/** - * Try to grant all waiting locks on a resource. - * - * Calls ldlm_reprocess_queue on converting and waiting queues. - * - * Typically called after some resource locks are cancelled to see - * if anything could be granted as a result of the cancellation. - */ -void ldlm_reprocess_all(struct ldlm_resource *res) -{ - LIST_HEAD(rpc_list); - - if (!ns_is_client(ldlm_res_to_ns(res))) { - CERROR("This is client-side-only module, cannot handle LDLM_NAMESPACE_SERVER resource type lock.\n"); - LBUG(); - } -} - /** * Helper function to call blocking AST for LDLM lock \a lock in a * "cancelling" mode. diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index a9159fd..15e1980 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -188,7 +188,6 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data) } LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, going forward"); - ldlm_reprocess_all(lock->l_resource); return 0; } EXPORT_SYMBOL(ldlm_completion_ast_async); @@ -892,9 +891,6 @@ static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock) LDLM_ERROR(lock, "Trying to cancel local lock"); LBUG(); } - LDLM_DEBUG(lock, "server-side local cancel"); - ldlm_lock_cancel(lock); - ldlm_reprocess_all(lock->l_resource); } return rc; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/32] staging/lustre: Remove ns_is_server()
From: Oleg Drokin Since the code we have is Lustre-client only, this function always returns 0, so drop it and amend all the callsites to drop dead code. One of the places also sets LDLM_FL_NS_SRV to indicate a lock is in a server namespace. This too cannot happen in this code, so drop all such checks as well. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 - drivers/staging/lustre/lustre/ldlm/l_lock.c| 7 ++- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 14 -- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 16 ++-- 4 files changed, 4 insertions(+), 46 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 1e40203..49b5a07 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -465,19 +465,6 @@ struct ldlm_namespace { }; /** - * Returns 1 if namespace \a ns is a server namespace. - */ -static inline int ns_is_server(struct ldlm_namespace *ns) -{ - LASSERT(ns != NULL); - LASSERT(!(ns->ns_client & ~(LDLM_NAMESPACE_CLIENT | - LDLM_NAMESPACE_SERVER))); - LASSERT(ns->ns_client == LDLM_NAMESPACE_CLIENT || - ns->ns_client == LDLM_NAMESPACE_SERVER); - return ns->ns_client == LDLM_NAMESPACE_SERVER; -} - -/** * Returns 1 if namespace \a ns supports early lock cancel (ELC). */ static inline int ns_connect_cancelset(struct ldlm_namespace *ns) diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c b/drivers/staging/lustre/lustre/ldlm/l_lock.c index cd8ab40..e5d1344 100644 --- a/drivers/staging/lustre/lustre/ldlm/l_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c @@ -50,9 +50,7 @@ */ struct ldlm_resource *lock_res_and_lock(struct ldlm_lock *lock) { - /* on server-side resource of lock doesn't change */ - if ((lock->l_flags & LDLM_FL_NS_SRV) == 0) - spin_lock(&lock->l_lock); + spin_lock(&lock->l_lock); lock_res(lock->l_resource); @@ -70,7 +68,6 @@ void unlock_res_and_lock(struct ldlm_lock *lock) lock->l_flags &= ~LDLM_FL_RES_LOCKED; unlock_res(lock->l_resource); - if ((lock->l_flags & LDLM_FL_NS_SRV) == 0) - spin_unlock(&lock->l_lock); + spin_unlock(&lock->l_lock); } EXPORT_SYMBOL(unlock_res_and_lock); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 6d5e7af..827e5df 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -237,11 +237,6 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock) struct ldlm_namespace *ns = ldlm_lock_to_ns(lock); int rc; - if (lock->l_flags & LDLM_FL_NS_SRV) { - LASSERT(list_empty(&lock->l_lru)); - return 0; - } - spin_lock(&ns->ns_lock); rc = ldlm_lock_remove_from_lru_nolock(lock); spin_unlock(&ns->ns_lock); @@ -286,11 +281,6 @@ void ldlm_lock_touch_in_lru(struct ldlm_lock *lock) { struct ldlm_namespace *ns = ldlm_lock_to_ns(lock); - if (lock->l_flags & LDLM_FL_NS_SRV) { - LASSERT(list_empty(&lock->l_lru)); - return; - } - spin_lock(&ns->ns_lock); if (!list_empty(&lock->l_lru)) { ldlm_lock_remove_from_lru_nolock(lock); @@ -799,8 +789,6 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) (lock->l_flags & LDLM_FL_CBPENDING)) { /* If we received a blocked AST and this was the last reference, * run the callback. */ - if ((lock->l_flags & LDLM_FL_NS_SRV) && lock->l_export) - CERROR("FL_CBPENDING set on non-local lock--just a warning\n"); LDLM_DEBUG(lock, "final decref done on cbpending lock"); @@ -1486,8 +1474,6 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns, lock->l_req_mode = mode; lock->l_ast_data = data; lock->l_pid = current_pid(); - if (ns_is_server(ns)) - lock->l_flags |= LDLM_FL_NS_SRV; if (cbs) { lock->l_blocking_ast = cbs->lcs_blocking; lock->l_completion_ast = cbs->lcs_completion; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 94cdf5f..dac1b6f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -656,8 +656,8 @@ EXPORT_SYMBOL(ldlm_pool_setup); static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused) { - int granted, grant_rate, cancel_rate, grant_step; - int grant_speed, grant_plan, lvf; + int granted, grant_rate, cancel_rate; + int grant_speed, lvf; struct ldlm
[PATCH 16/32] staging/lustre/ldlm: Remove ldlm_glimpse_ast()
From: Oleg Drokin Only used on the server. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 28 -- 2 files changed, 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 43b..8b2b092 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1282,7 +1282,6 @@ int ldlm_expired_completion_wait(void *data); int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock); int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, void *data, int flag); -int ldlm_glimpse_ast(struct ldlm_lock *lock, void *reqp); int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data); int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data); /** @} ldlm_local_ast */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index c73661c..a9159fd 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -358,34 +358,6 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, } EXPORT_SYMBOL(ldlm_blocking_ast); -/** - * ->l_glimpse_ast() for DLM extent locks acquired on the server-side. See - * comment in filter_intent_policy() on why you may need this. - */ -int ldlm_glimpse_ast(struct ldlm_lock *lock, void *reqp) -{ - /* -* Returning -ELDLM_NO_LOCK_DATA actually works, but the reason for -* that is rather subtle: with OST-side locking, it may so happen that -* _all_ extent locks are held by the OST. If client wants to obtain -* current file size it calls ll{,u}_glimpse_size(), and (as locks are -* on the server), dummy glimpse callback fires and does -* nothing. Client still receives correct file size due to the -* following fragment in filter_intent_policy(): -* -* rc = l->l_glimpse_ast(l, NULL); // this will update the LVB -* if (rc != 0 && res->lr_namespace->ns_lvbo && -* res->lr_namespace->ns_lvbo->lvbo_update) { -* res->lr_namespace->ns_lvbo->lvbo_update(res, NULL, 0, 1); -* } -* -* that is, after glimpse_ast() fails, filter_lvbo_update() runs, and -* returns correct file size to the client. -*/ - return -ELDLM_NO_LOCK_DATA; -} -EXPORT_SYMBOL(ldlm_glimpse_ast); - static void failed_lock_cleanup(struct ldlm_namespace *ns, struct ldlm_lock *lock, int mode) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/32] staging/lustre/ldlm: Remove unused ldlm_blocking_ast/_nocheck()
From: Oleg Drokin All users are gone, and they were used on the server anyway. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 70 -- 2 files changed, 73 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 9608373..360c7f7 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1264,9 +1264,6 @@ int ldlm_expired_completion_wait(void *data); * also used by client-side lock handlers to perform minimum level base * processing. * @{ */ -int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock); -int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, - void *data, int flag); int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data); int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data); /** @} ldlm_local_ast */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 15e1980..2d28fc2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -287,76 +287,6 @@ noreproc: } EXPORT_SYMBOL(ldlm_completion_ast); -/** - * A helper to build a blocking AST function - * - * Perform a common operation for blocking ASTs: - * deferred lock cancellation. - * - * \param lock the lock blocking or canceling AST was called on - * \retval 0 - * \see mdt_blocking_ast - * \see ldlm_blocking_ast - */ -int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock) -{ - int do_ast; - - lock->l_flags |= LDLM_FL_CBPENDING; - do_ast = !lock->l_readers && !lock->l_writers; - unlock_res_and_lock(lock); - - if (do_ast) { - struct lustre_handle lockh; - int rc; - - LDLM_DEBUG(lock, "already unused, calling ldlm_cli_cancel"); - ldlm_lock2handle(lock, &lockh); - rc = ldlm_cli_cancel(&lockh, LCF_ASYNC); - if (rc < 0) - CERROR("ldlm_cli_cancel: %d\n", rc); - } else { - LDLM_DEBUG(lock, "Lock still has references, will be cancelled later"); - } - return 0; -} -EXPORT_SYMBOL(ldlm_blocking_ast_nocheck); - -/** - * Server blocking AST - * - * ->l_blocking_ast() callback for LDLM locks acquired by server-side - * OBDs. - * - * \param lock the lock which blocks a request or cancelling lock - * \param desc unused - * \param data unused - * \param flag indicates whether this cancelling or blocking callback - * \retval 0 - * \see ldlm_blocking_ast_nocheck - */ -int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, - void *data, int flag) -{ - if (flag == LDLM_CB_CANCELING) { - /* Don't need to do anything here. */ - return 0; - } - - lock_res_and_lock(lock); - /* Get this: if ldlm_blocking_ast is racing with intent_policy, such -* that ldlm_blocking_ast is called just before intent_policy method -* takes the lr_lock, then by the time we get the lock, we might not -* be the correct blocking function anymore. So check, and return -* early, if so. */ - if (lock->l_blocking_ast != ldlm_blocking_ast) { - unlock_res_and_lock(lock); - return 0; - } - return ldlm_blocking_ast_nocheck(lock); -} -EXPORT_SYMBOL(ldlm_blocking_ast); - static void failed_lock_cleanup(struct ldlm_namespace *ns, struct ldlm_lock *lock, int mode) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/32] staging/lustre/ldlm: Remove ldlm_namespace_free()
From: Oleg Drokin It was directly used only on the server. Client side part was split into smaller chunks to avoid deadlocks. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 27 -- 2 files changed, 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index cc5ad4c1..4d81e73 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1236,8 +1236,6 @@ ldlm_namespace_new(struct obd_device *obd, char *name, ldlm_side_t client, ldlm_appetite_t apt, ldlm_ns_type_t ns_type); int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags); -void ldlm_namespace_free(struct ldlm_namespace *ns, -struct obd_import *imp, int force); void ldlm_namespace_register(struct ldlm_namespace *ns, ldlm_side_t client); void ldlm_namespace_unregister(struct ldlm_namespace *ns, ldlm_side_t client); 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 dac2ec2..cd65efe 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -948,33 +948,6 @@ void ldlm_namespace_free_post(struct ldlm_namespace *ns) ldlm_put_ref(); } -/** - * Cleanup the resource, and free namespace. - * bug 12864: - * Deadlock issue: - * proc1: destroy import - * class_disconnect_export(grab cl_sem) -> - * -> ldlm_namespace_free -> - * -> ldebugfs_remove(grab _lprocfs_lock). - * proc2: read proc info - * lprocfs_fops_read(grab _lprocfs_lock) -> - * -> osc_rd_active, etc(grab cl_sem). - * - * So that I have to split the ldlm_namespace_free into two parts - the first - * part ldlm_namespace_free_prior is used to cleanup the resource which is - * being used; the 2nd part ldlm_namespace_free_post is used to unregister the - * lprocfs entries, and then free memory. It will be called w/o cli->cl_sem - * held. - */ -void ldlm_namespace_free(struct ldlm_namespace *ns, -struct obd_import *imp, -int force) -{ - ldlm_namespace_free_prior(ns, imp, force); - ldlm_namespace_free_post(ns); -} -EXPORT_SYMBOL(ldlm_namespace_free); - void ldlm_namespace_get(struct ldlm_namespace *ns) { atomic_inc(&ns->ns_bref); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/32] staging/lustre/ldlm: Make ldlm_add_ast_work_item() static
From: Oleg Drokin Now that ldlm_flock code no longer uses it. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index 6cf3f9f..db3c9b7 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -142,8 +142,6 @@ 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); void ldlm_lock_decref_internal_nolock(struct ldlm_lock *, __u32 mode); -void ldlm_add_ast_work_item(struct ldlm_lock *lock, struct ldlm_lock *new, - struct list_head *work_list); int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list, enum ldlm_desc_ast_t ast_type); int ldlm_lock_remove_from_lru(struct ldlm_lock *lock); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 0ba1ac3..f39375c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -644,8 +644,9 @@ static void ldlm_add_cp_work_item(struct ldlm_lock *lock, * adding function. * Must be called with lr_lock held. */ -void ldlm_add_ast_work_item(struct ldlm_lock *lock, struct ldlm_lock *new, - struct list_head *work_list) +static void ldlm_add_ast_work_item(struct ldlm_lock *lock, + struct ldlm_lock *new, + struct list_head *work_list) { check_res_locked(lock->l_resource); if (new) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/32] staging/lustre/ldlm: Remove intent policies handler.
From: Oleg Drokin This includes ldlm_register_intent(), ns_policy field in the namespace and all of it's users, as this could only happen on the server. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 8 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 85 -- 2 files changed, 13 insertions(+), 80 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 5a72f22..c0b2c61 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -271,10 +271,6 @@ struct ldlm_pool { struct completionpl_kobj_unregister; }; -typedef int (*ldlm_res_policy)(struct ldlm_namespace *, struct ldlm_lock **, - void *req_cookie, ldlm_mode_t mode, __u64 flags, - void *data); - typedef int (*ldlm_cancel_for_recovery)(struct ldlm_lock *lock); /** @@ -427,9 +423,6 @@ struct ldlm_namespace { */ unsigned long ns_next_dump; - /** "policy" function that does actual lock conflict determination */ - ldlm_res_policy ns_policy; - /** * LVB operations for this namespace. * \see struct ldlm_valblock_ops @@ -1113,7 +1106,6 @@ void ldlm_put_ref(void); struct ldlm_lock *ldlm_request_lock(struct ptlrpc_request *req); /* ldlm_lock.c */ -void ldlm_register_intent(struct ldlm_namespace *ns, ldlm_res_policy arg); void ldlm_lock2handle(const struct ldlm_lock *lock, struct lustre_handle *lockh); struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *, __u64 flags); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 133936e..5a07669 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -151,13 +151,6 @@ char *ldlm_it2str(int it) } EXPORT_SYMBOL(ldlm_it2str); - -void ldlm_register_intent(struct ldlm_namespace *ns, ldlm_res_policy arg) -{ - ns->ns_policy = arg; -} -EXPORT_SYMBOL(ldlm_register_intent); - /* * REFCOUNTED LOCK OBJECTS */ @@ -1532,13 +1525,11 @@ out: /** * Enqueue (request) a lock. + * On the client this is called from ldlm_cli_enqueue_fini + * after we already got an initial reply from the server with some status. * * Does not block. As a result of enqueue the lock would be put * into granted or waiting list. - * - * If namespace has intent policy sent and the lock has LDLM_FL_HAS_INTENT flag - * set, skip all the enqueueing and delegate lock processing to intent policy - * function. */ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns, struct ldlm_lock **lockp, @@ -1546,43 +1537,12 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns, { struct ldlm_lock *lock = *lockp; struct ldlm_resource *res = lock->l_resource; - int local = ns_is_client(ldlm_res_to_ns(res)); ldlm_error_t rc = ELDLM_OK; - struct ldlm_interval *node = NULL; lock->l_last_activity = ktime_get_real_seconds(); - /* policies are not executed on the client or during replay */ - if ((*flags & (LDLM_FL_HAS_INTENT|LDLM_FL_REPLAY)) == LDLM_FL_HAS_INTENT - && !local && ns->ns_policy) { - rc = ns->ns_policy(ns, lockp, cookie, lock->l_req_mode, *flags, - NULL); - if (rc == ELDLM_LOCK_REPLACED) { - /* The lock that was returned has already been granted, -* and placed into lockp. If it's not the same as the -* one we passed in, then destroy the old one and our -* work here is done. */ - if (lock != *lockp) { - ldlm_lock_destroy(lock); - LDLM_LOCK_RELEASE(lock); - } - *flags |= LDLM_FL_LOCK_CHANGED; - return 0; - } else if (rc != ELDLM_OK || - (rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) { - ldlm_lock_destroy(lock); - return rc; - } - } - - /* For a replaying lock, it might be already in granted list. So -* unlinking the lock will cause the interval node to be freed, we -* have to allocate the interval node early otherwise we can't regrant -* this lock in the future. - jay */ - if (!local && (*flags & LDLM_FL_REPLAY) && res->lr_type == LDLM_EXTENT) - OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, GFP_NOFS); lock_res_and_lock(lock); - if (local && lock->l_req_mode == lock->l_granted_mode) { + if (lock->l_req_mode == lock->l_granted_mode) {
[PATCH 30/32] staging/lustre/ldlm: Remove ldlm_namespace_inactive_list()
From: Oleg Drokin Since there are no server namespaces, just replace it with ldlm_cli_inactive_namespace_list pointer. Also make ldlm_cli_inactive_namespace_list static as it's only used in ldlm_resource.c Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 7 --- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 +++ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index e63a1c9..6cf3f9f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -42,7 +42,6 @@ extern struct mutex ldlm_srv_namespace_lock; extern struct list_head ldlm_srv_namespace_list; extern struct mutex ldlm_cli_namespace_lock; extern struct list_head ldlm_cli_active_namespace_list; -extern struct list_head ldlm_cli_inactive_namespace_list; static inline int ldlm_namespace_nr_read(ldlm_side_t client) { @@ -72,12 +71,6 @@ static inline struct list_head *ldlm_namespace_list(ldlm_side_t client) &ldlm_srv_namespace_list : &ldlm_cli_active_namespace_list; } -static inline struct list_head *ldlm_namespace_inactive_list(ldlm_side_t client) -{ - return client == LDLM_NAMESPACE_SERVER ? - &ldlm_srv_namespace_list : &ldlm_cli_inactive_namespace_list; -} - static inline struct mutex *ldlm_namespace_lock(ldlm_side_t client) { return client == LDLM_NAMESPACE_SERVER ? diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index de1b443..9152423 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -59,7 +59,7 @@ struct mutex ldlm_cli_namespace_lock; * inactive list */ LIST_HEAD(ldlm_cli_active_namespace_list); /* Client namespaces that don't have any locks in them */ -LIST_HEAD(ldlm_cli_inactive_namespace_list); +static LIST_HEAD(ldlm_cli_inactive_namespace_list); static struct dentry *ldlm_debugfs_dir; static struct dentry *ldlm_ns_debugfs_dir; @@ -609,7 +609,7 @@ static void ldlm_namespace_register(struct ldlm_namespace *ns, { mutex_lock(ldlm_namespace_lock(client)); LASSERT(list_empty(&ns->ns_list_chain)); - list_add(&ns->ns_list_chain, ldlm_namespace_inactive_list(client)); + list_add(&ns->ns_list_chain, &ldlm_cli_inactive_namespace_list); ldlm_namespace_nr_inc(client); mutex_unlock(ldlm_namespace_lock(client)); } @@ -1011,8 +1011,7 @@ void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *ns, { LASSERT(!list_empty(&ns->ns_list_chain)); LASSERT(mutex_is_locked(ldlm_namespace_lock(client))); - list_move_tail(&ns->ns_list_chain, - ldlm_namespace_inactive_list(client)); + list_move_tail(&ns->ns_list_chain, &ldlm_cli_inactive_namespace_list); } /** Should be called with ldlm_namespace_lock(client) taken. */ -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/32] staging/lustre/ldlm: Remove posix lock (flock) deadlock detection
From: Oleg Drokin This is server-side code that cannot work on the client (vfs would do this check on the local node). Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 132 1 file changed, 132 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index 57b4edb..0c46a06 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -91,40 +91,6 @@ ldlm_flocks_overlap(struct ldlm_lock *lock, struct ldlm_lock *new) lock->l_policy_data.l_flock.start)); } -static inline void ldlm_flock_blocking_link(struct ldlm_lock *req, - struct ldlm_lock *lock) -{ - /* For server only */ - if (req->l_export == NULL) - return; - - LASSERT(hlist_unhashed(&req->l_exp_flock_hash)); - - req->l_policy_data.l_flock.blocking_owner = - lock->l_policy_data.l_flock.owner; - req->l_policy_data.l_flock.blocking_export = - lock->l_export; - req->l_policy_data.l_flock.blocking_refs = 0; - - cfs_hash_add(req->l_export->exp_flock_hash, -&req->l_policy_data.l_flock.owner, -&req->l_exp_flock_hash); -} - -static inline void ldlm_flock_blocking_unlink(struct ldlm_lock *req) -{ - /* For server only */ - if (req->l_export == NULL) - return; - - check_res_locked(req->l_resource); - if (req->l_export->exp_flock_hash != NULL && - !hlist_unhashed(&req->l_exp_flock_hash)) - cfs_hash_del(req->l_export->exp_flock_hash, -&req->l_policy_data.l_flock.owner, -&req->l_exp_flock_hash); -} - static inline void ldlm_flock_destroy(struct ldlm_lock *lock, ldlm_mode_t mode, __u64 flags) { @@ -149,79 +115,6 @@ ldlm_flock_destroy(struct ldlm_lock *lock, ldlm_mode_t mode, __u64 flags) } /** - * POSIX locks deadlock detection code. - * - * Given a new lock \a req and an existing lock \a bl_lock it conflicts - * with, we need to iterate through all blocked POSIX locks for this - * export and see if there is a deadlock condition arising. (i.e. when - * one client holds a lock on something and want a lock on something - * else and at the same time another client has the opposite situation). - */ -static int -ldlm_flock_deadlock(struct ldlm_lock *req, struct ldlm_lock *bl_lock) -{ - struct obd_export *req_exp = req->l_export; - struct obd_export *bl_exp = bl_lock->l_export; - __u64 req_owner = req->l_policy_data.l_flock.owner; - __u64 bl_owner = bl_lock->l_policy_data.l_flock.owner; - - /* For server only */ - if (req_exp == NULL) - return 0; - - class_export_get(bl_exp); - while (1) { - struct obd_export *bl_exp_new; - struct ldlm_lock *lock = NULL; - struct ldlm_flock *flock; - - if (bl_exp->exp_flock_hash != NULL) - lock = cfs_hash_lookup(bl_exp->exp_flock_hash, - &bl_owner); - if (lock == NULL) - break; - - LASSERT(req != lock); - flock = &lock->l_policy_data.l_flock; - LASSERT(flock->owner == bl_owner); - bl_owner = flock->blocking_owner; - bl_exp_new = class_export_get(flock->blocking_export); - class_export_put(bl_exp); - - cfs_hash_put(bl_exp->exp_flock_hash, &lock->l_exp_flock_hash); - bl_exp = bl_exp_new; - - if (bl_owner == req_owner && bl_exp == req_exp) { - class_export_put(bl_exp); - return 1; - } - } - class_export_put(bl_exp); - - return 0; -} - -static void ldlm_flock_cancel_on_deadlock(struct ldlm_lock *lock, - struct list_head *work_list) -{ - CDEBUG(D_INFO, "reprocess deadlock req=%p\n", lock); - - if ((exp_connect_flags(lock->l_export) & - OBD_CONNECT_FLOCK_DEAD) == 0) { - CERROR( - "deadlock found, but client doesn't support flock canceliation\n"); - } else { - LASSERT(lock->l_completion_ast); - LASSERT((lock->l_flags & LDLM_FL_AST_SENT) == 0); - lock->l_flags |= LDLM_FL_AST_SENT | LDLM_FL_CANCEL_ON_BLOCK | - LDLM_FL_FLOCK_DEADLOCK; - ldlm_flock_blocking_unlink(lock); - ldlm_resource_unlink_lock(lock); - ldlm_add_ast_work_item(lock, NULL, work_list); - } -} - -/** * Process a granting attempt for flock lock. * Must be called under ns lock held. * @@ -307,11 +200,6 @@ reprocess: if (!
[PATCH 26/32] staging/lustre: Remove ns_is_client()
From: Oleg Drokin Since staging tree code is just the client, ns_is_client is always true, so change all callers as such and drop all the dead code for when it's false. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 -- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 28 +++-- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 5 +--- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 9 +++ drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 29 -- 5 files changed, 17 insertions(+), 67 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 360c7f7..1e40203 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -465,19 +465,6 @@ struct ldlm_namespace { }; /** - * Returns 1 if namespace \a ns is a client namespace. - */ -static inline int ns_is_client(struct ldlm_namespace *ns) -{ - LASSERT(ns != NULL); - LASSERT(!(ns->ns_client & ~(LDLM_NAMESPACE_CLIENT | - LDLM_NAMESPACE_SERVER))); - LASSERT(ns->ns_client == LDLM_NAMESPACE_CLIENT || - ns->ns_client == LDLM_NAMESPACE_SERVER); - return ns->ns_client == LDLM_NAMESPACE_CLIENT; -} - -/** * Returns 1 if namespace \a ns is a server namespace. */ static inline int ns_is_server(struct ldlm_namespace *ns) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index 14e6782..7241c34 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -63,9 +63,6 @@ #include #include "ldlm_internal.h" -int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, - void *data, int flag); - /** * list_for_remaining_safe - iterate over the remaining entries in a list * and safeguard against removal of a list entry. @@ -254,7 +251,6 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, struct ldlm_lock *new = req; struct ldlm_lock *new2 = NULL; ldlm_mode_t mode = req->l_req_mode; - int local = ns_is_client(ns); int added = (mode == LCK_NL); int overlaps = 0; int splitted = 0; @@ -269,14 +265,9 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, *err = ELDLM_OK; - if (local) { - /* No blocking ASTs are sent to the clients for -* Posix file & record locks */ - req->l_blocking_ast = NULL; - } else { - /* Called on the server for lock cancels. */ - req->l_blocking_ast = ldlm_flock_blocking_ast; - } + /* No blocking ASTs are sent to the clients for +* Posix file & record locks */ + req->l_blocking_ast = NULL; reprocess: if ((*flags == LDLM_FL_WAIT_NOREPROC) || (mode == LCK_NL)) { @@ -708,19 +699,6 @@ granted: } EXPORT_SYMBOL(ldlm_flock_completion_ast); -int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, - void *data, int flag) -{ - LASSERT(lock); - LASSERT(flag == LDLM_CB_CANCELING); - - /* take lock off the deadlock detection hash list. */ - lock_res_and_lock(lock); - ldlm_flock_blocking_unlink(lock); - unlock_res_and_lock(lock); - return 0; -} - void ldlm_flock_policy_wire18_to_local(const ldlm_wire_policy_data_t *wpolicy, ldlm_policy_data_t *lpolicy) { diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index e586d33..6d5e7af 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -480,8 +480,6 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock, struct ldlm_resource *newres; int type; - LASSERT(ns_is_client(ns)); - lock_res_and_lock(lock); if (memcmp(new_resid, &lock->l_resource->lr_name, sizeof(lock->l_resource->lr_name)) == 0) { @@ -816,8 +814,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) if ((lock->l_flags & LDLM_FL_ATOMIC_CB) || ldlm_bl_to_thread_lock(ns, NULL, lock) != 0) ldlm_handle_bl_callback(ns, NULL, lock); - } else if (ns_is_client(ns) && - !lock->l_readers && !lock->l_writers && + } else if (!lock->l_readers && !lock->l_writers && !(lock->l_flags & LDLM_FL_NO_LRU) && !(lock->l_flags & LDLM_FL_BL_AST)) { diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index
[PATCH 29/32] staging/lustre/ldlm: Remove unused exported symbols.
From: Oleg Drokin This rather large patch prunes all unused EXPORT_SYMBOLS and marks functions only used locally as static lustre ldlm module. The only two remaining nonstatic functions that should be static now are: ldlm_cancel_lru_local ldlm_resource_putref_locked But some bigger code shuffling around is needed to achieve that, so it's left for a future patch. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 26 --- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 22 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 21 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 30 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 4 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 43 +--- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 28 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 82 +++--- 9 files changed, 111 insertions(+), 151 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 3cca07e..dfc49e1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -60,9 +60,6 @@ struct obd_ops; struct obd_device; -extern struct kset *ldlm_ns_kset; -extern struct kset *ldlm_svc_kset; - #define OBD_LDLM_DEVICENAME "ldlm" #define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus()) @@ -561,9 +558,6 @@ typedef union { struct ldlm_inodebits l_inodebits; } ldlm_policy_data_t; -void ldlm_convert_policy_to_wire(ldlm_type_t type, -const ldlm_policy_data_t *lpolicy, -ldlm_wire_policy_data_t *wpolicy); void ldlm_convert_policy_to_local(struct obd_export *exp, ldlm_type_t type, const ldlm_wire_policy_data_t *wpolicy, ldlm_policy_data_t *lpolicy); @@ -980,7 +974,6 @@ struct ldlm_enqueue_info { extern struct obd_ops ldlm_obd_ops; extern char *ldlm_lockname[]; -extern char *ldlm_typename[]; char *ldlm_it2str(int it); /** @@ -1051,10 +1044,6 @@ typedef int (*ldlm_res_iterator_t)(struct ldlm_resource *, void *); * LDLM provides for a way to iterate through every lock on a resource or * namespace or every resource in a namespace. * @{ */ -int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter, - void *closure); -void ldlm_namespace_foreach(struct ldlm_namespace *ns, ldlm_iterator_t iter, - void *closure); int ldlm_resource_iterate(struct ldlm_namespace *, const struct ldlm_res_id *, ldlm_iterator_t iter, void *data); /** @} ldlm_iterator */ @@ -1172,7 +1161,6 @@ do { \ struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock); void ldlm_lock_put(struct ldlm_lock *lock); -void ldlm_lock_destroy(struct ldlm_lock *lock); void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc); void ldlm_lock_addref(struct lustre_handle *lockh, __u32 mode); int ldlm_lock_addref_try(struct lustre_handle *lockh, __u32 mode); @@ -1197,8 +1185,6 @@ ldlm_namespace_new(struct obd_device *obd, char *name, ldlm_side_t client, ldlm_appetite_t apt, ldlm_ns_type_t ns_type); int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags); -void ldlm_namespace_register(struct ldlm_namespace *ns, ldlm_side_t client); -void ldlm_namespace_unregister(struct ldlm_namespace *ns, ldlm_side_t client); void ldlm_namespace_get(struct ldlm_namespace *ns); void ldlm_namespace_put(struct ldlm_namespace *ns); int ldlm_debugfs_setup(void); @@ -1209,7 +1195,6 @@ struct ldlm_resource *ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent, const struct ldlm_res_id *, ldlm_type_t type, int create); -struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res); int ldlm_resource_putref(struct ldlm_resource *res); void ldlm_resource_add_lock(struct ldlm_resource *res, struct list_head *head, @@ -1231,7 +1216,6 @@ int ldlm_lock_change_resource(struct ldlm_namespace *, struct ldlm_lock *, } while (0) /* ldlm_request.c */ -int ldlm_expired_completion_wait(void *data); /** \defgroup ldlm_local_ast Default AST handlers for local locks * These AST handlers are typically used for server-side local locks and are * also used by client-side lock handlers to perform minimum level base @@ -1275,8 +1259,6 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns, ldlm_mode_t mode, ldlm_cancel_flags_t flags,
[PATCH 28/32] staging/lustre/ldlm: Remove server side code from pool support.
From: Oleg Drokin Server-side scanning is not really used in the client code, so it's ok to drop it. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 - drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 348 + 2 files changed, 13 insertions(+), 338 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 49b5a07..3cca07e 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -213,7 +213,6 @@ struct ldlm_pool_ops { /** Cancel at least \a nr locks from pool \a pl */ int (*po_shrink)(struct ldlm_pool *pl, int nr, gfp_t gfp_mask); - int (*po_setup)(struct ldlm_pool *pl, int limit); }; /** One second for pools thread check interval. Each pool has own period. */ @@ -1347,7 +1346,6 @@ void unlock_res_and_lock(struct ldlm_lock *lock); * There are not used outside of ldlm. * @{ */ -int ldlm_pools_recalc(ldlm_side_t client); int ldlm_pools_init(void); void ldlm_pools_fini(void); @@ -1356,7 +1354,6 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, int ldlm_pool_shrink(struct ldlm_pool *pl, int nr, gfp_t gfp_mask); void ldlm_pool_fini(struct ldlm_pool *pl); -int ldlm_pool_setup(struct ldlm_pool *pl, int limit); int ldlm_pool_recalc(struct ldlm_pool *pl); __u32 ldlm_pool_get_lvf(struct ldlm_pool *pl); __u64 ldlm_pool_get_slv(struct ldlm_pool *pl); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index dac1b6f..78d1baf 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -214,70 +214,6 @@ static inline int ldlm_pool_t2gsp(unsigned int t) } /** - * Recalculates next grant limit on passed \a pl. - * - * \pre ->pl_lock is locked. - */ -static void ldlm_pool_recalc_grant_plan(struct ldlm_pool *pl) -{ - int granted, grant_step, limit; - - limit = ldlm_pool_get_limit(pl); - granted = atomic_read(&pl->pl_granted); - - grant_step = ldlm_pool_t2gsp(pl->pl_recalc_period); - grant_step = ((limit - granted) * grant_step) / 100; - pl->pl_grant_plan = granted + grant_step; - limit = (limit * 5) >> 2; - if (pl->pl_grant_plan > limit) - pl->pl_grant_plan = limit; -} - -/** - * Recalculates next SLV on passed \a pl. - * - * \pre ->pl_lock is locked. - */ -static void ldlm_pool_recalc_slv(struct ldlm_pool *pl) -{ - int granted; - int grant_plan; - int round_up; - __u64 slv; - __u64 slv_factor; - __u64 grant_usage; - __u32 limit; - - slv = pl->pl_server_lock_volume; - grant_plan = pl->pl_grant_plan; - limit = ldlm_pool_get_limit(pl); - granted = atomic_read(&pl->pl_granted); - round_up = granted < limit; - - grant_usage = max_t(int, limit - (granted - grant_plan), 1); - - /* -* Find out SLV change factor which is the ratio of grant usage -* from limit. SLV changes as fast as the ratio of grant plan -* consumption. The more locks from grant plan are not consumed -* by clients in last interval (idle time), the faster grows -* SLV. And the opposite, the more grant plan is over-consumed -* (load time) the faster drops SLV. -*/ - slv_factor = grant_usage << LDLM_POOL_SLV_SHIFT; - do_div(slv_factor, limit); - slv = slv * slv_factor; - slv = dru(slv, LDLM_POOL_SLV_SHIFT, round_up); - - if (slv > ldlm_pool_slv_max(limit)) - slv = ldlm_pool_slv_max(limit); - else if (slv < ldlm_pool_slv_min(limit)) - slv = ldlm_pool_slv_min(limit); - - pl->pl_server_lock_volume = slv; -} - -/** * Recalculates next stats on passed \a pl. * * \pre ->pl_lock is locked. @@ -303,147 +239,6 @@ static void ldlm_pool_recalc_stats(struct ldlm_pool *pl) } /** - * Sets current SLV into obd accessible via ldlm_pl2ns(pl)->ns_obd. - */ -static void ldlm_srv_pool_push_slv(struct ldlm_pool *pl) -{ - struct obd_device *obd; - - /* -* Set new SLV in obd field for using it later without accessing the -* pool. This is required to avoid race between sending reply to client -* with new SLV and cleanup server stack in which we can't guarantee -* that namespace is still alive. We know only that obd is alive as -* long as valid export is alive. -*/ - obd = ldlm_pl2ns(pl)->ns_obd; - LASSERT(obd != NULL); - write_lock(&obd->obd_pool_lock); - obd->obd_pool_slv = pl->pl_server_lock_volume; - write_unlock(&obd->obd_pool_lock); -} - -/** - * Recalculates all pool fields on passed \a pl. - * - * \pre ->pl_lock is not locked. - */ -static int ldlm_srv_pool_recalc(struct ldlm_pool *pl) -
RE: [PATCH 1/1] staging: ion: Fix error handling in ion_buffer_create
> -Original Message- > From: Laura Abbott [mailto:labb...@redhat.com] > Sent: Wednesday, September 30, 2015 11:42 PM > To: Rohit kumar; gre...@linuxfoundation.org; a...@android.com; > riandr...@android.com; dan.carpen...@oracle.com; > sumit.sem...@linaro.org; mitch...@codeaurora.org; akpm@linux- > foundation.org; li...@rasmusvillemoes.dk; dmitry.kalin...@gmail.com; > elfr...@users.sourceforge.net; gioh@lge.com; de...@driverdev.osuosl.org; > linux-ker...@vger.kernel.org > Cc: pint...@samsung.com; me.ro...@live.com; pintu_agar...@yahoo.com; > c.rajku...@samsung.com; sreena...@samsung.com; c...@samsung.com; > vishnu...@samsung.com > Subject: Re: [PATCH 1/1] staging: ion: Fix error handling in ion_buffer_create > > On 09/29/2015 10:37 PM, Rohit kumar wrote: > > This patch fixes error handling case when buffer->pages allocation > > fails. Also, it removes unreachable code of checking ret variable > > although it is not updated. > > > > Reviewed-by: Laura Abbott > > > Signed-off-by: Rohit kumar > > --- > > drivers/staging/android/ion/ion.c | 14 +- > > 1 file changed, 5 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/staging/android/ion/ion.c > > b/drivers/staging/android/ion/ion.c > > index 217aa53..af59e4a 100644 > > --- a/drivers/staging/android/ion/ion.c > > +++ b/drivers/staging/android/ion/ion.c > > @@ -213,10 +213,10 @@ static struct ion_buffer *ion_buffer_create(struct > ion_heap *heap, > > "heap->ops->map_dma should return ERR_PTR on > error")) > > table = ERR_PTR(-EINVAL); > > if (IS_ERR(table)) { > > - heap->ops->free(buffer); > > - kfree(buffer); > > - return ERR_CAST(table); > > + ret = -EINVAL; > > + goto err1; > > } > > + > > buffer->sg_table = table; > > if (ion_buffer_fault_user_mappings(buffer)) { > > int num_pages = PAGE_ALIGN(buffer->size) / PAGE_SIZE; @@ - > 226,7 > > +226,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, > > buffer->pages = vmalloc(sizeof(struct page *) * num_pages); > > if (!buffer->pages) { > > ret = -ENOMEM; > > - goto err1; > > + goto err; > > } > > > > for_each_sg(table->sgl, sg, table->nents, i) { @@ -235,9 +235,6 > @@ > > static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, > > for (j = 0; j < sg->length / PAGE_SIZE; j++) > > buffer->pages[k++] = page++; > > } > > - > > - if (ret) > > - goto err; > > } > > > > buffer->dev = dev; > > @@ -261,9 +258,8 @@ static struct ion_buffer *ion_buffer_create(struct > > ion_heap *heap, > > > > err: > > heap->ops->unmap_dma(heap, buffer); > > - heap->ops->free(buffer); > > err1: > > - vfree(buffer->pages); > > + heap->ops->free(buffer); > > err2: > > kfree(buffer); > > return ERR_PTR(ret); > > Suggested-by: Pintu Kumar Reviewed-by: Pintu Kumar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: ion: Fix error handling in ion_buffer_create
2015-10-01 오후 2:31에 PINTU KUMAR 이(가) 쓴 글: -Original Message- From: Laura Abbott [mailto:labb...@redhat.com] Sent: Wednesday, September 30, 2015 11:42 PM To: Rohit kumar; gre...@linuxfoundation.org; a...@android.com; riandr...@android.com; dan.carpen...@oracle.com; sumit.sem...@linaro.org; mitch...@codeaurora.org; akpm@linux- foundation.org; li...@rasmusvillemoes.dk; dmitry.kalin...@gmail.com; elfr...@users.sourceforge.net; gioh@lge.com; de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org Cc: pint...@samsung.com; me.ro...@live.com; pintu_agar...@yahoo.com; c.rajku...@samsung.com; sreena...@samsung.com; c...@samsung.com; vishnu...@samsung.com Subject: Re: [PATCH 1/1] staging: ion: Fix error handling in ion_buffer_create On 09/29/2015 10:37 PM, Rohit kumar wrote: This patch fixes error handling case when buffer->pages allocation fails. Also, it removes unreachable code of checking ret variable although it is not updated. Reviewed-by: Laura Abbott Signed-off-by: Rohit kumar --- drivers/staging/android/ion/ion.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 217aa53..af59e4a 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -213,10 +213,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, "heap->ops->map_dma should return ERR_PTR on error")) table = ERR_PTR(-EINVAL); if (IS_ERR(table)) { - heap->ops->free(buffer); - kfree(buffer); - return ERR_CAST(table); + ret = -EINVAL; + goto err1; } + buffer->sg_table = table; if (ion_buffer_fault_user_mappings(buffer)) { int num_pages = PAGE_ALIGN(buffer->size) / PAGE_SIZE; @@ - 226,7 +226,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, buffer->pages = vmalloc(sizeof(struct page *) * num_pages); if (!buffer->pages) { ret = -ENOMEM; - goto err1; + goto err; } for_each_sg(table->sgl, sg, table->nents, i) { @@ -235,9 +235,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, for (j = 0; j < sg->length / PAGE_SIZE; j++) buffer->pages[k++] = page++; } - - if (ret) - goto err; } buffer->dev = dev; @@ -261,9 +258,8 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, err: heap->ops->unmap_dma(heap, buffer); - heap->ops->free(buffer); err1: - vfree(buffer->pages); + heap->ops->free(buffer); err2: kfree(buffer); return ERR_PTR(ret); Suggested-by: Pintu Kumar Reviewed-by: Pintu Kumar It's nice! Reviewed-by: Gioh Kim ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel