LU-9859 libcfs: delete libcfs/linux/libcfs.h Lustre uses libcfs.h as a the header to include all headers. This approach has drawbacks like colliding with MOFED compat headers that do the same thing. This patch is the first step to unwind including libcfs.h everywhere. This starts with eliminating linux/libcfs.h. Test-Parameters: trivial Change-Id: Id2040d4295c16135561c8251e160cb2117ee21b8 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/30706 Reviewed-by: Doug Oucharek <dougso@me.com> Tested-by: Jenkins Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
LU-10308 misc: update Intel copyright messages for 2017 Update copyright messages for files updated in 2016, excluding trivial patches. Add trivial patches to updatecw.sh script exclude list. Revert some changes that were incorrectly attributed to the 2016 (d10200a80770f0029d1d665af954187b9ad883df) and 2015 (0754bc8f2623bea184111af216f7567608db35b6) copyright update patches themselves, since they were not in the exclude list when the subsequent script was run. Test-Parameters: trivial Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Change-Id: I82f21c30c4dac75792bb49fc139bee2ca51f5545 Reviewed-on: https://review.whamcloud.com/30341 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Jian Yu <jian.yu@intel.com> Reviewed-by: James Nunez <james.a.nunez@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-10086 libcfs: use dynamic minors for /dev/{lnet,obd} Request dynamic minor allocation when registering /dev/lnet and /dev/obd. Remove the obsolete create-device-if-not-found code from register_ioc_dev(). Signed-off-by: John L. Hammond <john.hammond@intel.com> Change-Id: I59c70912b4729f58a76dc6107b3e1d7379c6d7a3 Reviewed-on: https://review.whamcloud.com/29741 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Jian Yu <jian.yu@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-9558 libcfs: include new sched directory headers Starting in linux kernel version 4.11 the very large sched.h header is not being broken up into smaller headers that are placed in linux/sched/*. This patch handles this small change. Test-Parameters: trivial Change-Id: I82ba8ced17f7570fe052777d970a769f1dd366da Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/27557 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-8648 all: remove all Sun license and URL references The link to the GPL license at Sun is no longer there. Also Sun Inc is gone so lets remove all references to it in our source code. Test-Parameters: trivial Change-Id: Ib47d07dcef49a1ef624d0d8a4a91b9731f486278 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: http://review.whamcloud.com/22800 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Frank Zago <fzago@cray.com>
LU-6245 libcfs: Remove kp30.h The header kp30.h contains various wrappers to handle things like module parameter handling. We can now remove this abstraction. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Change-Id: I7f5fec4372023146215c740e287529a05dfceba6 Reviewed-on: http://review.whamcloud.com/19460 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: John L. Hammond <john.hammond@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>
LU-7243 misc: update Intel copyright messages 2015 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> Change-Id: I70fe6a346790e15d23606a3f380e7ef8fb8b84a0 Reviewed-on: http://review.whamcloud.com/16758 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> 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>
LU-6245 libcfs: remove linux-utils.c The source file linux-utils.c contains only empty functions of features that were never implemented. We can delete this unused code. Change-Id: Id5820a94d15b055096544120fb14b987604e733c Signed-off-by: frank zago <fzago@cray.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: http://review.whamcloud.com/15910 Tested-by: Jenkins Reviewed-by: John L. Hammond <john.hammond@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6266 libcfs: add kstrtoul() compat function The kstrtoul() function was only added to the upstream kernel in commit v2.6.38-6934-g33ee3b2. While it is backported to RHEL6 2.6.32 kernels, it does not exist for vanilla kernels before that point. The patch http://review.whamcloud.com/5700 added uses of kstrtoul() to Lustre that break the build for older kernels. While it would be possible to convert those calls to simple_strtoul(), that function is deprecated in newer kernels, and checkpatch.pl will generate a warning, so using kstrtoul() is the right thing for newer kernels. Add a wrapper function for kstrtoul() for older kernels. There are other kstrto*() functions in newer kernel not added by this patch. Only the one function call is currently used, though it would be good to convert Lustre over to using this family of functions instead of simple_strtoul() in the future. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Change-Id: Id30313e51b8d240aacc09a6e86a22460fa2540e5 Reviewed-on: http://review.whamcloud.com/13820 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@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>
LU-6245 libcfs: remove prim wrappers for libcfs The libcfs layer contains wrappers to handle primitive management for both kernel space and user land. Since libcfs is no longer built for user land we can remove the wrappers. For linux-prim.h we kept only what is needed to deal with different kernel versions. Also we separated out libcfs_string.h to util/string.h so we can remove the wrappers no longer needed. Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: I0bad836f20ef29bf2ed17f1f4e5e1234d193868e Reviewed-on: http://review.whamcloud.com/13874 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6245 libcfs: cleanup libcfs lock handling Previously with libcfs being built for user land and kernel space wrappers were created to transparently handle locking. Now that user land support has been removed we delete all those locking wrappers with this patch. Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: Icbd9b5c0918cb01202439416b220b6f327144a91 Reviewed-on: http://review.whamcloud.com/13793 Tested-by: Jenkins Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-6245 libcfs: remove tcpip abstraction from libcfs Since libcfs no longer builds for user land we can move the tcpip abstraction that exist to the LNET layer which is the only place that uses it. Also the migrated code will use native linux kernel apis directly instead of with wrappers. Change-Id: Iaa39e4f581f18cfe586feb5bfbf4233a2f2335c7 Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-on: http://review.whamcloud.com/13760 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6068 misc: update Intel copyright messages 2014 Update the copyright messages for changes made in 2014. In some cases, changes made in 2013 did not generate an updated copyright message, so these files are updated accordingly. In some cases there were no licenses on newly-added files, so add them (either with new copyrights, or including copyrights from the source files). Some types of changes that are not actually changing the code (e.g. whitespace, mass changes to add or remote prefixes, patches updating the copyright messages, patch reversions and the reverted patch, patches that only delete code, etc.) have been excluded. The updatecw.sh script was updated to fix a number of problems: - it now handles comments in nroff (man page) files properly - remove need to handle non-Intel copyrights specially - allow subdirectory to be specified on command-line - improve script debugging when running with "sh -vx" - print patches changing the most files, to catch mass replacements There are still a few cases that need to be fixed up by hand (e.g. files split up and "git log --follow" can't find the original). Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Change-Id: Ib4875400a4908dc79ddc8b82ab0fe3ee903ebbe5 Reviewed-on: http://review.whamcloud.com/13174 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 libcfs: remove LUSTRE_{,SRV_}LNET_PID Remove LUSTRE_LNET_PID (12354) and LUSTRE_SRV_LNET_PID (12345) from the libcfs headers and replace their uses with a new macro LNET_PID_LUSTRE (also 12345) in lnet/types.h. Signed-off-by: John L. Hammond <john.hammond@intel.com> Change-Id: Ib92e1eaa8237c998d04ee0110907dac2dbffdc5e Reviewed-on: http://review.whamcloud.com/11985 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2675 libcfs: remove {ENTRY,EXIT}_NESTING macros Remove the unnecessary macros ENTRY_NESTING_SUPPORT, ENTRY_NESTING, EXIT_NESTING, and __current_nesting_level(). Signed-off-by: John L. Hammond <john.hammond@intel.com> Change-Id: I12c3c9a253b1dc0929a78c2f807b2a94434d3496 Reviewed-on: http://review.whamcloud.com/11984 Tested-by: Jenkins Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396 libcfs: add sparse annotation __user wherever needed This fixes sparse warnings such as: .../api-ni.c:1639:33: warning: incorrect type in argument 3 (different address spaces) .../api-ni.c:1639:33: expected struct lnet_process_id_t [noderef] [usertype] <asn:1>*ids .../api-ni.c:1639:33: got struct lnet_process_id_t [usertype] *<noident> There is no code change. Change-Id: I07a40b3e2f5bf179923c57d9eda86b4921cd7699 Signed-off-by: frank zago <fzago@cray.com> Reviewed-on: http://review.whamcloud.com/11817 Tested-by: Jenkins Reviewed-by: James Simmons <uja.ornl@gmail.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3963 libcfs: remove proc handler wrappers Libcfs has wrappers to handle other platforms proc handling which is no longer needed. This patch unwinds those wrappers. Change-Id: I529a5c3ac0fe6eed9e967782d9d24e40215d3840 Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-on: http://review.whamcloud.com/11963 Tested-by: Jenkins Reviewed-by: Bob Glossman <bob.glossman@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4746 libcfs: Use Linux kernel current_umask() function Lustre not using kernel current_umask() function breaks GRSecurity umask handling. This is also needed for the linux api cleanup. Replaces current->fs->umask with more secure current_umask() function Change-Id: Ide0b83eb3e6c69e1e2178ede37ce708227f1c107 Signed-off-by: Andrew Prout <ajprout@hotmail.com> Signed-off-by: Cliff White <cliffwhi@intel.com> Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-on: http://review.whamcloud.com/11642 Tested-by: Jenkins Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
LU-5327 libcfs: add libcfs/types.h Add libcfs/include/libcfs/types.h which unconditionally includes linux/types.h and defines the LP*64 macros by testing for _ASM_GENERIC_INT_L64_H or _ASM_GENERIC_INT_LL64_H. Remove autoconf tests to determine in __u64 is unsigned long or unsigned long long. Remove the headers posix-types.h and posix-wordsize.h. This fixes two problems: 1) Use of the LP*64 macros may make lustre headers unusable when config.h is not included (like when the headers are used out of tree). 2) Some platforms (like powerpc64) define __u64 to be unsigned long in the kernel and unsigned long long in userspace. This means that a single autoconf test cannot be used to determine how to define the terrible LP*64 macros. Imaginary ports of Lustre to non-Linux platforms may handle this change by adding linux/types.h somewhere in their include path and putting the right typedefs and defines therein. Signed-off-by: John L. Hammond <john.hammond@intel.com> Change-Id: Iaab8e552d2d8a1c87ca2675f5068bc2943d8ce18 Reviewed-on: http://review.whamcloud.com/11070 Tested-by: Jenkins Reviewed-by: Robert Read <robert.read@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3963 cleanup: C89 and build cleanups use C99 initialization for a types, remove some platform depended code and use POSIX compatible instead. don't build a lhsmtool is none utils allowed. Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com> Change-Id: I6e2837953902520240e9ceb251c92329d328d715 Reviewed-on: http://review.whamcloud.com/7803 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>