aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-05staging: lustre: delete the filesystem from the tree.Greg Kroah-Hartman1-514/+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-06-01staging: lustre: no need to check debugfs return valuesGreg Kroah-Hartman1-17/+2
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Clean up the lustre core code by not caring about the value of debugfs calls. This ends up removing a number of lines of code that are not needed. Note, more work is needed to remove the unneeded debugfs wrapper functions in the future. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Ben Evans <bevans@cray.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: "John L. Hammond" <john.hammond@intel.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h from fid, fld, obdclassNeilBrown1-1/+0
None of these files seem to nee libcfs_all.h 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.hNeilBrown1-1/+1
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-04-23staging: lustre: libcfs: use dynamic minors for /dev/{lnet, obd}John L. Hammond1-2/+1
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-02-22staging: lustre: discard libcfs_kvzalloc and linux-mem.cNeilBrown1-1/+1
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: improve some libcfs_kvzalloc calls.NeilBrown1-1/+1
Using vmalloc with GFP_NOFS is not supported as vmalloc performs some internal allocations with GFP_KERNEL. So in cases where the size passed to libcfs_kvzalloc() is clearly at most 1 page, convert to kzalloc(). In cases where the call clearly doesn't hold any filesystem locks, convert to GFP_KERNEL. Unfortunately there are many more that are not easy to fix. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: replace all CFS_CAP_* macros with CAP_*NeilBrown1-1/+1
Lustre defines a few CFS_CAP_* macros which are exactly the same as the corresponding CAP_* macro, with one exception. CFS_CAP_SYS_BOOT is 23 CAP_SYS_BOOT is 22. CFS_CAP_SYS_BOOT is only used through CFS_CAP_FS_MASK and causes capability 23 (CAP_SYS_NICE) to be dropped in certain circumstances. It is probable that the intention was to drop CAP_SYS_BOOT, and this is what is now done. CFS_CAP_CHOWN_MASK and CFS_CAP_SYS_RESOURCE_MASK are never used, so they have been removed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: lustre: obdclass: Remove a attribute group from a kobjectArvind Yadav1-0/+3
All attribute group created during class_procfs_init() should be removed. if class_procfs_init() will fail and also in class_procfs_clean(). Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11staging: lustre: add SPDX identifiers to all lustre filesGreg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/lustre files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: obdclass: add include path to MakefileJames Simmons1-7/+7
Rationalize include paths in the obdclass source code files. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTLJames Simmons1-0/+2
Now that lustre_ioctl.h is a UAPI header the kernel configuration option CONFIG_LUSTRE_OBD_MAX_IOCTL needs to be remove. The user land utilites will no longer be able to see this option and actually they never used this option before. Since this is the case setting the kernel configuration to something other than 8K could actually break things. The best option is just hard code it to 8K. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25246 Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: uapi: migrate remaining uapi headers to uapi directoryJames Simmons1-1/+1
Move all the remaining lustre headers shared between user land and kernel space to the uapi directory. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25246 Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: lnet: migrate headers to lnet uapi directoryJames Simmons1-1/+1
Migrate the headers used by user land and kernel space to the libcfs/lnet uapi directory. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Olaf Weber <olaf.weber@hpe.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: uapi: move lustre_ioctl.h to uapi directoryJames Simmons1-1/+1
Move the header lustre_ioctl.h to proper uapi directory. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.cJames Simmons1-0/+76
The inline function obd_ioctl_is_invalid() is no longer needed by userland and also the function was pretty bug for a inline function. Since this is the case we can move this kernel only code to the linux-module.c which is the only place it is used. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22staging: lustre: uapi: remove obd_ioctl_popdata() wrapperJames Simmons1-8/+0
Replace obd_ioctl_popdata() with direct copy_to_user() call. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30staging: lustre: obdclass: linux: constify attribute_group structures.Arvind Yadav1-1/+1
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10staging: lustre: obd: rename health sysfs file to health_checkJames Simmons1-4/+4
Testing revealed that the sysfs file health is actually the wrong name. Rename to the proper name health_check. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19staging: lustre: obdclass: remove unnecessary EXPORT_SYMBOLfrank zago1-1/+0
A lot of symbols don't need to be exported at all because they are only used in the module they belong to. Signed-off-by: frank zago <fzago@cray.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829 Reviewed-on: http://review.whamcloud.com/13323 Reviewed-by: Jian Yu <jian.yu@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19staging: lustre: Flexible changelog format.Henri Doreau1-1/+1
Added jobid fields to Changelog records (and extended records). The CLF_JOBID flags allows to check if the field is present or not (old format) when reading an entry. Jobids are expressed as 32 chars long, zero-terminated strings. Updated test_205 in sanity.sh. Signed-off-by: Henri Doreau <henri.doreau@cea.fr> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1996 Reviewed-on: http://review.whamcloud.com/4060 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: lustre: obdclass: constify obd_psdev_fops structureJulia Lawall1-1/+1
obd_psdev_fops, of type struct file_operations, is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: lustre: move ioctls to lustre_ioctl.hJohn L. Hammond1-0/+1
Move ioctl definitions and related functions from lustre_dlm.h, lustre_lib.h, obd.h, to lustre_ioctl.h. Replace the definitions of retired ioctls with comment. Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4961 Reviewed-on: http://review.whamcloud.com/10139 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Robert Read <robert.read@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging/lustre: Replace sun.com GPLv2 URL with gnu.org one.Oleg Drokin1-1/+1
http://www.sun.com/software/products/lustre/docs/GPLv2.pdf is no longer around, so replae it with (hopefully more permanent) http://http://www.gnu.org/licenses/gpl-2.0.html Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging/lustre: Remove the "Please contact SUN for GPL" from headersOleg Drokin1-4/+0
Since SUN is no longer around and there's no point in contacting them, just remove that whole thing. Copy of GPL is available online anyway (URLs to be updated in next patch). This patch was generated with: find drivers/staging/lustre -name "*.[ch]" -exec perl -0777 -i -pe 's/ \* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,\n \* CA 95054 USA or visit www.sun.com if you need additional information or\n \* have any questions.\n \*\n//igs' {} \; Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: lustre: simple cleanup in obd_ioctl_popdataLiang Zhen1-3/+1
Code simplification for obd_ioctl_popdata. Signed-off-by: Liang Zhen <liang.zhen@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435 Reviewed-on: http://review.whamcloud.com/11313 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Johann Lombardi <johann.lombardi@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25staging/lustre/obdclass: Adjust comments to better conform to coding styleOleg Drokin1-1/+2
This patch fixes "Block comments use a trailing */ on a separate line" warnings from checkpatch Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25staging/lustre: Remove lustre_build_version.hOleg Drokin1-1/+0
of the two macroses is contained the LUSTRE_RELEASE was unused and BUILD_VERSION is too generically named and was replaced with LUSTRE_VERSION_STRING with all the users (provided by lustre_ver.h) With in-kernel client the build version should be combined with kernel build information anyway. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22staging: lustre: obdclass: Remove header fileAmitoj Kaur Chawla1-1/+0
Remove duplicate include file. Found using includecheck. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging/lustre/obdclass: Adjust NULL comparison codestyleOleg Drokin1-3/+2
All instances of "x == NULL" are changed to "!x" and "x != NULL" to "x" Also remove some redundant assertions. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03Staging:lustre:obdclass:linux:simplify NULL comparisonBhumika Goyal1-3/+3
Remove explicit NULL comparision and replace it with a simpier form. Detected using checkpatch.pl. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03Staging:lustre:obdclass:linux:remove unnecessary bracesBhumika Goyal1-4/+2
Fixed 'braces {} are not necessary for single statement blocks' checkpatch.pl warning. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03staging/lustre: Mark obd_ioctl_popdata/getdata argument as __userOleg Drokin1-4/+4
arg is a userspace pointer and marking it as such makes sparse happy. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: lustre: remove multiple blank linesMike Rapoport1-1/+0
Fixes checkpatch.pl CHECK:LINE_SPACING: Please don't use multiple blank lines. The patch is generated using checkpatch.pl --fix-inplace: for f in $(find drivers/staging/lustre/ -type f) ; do ./scripts/checkpatch.pl --types "LINE_SPACING" --test-only=multiple \ --fix-inplace -f $f done Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: lustre/obdclass/linux/linux-module.cMatthew Needes1-2/+0
Fixed sparse warning by removing unused variable "proc_version". Signed-off-by: Matthew Needes <mneedes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-22staging: lustre: obdclass: Make structure declerations static constCihangir Akturk1-2/+2
obd_device_list_sops and obd_device_list_fops are not referenced outside of linux-module.c, and in the general use case struct file_operations and struct seq_operations should be a const object, so make them static and const. This patch fixes the following sparse warnings: WARNING: struct seq_operations should normally be const WARNING: struct file_operations should normally be const Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-13staging/lustre/obdclass: fix class_procfs_init error return valueOleg Drokin1-1/+1
Dan Carpenter noticed that procfs conversion patches introduced a bug where should kobject_create_and_add, an error is not returned from class_procfs_init. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-11lustre: obdclass: linux: Replace uses of OBD_{ALLOC, FREE}_LARGEJulia Lawall1-2/+2
Replace uses of OBD_ALLOC_LARGE by libcfs_kvzalloc and OBD_FREE_LARGE by kvfree. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression ptr,size; @@ - OBD_ALLOC_LARGE(ptr,size) + ptr = libcfs_kvzalloc(size, GFP_NOFS) @@ expression ptr,size; @@ - OBD_FREE_LARGE(ptr, size); + kvfree(ptr); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre/obd: final removal of procfs stuffDmitry Eremin1-1/+0
Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre/obd: remove unused proc_lustre_rootDmitry Eremin1-18/+0
Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre: move /proc/fs/lustre/devices to debugfsOleg Drokin1-6/+1
the devices file prints out status information about all obd devices in the system in human readable form. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre: Add debugfs rootOleg Drokin1-3/+29
This is just plumbing for migrating remaining procfs to debugfs support Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre: Move /proc/fs/lustre root level files to sysfsOleg Drokin1-46/+65
except devices, for now. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01Staging: lustre: Make obd_proc_version_seq_show staticDarshana Padmadas1-1/+1
The function obd_proc_version_seq_show is only used in this file, so make it static. This eliminates the following sparse warning: warning: symbol 'obd_proc_version_seq_show' was not declared. Should it be static? Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01staging: lustre: Convert "return seq_printf(...)" usesJoe Perches1-16/+22
The seq_printf return value, because it's frequently misused, will eventually be converted to void. See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to seq_has_overflowed() and make public") Convert these "return seq_printf(...)" uses to: seq_printf(seq, ...); return 0; Done via cocci script: @@ struct seq_file *seq; @@ - return \(seq_printf\|seq_puts\|seq_putc\)(seq, ...); + return 0; With some additional reformatting and typing post conversion. Miscellanea: o convert an rc++ use to a bool o use seq_puts with fixed strings where appropriate Signed-off-by: Joe Perches <joe@perches.com> Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17Staging: lustre: error handling tweaks in obd_ioctl_getdata()Dan Carpenter1-11/+15
1) The places which called copy_from_user() were returning the number of bytes not copied instead of -EFAULT. 2) The user could trigger a memory leak if the condition "(hdr.ioc_len != data->ioc_len)" was true. Instead of adding a new call to OBD_FREE_LARGE(), I created a free_buf label and changed everything to use that label. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macrosTristan Lelong1-2/+3
This patch fix a sparse warning in lustre sources warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got char *<noident> This is done by adding the missing __user attribute on userland pointers inside the LPROC_SEQ_FOPS like macros: - LPROC_SEQ_FOPS - LPROC_SEQ_FOPS_RW_TYPE - LPROC_SEQ_FOPS_WR_ONLY - LDLM_POOL_PROC_WRITER The patch also updates all the functions that are used by this macro: - lprocfs_wr_* - *_seq_write as well as some helpers used by the previously modified functions (otherwise fixing the sparse warning add some new ones): - lprocfs_write_frac_helper - lprocfs_write_helper - lprocfs_write_u64_helper The patch also fixes one __user pointer direct dereference by strncmp in function fld_proc_hash_seq_write. Signed-off-by: Tristan Lelong <tristan@lelong.xyz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29drivers: staging: lustre: Fix "'foo * bar' should be 'foo *bar'" errorsGreg Donald1-2/+2
Fix checkpatch.pl "'foo * bar' should be 'foo *bar'" errors Signed-off-by: Greg Donald <gdonald@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02staging: lustre: lustre: obdclass: linux: include <linux/*.h> instead of <asm/*.h>Tapasweni Pathak1-3/+3
This patch fixes checpatch.pl warning in linux-module.c file. WARNING: Use #include <linux/io.h> instead of <asm/io.h> WARNING: Use #include <linux/poll.h> instead of <asm/poll.h> WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11drivers: staging: lustre: Fix "space prohibited after that open parenthesis '('" errorsGreg Donald1-2/+2
Fix checkpatch.pl "space prohibited after that open parenthesis '('" errors Signed-off-by: Greg Donald <gdonald@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>