aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-05staging: lustre: delete the filesystem from the tree.Greg Kroah-Hartman64-49656/+0
The Lustre filesystem has been in the kernel tree for over 5 years now. While it has been an endless source of enjoyment for new kernel developers learning how to do basic codingstyle cleanups, as well as an semi-entertaining source of bewilderment from the vfs developers any time they have looked into the codebase to try to figure out how to port their latest api changes to this filesystem, it has not really moved forward into the "this is in shape to get out of staging" despite many half-completed attempts. And getting code out of staging is the main goal of that portion of the kernel tree. Code should not stagnate and it feels like having this code in staging is only causing the development cycle of the filesystem to take longer than it should. There is a whole separate out-of-tree copy of this codebase where the developers work on it, and then random changes are thrown over the wall at staging at some later point in time. This dual-tree development model has never worked, and the state of this codebase is proof of that. So, let's just delete the whole mess. Now the lustre developers can go off and work in their out-of-tree codebase and not have to worry about providing valid changelog entries and breaking their patches up into logical pieces. They can take the time they have spend doing those types of housekeeping chores and get the codebase into a much better shape, and it can be submitted for inclusion into the real part of the kernel tree when ready. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: include linux/highmem.h when neededArnd Bergmann1-0/+1
Something in recent linux-next kernels caused linux/highmem.h to no longer be included implicitly from o2iblnd_cb.c, causing a build failure: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c: In function 'kiblnd_kvaddr_to_page': drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: error: 'PKMAP_BASE' undeclared (first use in this function); did you mean 'RTM_BASE'? if (vaddr >= PKMAP_BASE && ^~~~~~~~~~ RTM_BASE drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: note: each undeclared identifier is reported only once for each function it appears in drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:550:28: error: 'LAST_PKMAP' undeclared (first use in this function); did you mean 'AT_HWCAP'? vaddr < (PKMAP_BASE + LAST_PKMAP * PAGE_SIZE)) { ^~~~~~~~~~ AT_HWCAP This adds back an explicit include for the header. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.hNeilBrown12-20/+50
In the remaining files that include libcfs_all.h, replace it with other include files as necessary, then remove libcfs_all.h Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move all libcfs_all includes except in lustre/lnet/libcfs/NeilBrown6-6/+4
Again, most of these are not needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h from includes lustre/lnetNeilBrown4-4/+7
Some of these include files didn't need to include libcfs_all.h. A couple did so replace with just the base include files needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h includes from lnet/klndNeilBrown3-2/+1
Other smaller include files are sufficient. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: don't include libcfs.h in lnet/lib-lnet.hNeilBrown1-0/+1
We want to be more focused in what is included where. So we remove libcfs.h from where it isn't needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: start moving includes out of libcfs.hNeilBrown24-25/+25
Lots of places include libcfs.h, and it includes lots of other include files. Many of these aren't needed in many places. It is tidier and better documentation to just include what is needed. So remove all the includes from libcfs.h and create libcfs_all.h which contains them. Then change every reference to libcfs.h to instead include libcfs_all.h Next several patches will remove that from various files in small batches Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: replace memory_presure funcitons by standard interfaces.NeilBrown3-8/+10
Use memalloc_noreclaim_save() and memalloc_noreclaim_restore(), and for testing, just directly test the flag in current->flags Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move lnet_debug_log_upcall declaration to tracefile.hNeilBrown1-0/+5
Both files that use this variable include tracefile.h, and it seems a more suitable home for the declaration. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: make lnet_debugfs_symlink_def local to libcfs/modules.cNeilBrown2-7/+18
This type is only used in libcfs/module.c, so make it local to there. If any other module ever wanted to add its own symlinks, it would probably be easiest to export lnet_debugfs_root and just call debugfs_create_symlink as required. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: replace libcfs_register_ioctl with a blocking notifier_chainNeilBrown5-79/+63
libcfs allows other modules to register handlers for ioctls. The implementation it uses for this is nearly identical to a blocking notifier chain, so change to use that. The biggest difference is that the return value from notifier has a defined format, where libcfs_register_ioctl uses -EINVAL to mean "continue". This requires a little bit of conversion. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard CFS_TICKNeilBrown1-1/+1
This undocumented macro seems to represent "a small amount of time". Sometimes it is used as-is, some times it is multiplied by 5 for no obvious reason. It does not appear that there is any connection between the different places it is used - they all just want a short period for different purposes and of different durarions. So discard CFS_TICK and lets each use-site just use whatever number of jiffies seems appropriate in that case. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard LOWEST_BIT_SET()NeilBrown1-1/+1
This macro is only used once to test if a value is a power of two. So use is_power_of_2() instead and discard the macro. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove current_pid() and current_comm()NeilBrown1-1/+1
Just use current->pid and current->comm directly, instead of having wrappers. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove conditional compilation from libcfs_cpu.cNeilBrown3-65/+1
libcfs_cpu.c manages CPU partitions. In the !CONFIG_SMP case, most of this disappears and 'static inline's from libcfs_cpu.h are used. However we still allocate a 'struct cfs_cpt_table' and keep some dummy data in it. This is a bit pointless. This patch removes all the !CONFIG_SMP code from libcfs_cpu.c and conditionally compiles the whole file only when CONFIG_SMP. We no longer allocate a 'struct cfs_cpt_table' on !CONFIG_SMP, and don't even declare a structure. The name "cfs_cpt_tab" becomes always "NULL", which allows some code to be optimized away. This means that cfs_cpt_tab can sometimes be NULL, so we need to discard the assertion that it isn't. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: rename cfs_cpt_table to cfs_cpt_tabNeilBrown4-22/+22
The variable "cfs_cpt_table" has the same name as the structure "struct cfs_cpt_table". This makes it hard to use #define to make one disappear on a uni-processor build, but keep the other. So rename the variable to cfs_cpt_tab. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move files out of lustre/lnet/libcfs/linux/NeilBrown6-11/+10
There is no longer any value in having this separate subdirectory, so promote the files in it. Also tidy the Makefile a little to use the common "*-obj-y" macro name. This will allow individual files to be conditionally compiled. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: refactor libcfs initialization.NeilBrown6-23/+65
Many lustre modules depend on libcfs having initialized properly, but do not explicit check that it did. When lustre is built as discrete modules, this does not cause a problem because if the libcfs module fails initialization, the other modules don't even get loaded. When lustre is compiled into the kernel, all module_init() routines get run, so they need to check the required initialization succeeded. This patch splits out the initialization of libcfs into a new libcfs_setup(), and has all modules call that. The misc_register() call is kept separate as it does not allocate any resources and if it fails, it fails hard - no point in retrying. Other set-up allocates resources and so is best delayed until they are needed, and can be worth retrying. Ideally, the initialization would happen at mount time (or similar) rather than at load time. Doing this requires each module to check dependencies when they are activated rather than when they are loaded. Achieving that is a much larger job that would have to progress in stages. For now, this change ensures that if some initialization in libcfs fails, other modules will fail-safe. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: lustre: o2iblnd: Fix crash in kiblnd_handle_early_rxs()Doug Oucharek1-2/+3
Under upstream staging commit 5a2ca43fa54f561c252c2, the list handling code in kiblnd_handle_early_rxs() got changed to list_for_each_safe(). That protects against the current thread from deleting the current entry it is looking at. It does not protect against another thread from deleting the next item in the list (which the tmp variable points to). The way this routine holds then releases a lock opens the door to other threads doing just that. This patch reverts this commit on this routine. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9886 Fixes: 5a2ca43fa54f ("Staging: lustre: Iterate list using list_for_each_entry") Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: lustre: lnet: add static to libcfs_dev declarationJustin Skists1-1/+1
Add a static prefix to the declaration for libcfs_dev. This would fix the following sparse warning: drivers/staging/lustre/lnet/libcfs/module.c:317:19: warning: symbol 'libcfs_dev' was not declared. Should it be static? Signed-off-by: Justin Skists <justin.skists@juzza.co.uk> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: lustre: o2iblnd: Enable Multiple OPA Endpoints between NodesDoug Oucharek3-11/+40
OPA driver optimizations are based on the MPI model where it is expected to have multiple endpoints between two given nodes. To enable this optimization for Lustre, we need to make it possible, via an LND-specific tuneable, to create multiple endpoints and to balance the traffic over them. Both sides of a connection must have this patch for it to work. Only the active side of the connection (usually the client) needs to have the new tuneable set > 1. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8943 Reviewed-on: https://review.whamcloud.com/25168 Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: lustre: move remaining code from linux-module.c to module.cNeilBrown3-169/+131
There is no longer any need to keep this code separate, and now we can remove linux-module.c Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: lustre: move misc-device registration closer to related code.NeilBrown2-29/+29
The ioctl handler for the misc device is in lnet/libcfs/module.c but is it registered in lnet/libcfs/linux/linux-module.c. Keeping related code together make maintenance easier, so move the code. Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: lustre: o2iblnd: fix race at kiblnd_connect_peerDoug Oucahrek1-6/+12
cmid will be destroyed at OFED if kiblnd_cm_callback return error. if error happen before the end of kiblnd_connect_peer, it will touch destroyed cmid and fail as (o2iblnd_cb.c:1315:kiblnd_connect_peer()) ASSERTION( cmid->device != ((void *)0) ) failed: Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10015 Reviewed-by: Alexey Lyashkov <c17817@cray.com> Reviewed-by: Doug Oucharek <dougso@me.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: lustre: o2iblnd: Fix FastReg map/unmap for MLX5Doug Oucharek2-9/+5
The FastReg support in ko2iblnd was not unmapping pool items causing the items to leak. In addition, the mapping code is not growing the pool like we do with FMR. This patch makes sure we are unmapping FastReg pool elements when we are done with them. It also makes sure the pool will grow when we depleat the pool. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9472 Reviewed-on: https://review.whamcloud.com/27015 Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: rearrange placement of CPU partition management code.NeilBrown3-1101/+938
Currently the code for cpu-partition tables lives in various places. The non-SMP code is partly in libcfs/libcfs_cpu.h as static inlines, and partly in lnet/libcfs/libcfs_cpu.c - some of the functions are tiny and could well be inlines. The SMP code is all in lnet/libcfs/linux/linux-cpu.c. This patch moves all the trivial non-SMP functions into libcfs_cpu.h as inlines, and all the SMP functions into libcfs_cpu.c with the non-trival !SMP code. Now when you go looking for some function, it is easier to find both versions together when neither is trivial. There is no code change here - just code movement. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: remove include/linux/libcfs/linux/linux-cpu.hNeilBrown1-2/+2
This include file contains definitions used when CONFIG_SMP is in effect. Other includes contain corresponding definitions for when it isn't. This can be hard to follow, so move the definitions to the one place. As HAVE_LIBCFS_CPT is defined precisely when CONFIG_SMP, we discard that macro and just use CONFIG_SMP when needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: libcfs: use dynamic minors for /dev/{lnet, obd}John L. Hammond3-4/+3
Request dynamic minor allocation when registering /dev/lnet and /dev/obd. Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-100086 Reviewed-on: https://review.whamcloud.com/29741 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Jian Yu <jian.yu@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: remove cruft from libcfs/linux/libcfs.hNeilBrown1-1/+1
These defines are unused or nearly unused, and do not help at all. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: discard cfs_duration_sec()NeilBrown7-13/+12
cfs_duration_sec() simply divides by HZ. It is mostly used to report durations in debug messages. Remove and just use X/HZ. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: libcfs: discard cfs_time_after()NeilBrown10-38/+38
cfs_time_after() behaves exactly like time_after() similarly cfs_time_aftereq() matches time_after_eq() so discard the cfs versions. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: libcfs: discard cfs_time_shift().NeilBrown6-30/+30
This function simply multiplies by HZ and adds jiffies. This is simple enough to be opencoded, and doing so makes the code easier to read. Same for cfs_time_shift_64() Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: libcfs: discard cfs_time_add/subNeilBrown7-30/+19
cfs_time_add adds its arguments. cfs_time_sub subtracts finds the difference. Discard these and use '+' and '-' directly. This change highlighted a type error. The structure field cr_queued_time was used to store jiffies, but was declared as time_t (meant for seconds). So the time is changed to "unsigned long". Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: cfs_time_current() -> jiffies.NeilBrown13-58/+57
Discard cfs_time_current() and cfs_time_current64() and use jiffies and get_jiffies_64() like the rest of the kernel. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-04Merge tag 'staging-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds30-401/+92
Pull staging/IIO updates from Greg KH: "Here is the big set of Staging/IIO driver patches for 4.17-rc1. It is a lot, over 500 changes, but not huge by previous kernel release standards. We deleted more lines than we added again (27k added vs. 91k remvoed), thanks to finally being able to delete the IRDA drivers and networking code. We also deleted the ccree crypto driver, but that's coming back in through the crypto tree to you, in a much cleaned-up form. Added this round is at lot of "mt7621" device support, which is for an embedded device that Neil Brown cares about, and of course a handful of new IIO drivers as well. And finally, the fsl-mc core code moved out of the staging tree to the "real" part of the kernel, which is nice to see happen as well. Full details are in the shortlog, which has all of the tiny cleanup patches described. All of these have been in linux-next for a while with no reported issues" * tag 'staging-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (579 commits) staging: rtl8723bs: Remove yield call, replace with cond_resched() staging: rtl8723bs: Replace yield() call with cond_resched() staging: rtl8723bs: Remove unecessary newlines from 'odm.h'. staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' coding style. staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style. staging: rtl8723bs: Replace NULL pointer comparison with '!'. staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections. staging: rtl8723bs: Fix function signature that goes over 80 characters. staging: rtl8723bs: Fix lines too long in update_recvframe_attrib(). staging: rtl8723bs: Remove unnecessary blank lines in 'rtl8723bs_recv.c'. staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c'. staging: rtl8723bs: Add missing braces in else statement. staging: rtl8723bs: Add spaces around ternary operators. staging: rtl8723bs: Fix lines with trailing open parentheses. staging: rtl8723bs: Remove unnecessary length #define's. staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants. staging: rtl8723bs: Fix alignment in rtw_wx_set_auth(). staging: rtl8723bs: Remove braces from single statement conditionals. staging: rtl8723bs: Remove unecessary braces from switch statement. staging: rtl8723bs: Fix newlines in rtw_wx_set_auth(). ...
2018-03-22staging: lustre: lnet: use correct 'magic' testJustin Skists1-1/+1
Use the lnet_magic_accept() function to compare 'magic' against LNET_PROTO_TCP_MAGIC for the appropriate string for an error message. The original fix removed an unneeded byte-ordering cast because the define was already CPU byte-ordered and it was assumed that 'magic' was CPU byte-ordered, too. Now modify the if-statement to use the appropriate lnet_accept_magic() function in order to be consistent with similar tests. This will allow the code to be consistent with the general understanding that 'magic' should be in host-byte-order for the peer that sent the message. Fixes: 80782927e3aa ("staging: lustre: Fix unneeded byte-ordering cast") Signed-off-by: Justin Skists <j.skists@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: lustre: Fix unneeded byte-ordering castJustin Skists1-1/+1
Fix sparse warning: CHECK drivers/staging//lustre/lnet/lnet/acceptor.c drivers/staging//lustre/lnet/lnet/acceptor.c:243:30: warning: cast to restricted __le32 LNET_PROTO_TCP_MAGIC, as a define, is already CPU byte-ordered when compared to 'magic', so no need for a cast. Signed-off-by: Justin Skists <j.skists@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: lustre: allow monolithic buildsNeilBrown1-1/+1
Remove restriction the lustre must be built as modules. It now works as a monolithic build. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: lustre: get entropy from nid when nid set.NeilBrown1-0/+7
When the 'lustre' module is loaded, it gets a list of net devices and uses the node ids to add entropy to the prng. This means that the network interfaces need to be configured before the module is loaded, which prevents the module from being compiled into a monolithic kernel. So move this entropy addition to the moment when the interface is imported to LNet and the node id is first known. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: lustre: lnet: keep ln_nportals consistentNeilBrown1-2/+3
ln_nportals should be zero when no portals have been allocated. This ensures that memory allocation failure is handled correctly elsewhere. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: lustre: Replace "be be" with "be"Arushi Singhal1-1/+1
This patch replace "be be" with "be". Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-27staging: lustre: lnet/selftest: don't ignore status from lstcon_test_addNeilBrown1-1/+1
If lstcon_test_add sets 'ret' (passed by reference) to 1, then lst_test_add_ioctl() ignores the return value. This isn't justified - the return value must be zero for 'ret' to be meaningful. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: selftest: freeing an error pointerDan Carpenter1-4/+2
We should just return directly if memdup_user() fails. The current code tries to free "param" which is an error pointer so it will Oops. Fixes: 2baddf262e98 ("staging: lustre: use memdup_user to allocate memory and copy from user") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: socklnd: simplify ksnc_rx_iov_spaceNeilBrown2-12/+3
ksnc_rx_iov_space is currently a union of two arrays, one of 'struct kvec', the other of 'struct bio_vec'. The 'struct bio_vec' option is never used. The array of kvec is used to read in a packet header, or to read data that needs to be skipped so as to synchronize with a packet boundary. In each case the target memory location is a virtual address, never a page, so 'struct bio_vec' is never needed. When we read into a page, different code steps up a separate array of 'struct bio_vec'. So remove the bio_vec option, and remove the union ksock_rxiovspace.. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: fix assorted checkpatch errorsNeilBrown2-2/+2
Possibly the most interesting is the for-loop with no body. Rearranging and initializing end_dirent on each iteration of the outer while, makes the intent clearer. Reviewed-by: "Eremin, Dmitry" <dmitry.eremin@intel.com> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: remove phantom struct cfs_crypto_hash_descNeilBrown1-16/+13
There is no "struct cfs_crypto_hash_desc" structure. There are only pointers to this structure, which are cast back and forth to struct ahash_request. So discard cfs_crypto_hash_desc, and just use ahash_request directly. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: discard libcfs_kvzalloc and linux-mem.cNeilBrown2-45/+0
The only interesting difference between libcfs_kvzalloc() and kvzalloc() is that the former appears to work with GFP_NOFS, which the latter gives a WARN_ON_ONCE() when that is attempted. Each libcfs_kvzalloc() should really be analysed and either converted to a kzalloc() call if the size is never more than a page, or to use GFP_KERNEL if no locks are held. If there is ever a case where locks are held and a large allocation is needed, then some other technique should be used. It might be nice to not always blindly zero pages too... For now, just convert libcfs_kvzalloc() calls to kvzalloc(), and let the warning remind us that there is work to do. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: discard libcfs_kvzalloc_cpt()NeilBrown1-7/+0
This function is used precisely once, and is sufficiently trivial that it may as well be open-coded. Doing so helpfully highlights the similarity between the new kvzalloc_node() call and the already existing kzalloc_node() call in the same function. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: make signal-blocking functions inlineNeilBrown2-63/+1
cfs_block_sigsinv() and cfs_restore_sigs() are now simple enough to inline them. This means we can discard linux-prim.c Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>