summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
AgeCommit message (Collapse)Author
2017-11-11staging: lustre: add SPDX identifiers to all lustre filesGreg Kroah-Hartman
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: ptlrpc: add include path to MakefileJames Simmons
Rationalize include paths in the ptlrpc/ldlm 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: migrate remaining uapi headers to uapi directoryJames Simmons
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-07-30staging: lustre: ptlrpc: print times in microsecondsBob Glosman
report times and time diffs in seconds.microseconds instead of seconds Signed-off-by: Bob Glosman <bob.glossman@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7733 Reviewed-on: http://review.whamcloud.com/18335 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Minh Diep <minh.diep@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>
2016-12-07staging/lustre: Convert all bare unsigned to unsigned intOleg Drokin
Highlighted by relatively new checkpatch test, warnings like: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging/lustre: constify sops structureJulia Lawall
sops, of type struct seq_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: Add spaces preferred around that '{+, -, *, /, |, <<, >>, &}'Oleg Drokin
This patch fixes all checkpatch occurences of "CHECK: spaces preferred around that '{+,-,*,/,|,<<,>>,&}' (ctx:VxV)" in Lustre code. Signed-off-by: Emoly Liu <emoly.liu@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging/lustre: Fix blank line before EXPORT_SYMBOL()Emoly Liu
This patch fixes one checkpatch warning in lustre: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable Signed-off-by: Emoly Liu <emoly.liu@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging/lustre: Replace sun.com GPLv2 URL with gnu.org one.Oleg Drokin
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 Drokin
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-06-17staging/lustre/ptlrpc: Fix Multiple AssignmentsNathaniel Clark
Fix all multiple assignments on lustre/ptlrpc directory. Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28staging: lustre: fld: add local fldb to each targetwang di
Add local FLDB to each MDT, so OSD/OUT can check whether FID is remote by looking up local FLDB, i.e. no need send RPC to MDT0. This is just the client part of the work. Signed-off-by: wang di <di.wang@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4076 Reviewed-on: http://review.whamcloud.com/7884 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@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>
2016-04-26staging/lustre: Fix blank line after/before {/} styleOleg Drokin
This patch fixes all checkpatch occurences of CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' in Lustre code. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-11staging/lustre: Fix braces {} styleOleg Drokin
This fixes all checkpatch form of this from the Lustre tree: CHECK: braces {} should be used on all arms of this statement Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-04mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macrosKirill A. Shutemov
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time ago with promise that one day it will be possible to implement page cache with bigger chunks than PAGE_SIZE. This promise never materialized. And unlikely will. We have many places where PAGE_CACHE_SIZE assumed to be equal to PAGE_SIZE. And it's constant source of confusion on whether PAGE_CACHE_* or PAGE_* constant should be used in a particular case, especially on the border between fs and mm. Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much breakage to be doable. Let's stop pretending that pages in page cache are special. They are not. The changes are pretty straight-forward: - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN}; - page_cache_get() -> get_page(); - page_cache_release() -> put_page(); This patch contains automated changes generated with coccinelle using script below. For some reason, coccinelle doesn't patch header files. I've called spatch for them manually. The only adjustment after coccinelle is revert of changes to PAGE_CAHCE_ALIGN definition: we are going to drop it later. There are few places in the code where coccinelle didn't reach. I'll fix them manually in a separate patch. Comments and documentation also will be addressed with the separate patch. virtual patch @@ expression E; @@ - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ expression E; @@ - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ @@ - PAGE_CACHE_SHIFT + PAGE_SHIFT @@ @@ - PAGE_CACHE_SIZE + PAGE_SIZE @@ @@ - PAGE_CACHE_MASK + PAGE_MASK @@ expression E; @@ - PAGE_CACHE_ALIGN(E) + PAGE_ALIGN(E) @@ expression E; @@ - page_cache_get(E) + get_page(E) @@ expression E; @@ - page_cache_release(E) + put_page(E) Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-01staging/lustre/ptlrpc: Fix style vs open parenthesis alignmentOleg Drokin
This mostly fixes checkpatch complaints about "Alignment should match open parenthesis" Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25staging/lustre/ptlrpc: Adjust comments to better conform to coding styleOleg Drokin
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: Get rid of object update codeOleg Drokin
Object update was originally planned to be used for cross-server updates, so nothign to do with the client. The idea was later significantly reworked anyway so even wire structs should not be retained. This gets rid of update_cmd_t, UPDATE and UPDATE_REPLY rpc and corresponding subcommands, swabbig logic and such. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging/lustre/ptlrpc: Adjust NULL comparison codestyleOleg Drokin
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>
2015-12-21staging: lustre: update Intel copyright messages 2015Andreas Dilger
Update copyright messages in files modified by Intel employees in 2015 by non-trivial patches. Exclude patches that are only deleting code, renaming functions, or adding or removing whitespace. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7243 Reviewed-on: http://review.whamcloud.com/16758 Reviewed-by: James Nunez <james.a.nunez@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15Staging: lustre: Replace LPROCFS_CLIMP_EXIT with up_readKsenija Stanojevic
In all call sites type of argument that macro LPROCFS_CLIMP_EXIT use is the same, so replace it with up_read function. Also remove the macro since it's no longer used. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27Staging: lustre: Replace LPROCFS_CLIMP_CHECK with lprocfs_climp_checkKsenija Stanojevic
Static inline functions are preferred over macros. The function is placed in obd_class.h instead lprocfs_status.h because obd_class.h includes header obd.h which contains definition of struct obd_device and in that way avoids build error: Dereferencing pointer to incomplete type. Also remove macro LPROCFS_CLIMP_CHECK since it's no longer used. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: lustre: ptlrpc: Replace seq_printf() with seq_putc()Amitoj Kaur Chawla
Replace seq_printf() with seq_putc() since it is more expensive than seq_putc(). Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: lustre: provide separate buffers for libcfs_*2str()Dmitry Eremin
Provide duplicates with separate buffers for libcfs_*2str() functions. Replace libcfs_nid2str() with libcfs_nid2str_r() function in critical places. Provide buffer size for nf_addr2str functions. Use __u32 as nf_type always Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6070 Reviewed-on: http://review.whamcloud.com/13185 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: lustre: lproc_ptlrpc: Replace simple_strtol with simple_stroulShivani Bhardwaj
The variable inst is a __u32 type and hence the function used should be simple_strtoul. Semantic patch used: @@ typedef __u32; __u32 e; @@ e = - simple_strtol + simple_strtoul (...) Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: lustre: add a blank line after function/struct/union/enum declarationsMike Rapoport
Fixes checkpatch.pl CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations 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" --fix-inplace -f $f done Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: lustre: remove multiple blank linesMike Rapoport
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-10-13staging: lustre: add missing blank line after declarationsMike Rapoport
Fixes checkpatch.pl WARNING:LINE_SPACING: Missing a blank line after declarations. 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=Missing \ --fix-inplace -f $f done Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging/lustre: Make nrs_policy_get_info_locked() staticRocco Folino
This patch fixes the warning generated by sparse: "symbol 'nrs_policy_get_info_locked' was not declared. Should it be static?" by declaring the function static. Signed-off-by: Rocco Folino <rocco@devzen.net> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging/lustre: Remove unused target_print_req()Oleg Drokin
This is a server-side request printing function, so we don't really need it on the client. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging/lustre/obdclass: Remove unused lprocfs_wr_evict_clientOleg Drokin
This is only used on the servers to evict clients. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging/lustre: use 64-bit times for request timesArnd Bergmann
All request timestamps and deadlines in lustre are recorded in time_t and timeval units, which overflow in 2038 on 32-bit systems. In this patch, I'm converting them to time64_t and timespec64, respectively. Unfortunately, this makes a relatively large patch, but I could not find an obvious way to split it up some more without breaking atomicity of the change. Also unfortunately, this introduces two instances of div_u64_rem() in the request path, which can be slow on 32-bit architectures. This can probably be avoided by a larger restructuring of the code, but it is unlikely that lustre is used in performance critical setups on 32-bit architectures, so it seems better to optimize for correctness rather than speed here. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging/lustre: use 64-bit time for adaptive timeoutArnd Bergmann
The adaptive timeout handling stores absolute times in 32-bit time_t quantities, which will overflow in 2038. This changes it to use time64_t. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: lustre: moved extern declarations to a headerAnton Gerasimov
This patch moves declarations of variables used in several files across the ptlrpc module from source files to a local header. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16staging/lustre: Remove references to OBD_ALLOC/FREE* in commentsOleg Drokin
Since everything is now supposed to use regular kernel alloc and free functions. Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: lustre: fix whitespace errors reported by checkpatch.plMike Rapoport
Added/removed spaces and replaced '+1' with '1' in several places to eliminate SPACING and POINTER_LOCATION errors reported by checkpatch.pl Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-13staging: lustre: ptlrpc: Use !x to check for kzalloc failureJulia Lawall
!x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; statement S1, S2; @@ x = kzalloc(...); if ( - x == NULL + !x ) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08Staging: lustre: ptlrpc: signedness bug in high_priority_ratio_store()Dan Carpenter
We want to store a non-negative int here. The original code had a check for unsigned long less than zero which is a mistake but also casting from a positive long to an int can result in a negative number. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: lustre: ptlrpc: clean up whitespace and align function paramsChris Hanna
Minor changes to remove excessive whitespace and improve readability of ptlrpc functions. Signed-off-by: Chris Hanna <hannac@iu.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre/obd: final removal of procfs stuffDmitry Eremin
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: move status files from procfs to debugfsDmitry Eremin
change type of * obd->obd_proc_entry * obd->obd_svc_procroot * lov->lov_pool_proc_entry * obd_type->typ_procroot * pool_desc->pool_proc_entry Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre/ldlm: move all remaining files from procfs to debugfsDmitry Eremin
Move all files except stats. It will be moved later after change type of obddev->obd_proc_entry member. 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/ptlrpc: move procfs high_priority_ratio file to sysfsOleg Drokin
Move ptlrpc service high_priority_ratio entry from procfs to sysfs. Currently in use only by ldlm callback service only in /sys/fs/lustre/ldlm/services/ldlm_cbd/ Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre/ptlrpc: move procfs threads* files to sysfsOleg Drokin
Move ptlrpc service threads_min, threads_max and threads_running entries from procfs to sysfs. Currently in use only by ldlm callback service only in /sys/fs/lustre/ldlm/services/ldlm_cbd/ Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging/lustre/ptlrpc: Add infrastructure for sysfs migrationOleg Drokin
Added necessary plumbing for ptlrpc sysfs integration for registered services, sysfs directory registration. Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08Staging: lustre: ptlrpc: lproc_ptlrpc: remove unneeded null test before freeJulia Lawall
Kfree can cope with a null argument, so drop null tests. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); // </smpl> In the first case, the only cleanup needed is the unlock, so jump to that directly. Likewise, in the first two failure cases of ptlrpc_lprocfs_nrs_seq_write, no cleanup is needed, so just drop the goto and return directly. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: lustre: ptlrpc: Use kzalloc and kfreeJulia Lawall
Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression ptr,size; @@ - OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ - OBD_FREE(ptr, size); + kfree(ptr); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01staging: lustre: Convert uses of "int rc = seq_printf(...)"Joe Perches
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 uses to: seq_printf(seq, ...); return 0; Done via cocci script: @@ struct seq_file *seq; int i; @@ - i = seq_printf(seq, + seq_printf(seq, ...); ... - return i; + return 0; @@ struct seq_file *seq; int i; @@ - i = 0; - i += seq_printf(seq, + seq_printf(seq, ...); ... - return i; + return 0; With some additional reformatting and typing post conversion to remove the now unnecessary "int i;" declaration. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01staging: lustre: Convert "return seq_printf(...)" usesJoe Perches
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-03-01Staging: lustre: Deleted space prohibited between function name and open ↵Melike Yurtoglu
parenthesis WARNING: space prohibited between function name and open parenthesis '(' Remove unnecessary space between function name and opening parenthesis. That was found by running checkpatch Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>