1
0
Fork 0
Commit Graph

30 Commits (3b93c0f4b6accb8105152900d7e414593a8b0c79)

Author SHA1 Message Date
NeilBrown 7059b37ffe staging: lustre: move all libcfs_all includes except in lustre/lnet/libcfs/
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-25 18:36:43 +02:00
NeilBrown e6eafdb9f9 staging: lustre: start moving includes out of libcfs.h
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-25 18:34:03 +02:00
NeilBrown 3c88bdbbf9 staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.
All usages of the form
  LIBCFS_ALLOC(variable, sizeof(variable))
or
  LIBCFS_ALLOC(variable, sizeof(variable's-type))

are changed to
  variable = kzalloc(sizeof(...), GFP_NOFS);

Similarly, all
   LIBCFS_FREE(variable, sizeof(variable))
become
   kfree(variable);

None of these need the vmalloc option, or any of the other minor
benefits of LIBCFS_ALLOC().

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09 15:39:28 +01:00
Greg Kroah-Hartman c14dd9d5f8 staging: lustre: add SPDX identifiers to all lustre files
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-11-11 14:46:21 +01:00
James Simmons 709b4c54e5 staging: lustre: lnet: add include path to Makefile
Rationalize include paths in the lnet core source code files.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22 18:36:52 -07:00
James Simmons 037697dc2a staging: lustre: lnet: migrate headers to lnet uapi directory
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-22 18:36:50 -07:00
James Simmons 28cb3e268f staging: lustre: lnet: delete lnet.h
The header lnet.h is just a bunch of headers included in
a header. Just delete it and include the appropriate
headers where needed.

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-22 18:36:50 -07:00
James Simmons 06ef1af8b4 staging: lustre: lnet: change lnet_process_id_t to proper structure
Change lnet_process_id_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.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-03-06 09:17:05 +01:00
Yang Sheng 989a0d7dfe staging: lustre: remove set but unused variables
Remove set but unused variables in nidstring.c
and osc_request.c as reported by make W=1.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8378
Reviewed-on: http://review.whamcloud.com/23221
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@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-06 10:56:29 +01:00
James Simmons c54f79916c staging: lustre: lnet: replace uninitialized_var
Checkpatch for some reason doesn't like the way
libcfs_str2net_internal. Lets just replace it with
nf being set to NULL instead

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-18 08:47:32 +01:00
James Simmons a2d288c6b9 staging: lustre: lnet: don't use bare unsigned
Turn all bare unsigned to unsigned int that were
detected by checkpatch in the LNet/libcfs layer.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-18 08:47:31 +01:00
Oleg Drokin 6a5b99a46b staging/lustre: Replace sun.com GPLv2 URL with gnu.org one.
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-17 20:37:21 -07:00
Oleg Drokin ed4df35478 staging/lustre: Remove the "Please contact SUN for GPL" from headers
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-17 20:37:21 -07:00
Li Xi 8f1c001271 staging: lustre: remove annoying message in parse_nidrange
When setting TBF rules of jobid, parse_nidrange() prints warning
messages. However, this is unnecessary and annoying since paring
a TBF rule will always try to parse the jobid like a nid.

Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7647
Reviewed-on: http://review.whamcloud.com/17916
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02 15:23:49 -08:00
James Simmons 58cb2ad36f staging: lustre: return proper error code for LNet core
It is consider bad style in the linux kernel to
return -1 or a positive number for an error.
Instead return the appropriate error codes.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/17626
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02 15:23:49 -08:00
James Simmons 5fd88337d2 staging: lustre: fix all conditional comparison to zero in LNet layer
Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects
the LNet code to behavior according to kernel coding standards.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons 06ace26edc staging: lustre: fix all NULL comparisons in LNet layer
This removes every instance of checking a variable against
NULL in the LNet source code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons 06f2f2f2bb staging: lustre: balance braces properly in LNet layer
Properly balance the braces done wrong as reported by
checkpatch.pl.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons 51078e25c1 staging: lustre: add missing spaces for LNet layer reported by checkpatch.pl
Add missing spaces in the code reported by checkpatch.pl.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons c314c319c0 staging: lustre: align all code properly for LNet core
In several places in the LNet core the code doesn't align
up properly. This resolves those checkpath issues.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons 4420cfd3f5 staging: lustre: format properly all comment blocks for LNet core
In several places in the LNet core comment blocks don't follow the
linux kernel style. This patch cleans those problems up.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons a77ddf7cc0 staging: lustre: Use C99 initializers for struct netstrfns
Update struct netstrfns to use C99 initializers.

Remove old LND types from the netstrfns table, as they are
long obsolete and shouldn't be needed even for interop anymore.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6210
Reviewed-on: http://review.whamcloud.com/15088
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
Frederic Saunier 1a1e76c07d staging: lustre: remove last entry of libcfs_netstrfns[]
Currently NID string handling test for the last entry,
and last entry has .nf_type == (__u32) -1. If we ask
for a non existent LND we hit the last entry which then
calls a strlen on a NULL which causes a error. We can
avoid this problem if we just remove the last entry
since it is not used for anything except as a last
entry marker.

Signed-off-by: Frederic Saunier <frederic.saunier@atos.net>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6501
Reviewed-on: http://review.whamcloud.com/15424
Reviewed-by: frank zago <fzago@cray.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-10-24 18:52:21 -07:00
Dmitry Eremin 80feb1ef34 staging: lustre: provide separate buffers for libcfs_*2str()
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-24 18:52:21 -07:00
Joshua Walgenbach 335ea56450 staging: lustre: add in NID range management for libcfs
This is a partial backport of the NID range management
added in for nodemap. We only backport the libcfs related
parts here.

Signed-off-by: Joshua Walgenbach <jjw@iu.edu>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3527
Reviewed-on: http://review.whamcloud.com/8057
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Ken Hornstein <kenh@cmf.nrl.navy.mil>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
James Simmons e8834329bb staging: lustre: Avoid nid range related forward declarations in nidstring.c
Since forward declarations are frowned on upstream we move
the NID range handling to near the start of the nidstring.c
file.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/15086
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
James Simmons c1af01da79 staging: lustre: move cfs_ip_addr_* function from kernel libcfs to LNet
Both of cfs_ip_addr_parse and cfs_ip_addr_match which are located in
libcfs kernel module are used only for LNet so move this into the
nidstring handling code where it belongs. Also create user land
versions of these functions in the libcfs user land library.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/15085
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
James Simmons 00e27ff1e2 staging: lustre: move struct netstrfns to nidstr.h
The reason struct netstrfns exist in nidstrings.c
was to avoid forward decleration errors. The best
way to handle this instead is to move this structure
to a header file. Since this structure is used in
the userland utilities as well so we place it in
nidstr.h which is exposed to userland.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/15083
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
James Simmons 43049a83b5 staging: lustre: remove libcfs_init_string function
All the function libcfs_init_string did was initialize
a spinlock. We can initialize the spinlock statically
instead.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
James Simmons 47ca6ec267 staging: lustre: move nidstring handling to LNet layer
Moved the source file nidstring.c from libcfs to lnet
since that is the only place it is used. With the
move of nidstring to lnet some functions in libcfs
need to be exported. In later patches those functions
that are only used by LNet also will be moved to the
LNet layer. Also add in missing MAX_NUMERIC_VALUE
defination.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00