From 617d5a673cd16aa91fa9668b94cc385094fae852 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 15 Jan 2009 10:44:54 -0800 Subject: Rename modules to module and update references --- module/spl/spl-err.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 module/spl/spl-err.c (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c new file mode 100644 index 000000000..c4508dfa2 --- /dev/null +++ b/module/spl/spl-err.c @@ -0,0 +1,78 @@ +/* + * This file is part of the SPL: Solaris Porting Layer. + * + * Copyright (c) 2008 Lawrence Livermore National Security, LLC. + * Produced at Lawrence Livermore National Laboratory + * Written by: + * Brian Behlendorf , + * Herb Wartens , + * Jim Garlick + * UCRL-CODE-235197 + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include + +#ifdef DEBUG_SUBSYSTEM +#undef DEBUG_SUBSYSTEM +#endif + +#define DEBUG_SUBSYSTEM S_GENERIC + +#ifndef NDEBUG +static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; +static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" }; +#endif + +void +vpanic(const char *fmt, va_list ap) +{ + char msg[MAXMSGLEN]; + + vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); + panic(msg); +} /* vpanic() */ +EXPORT_SYMBOL(vpanic); + +void +cmn_err(int ce, const char *fmt, ...) +{ + char msg[MAXMSGLEN]; + va_list ap; + + va_start(ap, fmt); + vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); + va_end(ap); + + CERROR("%s", msg); +} /* cmn_err() */ +EXPORT_SYMBOL(cmn_err); + +void +vcmn_err(int ce, const char *fmt, va_list ap) +{ + char msg[MAXMSGLEN]; + + if (ce == CE_PANIC) + vpanic(fmt, ap); + + if (ce != CE_NOTE) { /* suppress noise in stress testing */ + vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); + CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); + } +} /* vcmn_err() */ +EXPORT_SYMBOL(vcmn_err); -- cgit v1.2.3 From 4bd577d069985e7b79357cb9744a46b03cdf881b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 27 Oct 2009 15:54:45 -0700 Subject: Rebase cmn_err on vcmn_err and don't warn about missing \n The cmn_err/vcmn_err functions are layered on top of the debug system which usually expects a newline at the end. However, there really doesn't need to be a newline there and there in fact should not be for the CE_CONT case so let's just drop the warning. Also we make a half-hearted attempt to handle a leading ! which means only send it to the syslog not the console. In this case we just send to the the debug logs and not the console. --- module/spl/spl-debug.c | 4 ---- module/spl/spl-err.c | 37 +++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 22 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 6d71f4b82..a3fcd74e0 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -724,10 +724,6 @@ spl_debug_vmsg(spl_debug_limit_state_t *cdls, int subsys, int mask, break; } - if (unlikely(*(string_buf + needed - 1) != '\n')) - printk(KERN_INFO "format at %s:%d:%s doesn't end in newline\n", - file, line, fn); - header.ph_len = known_size + needed; debug_buf = (char *)page_address(tage->page) + tage->used; diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index c4508dfa2..8f46aae5b 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -33,10 +33,8 @@ #define DEBUG_SUBSYSTEM S_GENERIC -#ifndef NDEBUG static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" }; -#endif void vpanic(const char *fmt, va_list ap) @@ -48,20 +46,6 @@ vpanic(const char *fmt, va_list ap) } /* vpanic() */ EXPORT_SYMBOL(vpanic); -void -cmn_err(int ce, const char *fmt, ...) -{ - char msg[MAXMSGLEN]; - va_list ap; - - va_start(ap, fmt); - vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); - va_end(ap); - - CERROR("%s", msg); -} /* cmn_err() */ -EXPORT_SYMBOL(cmn_err); - void vcmn_err(int ce, const char *fmt, va_list ap) { @@ -70,9 +54,26 @@ vcmn_err(int ce, const char *fmt, va_list ap) if (ce == CE_PANIC) vpanic(fmt, ap); - if (ce != CE_NOTE) { /* suppress noise in stress testing */ + if (ce != CE_NOTE) { vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); - CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); + + if (fmt[0] == '!') + CDEBUG(D_INFO, "%s%s%s", + ce_prefix[ce], msg, ce_suffix[ce]); + else + CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); } } /* vcmn_err() */ EXPORT_SYMBOL(vcmn_err); + +void +cmn_err(int ce, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vcmn_err(ce, fmt, ap); + va_end(ap); +} /* cmn_err() */ +EXPORT_SYMBOL(cmn_err); + -- cgit v1.2.3 From 2b5adaf18fde25b963a9d21407773544f2cbed6f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 27 Oct 2009 16:17:06 -0700 Subject: I should not have removed these, they are important. --- module/spl/spl-err.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 8f46aae5b..3ee284868 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -33,8 +33,10 @@ #define DEBUG_SUBSYSTEM S_GENERIC +#ifndef NDEBUG static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" }; +#endif void vpanic(const char *fmt, va_list ap) -- cgit v1.2.3 From b520b14305975bc8b18d3b8e3844ba6c4e119a0d Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Thu, 7 Jan 2010 16:58:29 +0000 Subject: sun-fix-panic-str Fix panic() string, which was being used as a format string, instead of an already-formatted string. Signed-off-by: Ricardo M. Correia --- module/spl/spl-err.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 3ee284868..f87e2a394 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -44,7 +44,7 @@ vpanic(const char *fmt, va_list ap) char msg[MAXMSGLEN]; vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); - panic(msg); + panic("%s", msg); } /* vpanic() */ EXPORT_SYMBOL(vpanic); -- cgit v1.2.3 From f7e8739c940c4175b5298de9a00c8c7974aff489 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Thu, 7 Jan 2010 16:58:30 +0000 Subject: sun-fix-whitespace Whitespace fixes. Signed-off-by: Ricardo M. Correia --- include/sys/list.h | 2 +- module/spl/spl-err.c | 8 ++++---- module/spl/spl-vnode.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/include/sys/list.h b/include/sys/list.h index 0a4cf1183..faf7c7a45 100644 --- a/include/sys/list.h +++ b/include/sys/list.h @@ -167,7 +167,7 @@ list_prev(list_t *list, void *object) static inline int list_link_active(list_node_t *node) { - return (node->next != LIST_POISON1) && (node->prev != LIST_POISON2); + return (node->next != LIST_POISON1) && (node->prev != LIST_POISON2); } static inline void diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index f87e2a394..fcf701400 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -53,10 +53,10 @@ vcmn_err(int ce, const char *fmt, va_list ap) { char msg[MAXMSGLEN]; - if (ce == CE_PANIC) - vpanic(fmt, ap); + if (ce == CE_PANIC) + vpanic(fmt, ap); - if (ce != CE_NOTE) { + if (ce != CE_NOTE) { vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); if (fmt[0] == '!') @@ -64,7 +64,7 @@ vcmn_err(int ce, const char *fmt, va_list ap) ce_prefix[ce], msg, ce_suffix[ce]); else CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); - } + } } /* vcmn_err() */ EXPORT_SYMBOL(vcmn_err); diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 7d2080022..12e09b781 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -102,9 +102,9 @@ int vn_open(const char *path, uio_seg_t seg, int flags, int mode, vnode_t **vpp, int x1, void *x2) { - struct file *fp; - struct kstat stat; - int rc, saved_umask = 0; + struct file *fp; + struct kstat stat; + int rc, saved_umask = 0; vnode_t *vp; ENTRY; @@ -126,15 +126,15 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, if (flags & FCREAT) saved_umask = xchg(¤t->fs->umask, 0); - fp = filp_open(path, flags, mode); + fp = filp_open(path, flags, mode); if (flags & FCREAT) (void)xchg(¤t->fs->umask, saved_umask); - if (IS_ERR(fp)) + if (IS_ERR(fp)) RETURN(-PTR_ERR(fp)); - rc = vfs_getattr(fp->f_vfsmnt, fp->f_dentry, &stat); + rc = vfs_getattr(fp->f_vfsmnt, fp->f_dentry, &stat); if (rc) { filp_close(fp, 0); RETURN(-rc); -- cgit v1.2.3 From 716154c5926eb391eb8178203496430ffa7ebed8 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 17 May 2010 15:18:00 -0700 Subject: Public Release Prep Updated AUTHORS, COPYING, DISCLAIMER, and INSTALL files. Added standardized headers to all source file to clearly indicate the copyright, license, and to give credit where credit is due. --- AUTHORS | 12 ++- COPYING | 39 +++++----- DISCLAIMER | 36 +++++---- INSTALL | 162 ++++++++++++++++++++++++++------------- Makefile.in | 9 +++ autogen.sh | 4 +- cmd/Makefile.in | 8 ++ cmd/spl.c | 34 ++++---- cmd/splat.c | 37 ++++----- cmd/splat.h | 32 ++++---- config/Rules.am | 8 ++ config/rpm.am | 8 ++ config/spl-build.m4 | 11 ++- config/spl-meta.m4 | 15 ++-- configure.ac | 50 ++++++------ include/fs/fs_subr.h | 24 ++++++ include/linux/bitops_compat.h | 24 ++++++ include/linux/file_compat.h | 24 ++++++ include/linux/kallsyms_compat.h | 24 ++++++ include/linux/list_compat.h | 24 ++++++ include/linux/mm_compat.h | 24 ++++++ include/linux/module_compat.h | 24 ++++++ include/linux/mutex_compat.h | 24 ++++++ include/linux/smp_compat.h | 24 ++++++ include/linux/sysctl_compat.h | 56 ++++++++++---- include/linux/time_compat.h | 24 ++++++ include/linux/uaccess_compat.h | 24 ++++++ include/linux/workqueue_compat.h | 24 ++++++ include/rpc/types.h | 24 ++++++ include/rpc/xdr.h | 23 +++--- include/sharefs/share.h | 24 ++++++ include/spl-ctl.h | 38 +++++---- include/spl-device.h | 24 ++++++ include/splat-ctl.h | 32 ++++---- include/strings.h | 24 ++++++ include/sys/acl.h | 24 ++++++ include/sys/acl_impl.h | 24 ++++++ include/sys/atomic.h | 32 ++++---- include/sys/attr.h | 24 ++++++ include/sys/bitmap.h | 24 ++++++ include/sys/bootconf.h | 24 ++++++ include/sys/buf.h | 24 ++++++ include/sys/byteorder.h | 24 ++++++ include/sys/callb.h | 32 ++++++-- include/sys/cmn_err.h | 24 ++++++ include/sys/compress.h | 24 ++++++ include/sys/condvar.h | 39 ++++------ include/sys/conf.h | 24 ++++++ include/sys/console.h | 24 ++++++ include/sys/cpuvar.h | 24 ++++++ include/sys/crc32.h | 24 ++++++ include/sys/cred.h | 32 ++++++-- include/sys/ctype.h | 24 ++++++ include/sys/ddi.h | 24 ++++++ include/sys/debug.h | 40 ++++------ include/sys/dirent.h | 24 ++++++ include/sys/disp.h | 24 ++++++ include/sys/dkio.h | 24 ++++++ include/sys/dklabel.h | 24 ++++++ include/sys/dnlc.h | 24 ++++++ include/sys/dumphdr.h | 24 ++++++ include/sys/efi_partition.h | 24 ++++++ include/sys/errno.h | 24 ++++++ include/sys/file.h | 24 ++++++ include/sys/fm/protocol.h | 24 ++++++ include/sys/fm/util.h | 24 ++++++ include/sys/fs/swapnode.h | 24 ++++++ include/sys/int_limits.h | 24 ++++++ include/sys/int_types.h | 24 ++++++ include/sys/inttypes.h | 24 ++++++ include/sys/isa_defs.h | 32 ++++++-- include/sys/kidmap.h | 24 ++++++ include/sys/kmem.h | 40 ++++------ include/sys/kobj.h | 40 ++++------ include/sys/kstat.h | 33 ++++---- include/sys/list.h | 27 ++++++- include/sys/mkdev.h | 24 ++++++ include/sys/mntent.h | 24 ++++++ include/sys/modctl.h | 24 ++++++ include/sys/mode.h | 24 ++++++ include/sys/mount.h | 24 ++++++ include/sys/mutex.h | 32 ++++---- include/sys/note.h | 24 ++++++ include/sys/open.h | 24 ++++++ include/sys/param.h | 24 ++++++ include/sys/pathname.h | 24 ++++++ include/sys/policy.h | 24 ++++++ include/sys/proc.h | 32 ++++---- include/sys/processor.h | 24 ++++++ include/sys/random.h | 47 ++++-------- include/sys/refstr.h | 24 ++++++ include/sys/resource.h | 24 ++++++ include/sys/rwlock.h | 32 ++++---- include/sys/sdt.h | 24 ++++++ include/sys/sid.h | 24 ++++++ include/sys/signal.h | 32 ++++---- include/sys/stat.h | 24 ++++++ include/sys/stropts.h | 24 ++++++ include/sys/sunddi.h | 32 ++++---- include/sys/sunldi.h | 32 ++++---- include/sys/sysevent.h | 24 ++++++ include/sys/sysevent/eventdefs.h | 24 ++++++ include/sys/sysmacros.h | 42 ++++------ include/sys/systeminfo.h | 24 ++++++ include/sys/systm.h | 24 ++++++ include/sys/t_lock.h | 24 ++++++ include/sys/taskq.h | 40 ++++------ include/sys/thread.h | 40 ++++------ include/sys/time.h | 41 ++++------ include/sys/timer.h | 40 ++++------ include/sys/types.h | 28 ++++++- include/sys/types32.h | 24 ++++++ include/sys/u8_textprep.h | 24 ++++++ include/sys/uio.h | 35 ++++++--- include/sys/unistd.h | 24 ++++++ include/sys/utsname.h | 24 ++++++ include/sys/va_list.h | 24 ++++++ include/sys/varargs.h | 24 ++++++ include/sys/vfs.h | 24 ++++++ include/sys/vfs_opreg.h | 24 ++++++ include/sys/vmsystm.h | 32 ++++---- include/sys/vnode.h | 40 ++++------ include/sys/zmod.h | 73 +++++++++++------- include/sys/zone.h | 24 ++++++ include/unistd.h | 24 ++++++ include/util/qsort.h | 24 ++++++ include/vm/anon.h | 24 ++++++ include/vm/pvn.h | 24 ++++++ include/vm/seg_kmem.h | 24 ++++++ lib/Makefile.in | 8 ++ lib/list.c | 22 +++--- lib/list.h | 12 ++- module/spl/spl-atomic.c | 34 ++++---- module/spl/spl-condvar.c | 34 ++++---- module/spl/spl-cred.c | 32 ++++---- module/spl/spl-debug.c | 41 ++++------ module/spl/spl-err.c | 34 ++++---- module/spl/spl-generic.c | 34 ++++---- module/spl/spl-kmem.c | 34 ++++---- module/spl/spl-kobj.c | 34 ++++---- module/spl/spl-kstat.c | 34 ++++---- module/spl/spl-module.c | 34 ++++---- module/spl/spl-mutex.c | 34 ++++---- module/spl/spl-proc.c | 34 ++++---- module/spl/spl-rwlock.c | 34 ++++---- module/spl/spl-taskq.c | 34 ++++---- module/spl/spl-thread.c | 34 ++++---- module/spl/spl-time.c | 34 ++++---- module/spl/spl-vnode.c | 34 ++++---- module/spl/spl-xdr.c | 27 ++++--- module/splat/splat-atomic.c | 34 ++++---- module/splat/splat-condvar.c | 34 ++++---- module/splat/splat-cred.c | 32 ++++---- module/splat/splat-ctl.c | 67 ++++++++-------- module/splat/splat-generic.c | 34 ++++---- module/splat/splat-internal.h | 32 ++++---- module/splat/splat-kmem.c | 34 ++++---- module/splat/splat-kobj.c | 34 ++++---- module/splat/splat-list.c | 34 ++++---- module/splat/splat-mutex.c | 34 ++++---- module/splat/splat-random.c | 34 ++++---- module/splat/splat-rwlock.c | 34 ++++---- module/splat/splat-taskq.c | 34 ++++---- module/splat/splat-thread.c | 34 ++++---- module/splat/splat-time.c | 34 ++++---- module/splat/splat-vnode.c | 34 ++++---- scripts/check.sh | 25 ++++++ 167 files changed, 3491 insertions(+), 1362 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/AUTHORS b/AUTHORS index b780cbc05..2b0fee00c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,10 @@ -Brian Behlendorf , +Brian Behlendorf +- Core Implementation. + Ricardo M. Correia -Herb Wartens , -Jim Garlick +- Bug Fixes +- XDR Implementation. + +Chris Dunlap +- LSD-Tools List Implementation. +- AutoConf META File Support. diff --git a/COPYING b/COPYING index 3912109b5..d159169d1 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -225,7 +225,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. @@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/DISCLAIMER b/DISCLAIMER index 86778c593..1bb04be7e 100644 --- a/DISCLAIMER +++ b/DISCLAIMER @@ -1,22 +1,24 @@ -This notice is required to be provided under our contract with the -U.S. Department of Energy (DOE). This work was produced at the -Lawrence Livermore National Laboratory under Contract with the DOE. +This work was produced at the Lawrence Livermore National Laboratory +(LLNL) under Contract No. DE-AC52-07NA27344 (Contract 44) between +the U.S. Department of Energy (DOE) and Lawrence Livermore National +Security, LLC (LLNS) for the operation of LLNL. -Neither the United States Government nor the Lawrence Livermore National -Security, LLC. nor any of their employees, makes any warranty, express -or implied, or assumes any liability or responsibility for the accuracy, -completeness, or usefulness of any information, apparatus, product, -or process disclosed, or represents that its use would not infringe -privately-owned rights. +This work was prepared as an account of work sponsored by an agency of +the United States Government. Neither the United States Government nor +Lawrence Livermore National Security, LLC nor any of their employees, +makes any warranty, express or implied, or assumes any liability or +responsibility for the accuracy, completeness, or usefulness of any +information, apparatus, product, or process disclosed, or represents +that its use would not infringe privately-owned rights. -Also, reference herein to any specific commercial products, process, -or services by trade name, trademark, manufacturer or otherwise does +Reference herein to any specific commercial products, process, or +services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, -or favoring by the United States Government or the Lawrence Livermore -National Security, LLC. The views and opinions of authors expressed -herein do not necessarily state or reflect those of the United States -Government or the Lawrence Livermore National Security, LLC., and -shall not be used for advertising or product endorsement purposes. +or favoring by the United States Government or Lawrence Livermore +National Security, LLC. The views and opinions of authors expressed +herein do not necessarily state or reflect those of the Untied States +Government or Lawrence Livermore National Security, LLC, and shall +not be used for advertising or product endorsement purposes. -The precise terms and conditions for copying, distribution and +The precise terms and conditions for copying, distribution, and modification are specified in the file "COPYING". diff --git a/INSTALL b/INSTALL index cd052060d..8b82ade08 100644 --- a/INSTALL +++ b/INSTALL @@ -1,16 +1,19 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. -This file is free documentation; the Free Software Foundation gives + This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== -These are generic installation instructions. + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -23,9 +26,9 @@ debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is +the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale -cache files.) +cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -35,22 +38,17 @@ some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. The simplest way to compile this package is: - 0. `cd' to the directory containing the package's source code and type - `sh ./autogen.sh' to generate the configure script for your package. + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. - 1. Type `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. @@ -69,51 +67,66 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. + 6. Often, you can also type `make uninstall' to remove the installed + files again. + Compilers and Options ===================== -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== -You can compile the package for more than one kind of computer at the + You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the +own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. Installation Names ================== -By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PREFIX'. + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PREFIX', the package will -use PREFIX as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular @@ -127,7 +140,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= -Some packages pay attention to `--enable-FEATURE' options to + Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -139,14 +152,36 @@ find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + Specifying the System Type ========================== -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: @@ -161,7 +196,7 @@ where SYSTEM can have one of these forms: need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will +use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a @@ -172,9 +207,9 @@ eventually be run) with `--host=TYPE'. Sharing Defaults ================ -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. @@ -183,7 +218,7 @@ A warning: not all `configure' scripts look for a site script. Defining Variables ================== -Variables not defined in a site shell script can be set in the + Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set @@ -192,21 +227,29 @@ them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: +overridden in the site shell script). - /bin/bash ./configure CONFIG_SHELL=/bin/bash +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== -`configure' recognizes the following options to control how it operates. + `configure' recognizes the following options to control how it +operates. `--help' `-h' - Print a summary of the options to `configure', and exit. + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. `--version' `-V' @@ -233,5 +276,16 @@ configuration-related scripts to be executed by `/bin/bash'. Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. + diff --git a/Makefile.in b/Makefile.in index 72188bad4..dd591e15e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,6 +15,14 @@ @SET_MAKE@ +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf . +############################################################################### +# Build targets for RPM. +############################################################################### + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -761,6 +769,7 @@ uninstall-am: mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am + rpm-local: mkdir -p $(rpmbuild)/TMP && \ mkdir -p $(rpmbuild)/BUILD && \ diff --git a/autogen.sh b/autogen.sh index 728000ae4..12ed476c7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,8 +1,8 @@ #!/bin/sh -aclocal -I config && +aclocal -I config libtoolize --automake --copy -autoheader && +autoheader automake --add-missing --include-deps --copy autoconf rm -rf autom4te.cache aclocal.m4 diff --git a/cmd/Makefile.in b/cmd/Makefile.in index 7ac86e120..8caaa7d8b 100644 --- a/cmd/Makefile.in +++ b/cmd/Makefile.in @@ -15,6 +15,14 @@ @SET_MAKE@ +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf . +############################################################################### +# Common rules for user space components. +############################################################################### + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ diff --git a/cmd/spl.c b/cmd/spl.c index c9eb652e4..a77ad9ca4 100644 --- a/cmd/spl.c +++ b/cmd/spl.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) User Space Interface. +\*****************************************************************************/ #include #include diff --git a/cmd/splat.c b/cmd/splat.c index abeea15e9..c0bb7d8d4 100644 --- a/cmd/splat.c +++ b/cmd/splat.c @@ -1,30 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* Solaris Porting LAyer Tests (SPLAT) userspace interface */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) User Space Interface. +\*****************************************************************************/ #include #include @@ -834,4 +832,3 @@ out: fini(); return rc; } - diff --git a/cmd/splat.h b/cmd/splat.h index 17cc166a6..dd943124e 100644 --- a/cmd/splat.h +++ b/cmd/splat.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPLAT_H #define _SPLAT_H diff --git a/config/Rules.am b/config/Rules.am index 5eb1a12c6..7b72770b8 100644 --- a/config/Rules.am +++ b/config/Rules.am @@ -1,3 +1,11 @@ +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf . +############################################################################### +# Common rules for user space components. +############################################################################### + DEFAULT_INCLUDES = -include ${top_srcdir}/spl_config.h AM_LIBTOOLFLAGS = --silent diff --git a/config/rpm.am b/config/rpm.am index b1c832674..7fb95a72d 100644 --- a/config/rpm.am +++ b/config/rpm.am @@ -1,3 +1,11 @@ +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf . +############################################################################### +# Build targets for RPM. +############################################################################### + rpm-local: mkdir -p $(rpmbuild)/TMP && \ mkdir -p $(rpmbuild)/BUILD && \ diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 0b387418e..a0fdb3e82 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -1,6 +1,11 @@ -dnl # -dnl # Default SPL kernel configuration -dnl # +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf . +############################################################################### +# SPL_AC_CONFIG_KERNEL: Default SPL kernel configuration. +############################################################################### + AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_KERNEL diff --git a/config/spl-meta.m4 b/config/spl-meta.m4 index 84b41757d..b76cc8dc6 100644 --- a/config/spl-meta.m4 +++ b/config/spl-meta.m4 @@ -1,11 +1,10 @@ -dnl # -dnl # SPL_AC_META -dnl # Read metadata from the META file. -dnl # -dnl # AUTHOR: -dnl # Chris Dunlap -dnl # Brian Behlendorf -dnl # +############################################################################### +# Written by Chris Dunlap . +# Modified by Brian Behlendorf . +############################################################################### +# SPL_AC_META: Read metadata from the META file. +############################################################################### + AC_DEFUN([SPL_AC_META], [ AC_MSG_CHECKING([metadata]) diff --git a/configure.ac b/configure.ac index 0fa9ebf90..0217e9cd9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick - * UCRL-CODE-235197 - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ +############################################################################### +# SPL AutoConf Configuration +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). +# Written by Brian Behlendorf . +# UCRL-CODE-235197 +# +# This file is part of the SPL, Solaris Porting Layer. +# For details, see . +# +# The SPL is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# The SPL is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with the SPL. If not, see . +############################################################################### AC_INIT AC_LANG(C) diff --git a/include/fs/fs_subr.h b/include/fs/fs_subr.h index 2a7307638..39499b532 100644 --- a/include/fs/fs_subr.h +++ b/include/fs/fs_subr.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_FS_FS_SUBR_H #define _SPL_FS_FS_SUBR_H diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h index 8e1e25809..d466e0718 100644 --- a/include/linux/bitops_compat.h +++ b/include/linux/bitops_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_BITOPS_COMPAT_H #define _SPL_BITOPS_COMPAT_H diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h index c63be0348..d30e90356 100644 --- a/include/linux/file_compat.h +++ b/include/linux/file_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_FILE_COMPAT_H #define _SPL_FILE_COMPAT_H diff --git a/include/linux/kallsyms_compat.h b/include/linux/kallsyms_compat.h index 6cd0a18de..34c45ea3a 100644 --- a/include/linux/kallsyms_compat.h +++ b/include/linux/kallsyms_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_KALLSYMS_COMPAT_H #define _SPL_KALLSYMS_COMPAT_H diff --git a/include/linux/list_compat.h b/include/linux/list_compat.h index e5daa0410..26d5dfe07 100644 --- a/include/linux/list_compat.h +++ b/include/linux/list_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_LIST_COMPAT_H #define _SPL_LIST_COMPAT_H diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h index c99027b44..57f83dcc9 100644 --- a/include/linux/mm_compat.h +++ b/include/linux/mm_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MM_COMPAT_H #define _SPL_MM_COMPAT_H diff --git a/include/linux/module_compat.h b/include/linux/module_compat.h index 766cb58ea..0261f6958 100644 --- a/include/linux/module_compat.h +++ b/include/linux/module_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MODULE_COMPAT_H #define _SPL_MODULE_COMPAT_H diff --git a/include/linux/mutex_compat.h b/include/linux/mutex_compat.h index 49072405e..39eb68c34 100644 --- a/include/linux/mutex_compat.h +++ b/include/linux/mutex_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MUTEX_COMPAT_H #define _SPL_MUTEX_COMPAT_H diff --git a/include/linux/smp_compat.h b/include/linux/smp_compat.h index 4da35f4ad..31d42f909 100644 --- a/include/linux/smp_compat.h +++ b/include/linux/smp_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SMP_COMPAT_H #define _SPL_SMP_COMPAT_H diff --git a/include/linux/sysctl_compat.h b/include/linux/sysctl_compat.h index ecc5d1999..93210e829 100644 --- a/include/linux/sysctl_compat.h +++ b/include/linux/sysctl_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SYSCTL_COMPAT_H #define _SPL_SYSCTL_COMPAT_H @@ -23,34 +47,34 @@ #define SPL_PROC_HANDLER(proc_handler) \ static int \ proc_handler(struct ctl_table *table, int write, \ - void __user *buffer, size_t *lenp, loff_t *ppos) - + void __user *buffer, size_t *lenp, loff_t *ppos) + #define spl_proc_dostring(table, write, filp, buffer, lenp, ppos) \ - proc_dostring(table, write, buffer, lenp, ppos) + proc_dostring(table, write, buffer, lenp, ppos) #define spl_proc_dointvec(table, write, filp, buffer, lenp, ppos) \ - proc_dointvec(table, write, buffer, lenp, ppos) + proc_dointvec(table, write, buffer, lenp, ppos) #define spl_proc_dointvec_minmax(table, write, filp, buffer, lenp, ppos) \ - proc_dointvec_minmax(table, write, buffer, lenp, ppos) + proc_dointvec_minmax(table, write, buffer, lenp, ppos) #define spl_proc_dointvec_jiffies(table, write, filp, buffer, lenp, ppos) \ - proc_dointvec_jiffies(table, write, buffer, lenp, ppos) + proc_dointvec_jiffies(table, write, buffer, lenp, ppos) #define spl_proc_dointvec_userhz_jiffies(table,write,filp,buffer,lenp,ppos) \ - proc_dointvec_userhz_jiffies(table, write, buffer, lenp, ppos) + proc_dointvec_userhz_jiffies(table, write, buffer, lenp, ppos) #define spl_proc_dointvec_ms_jiffies(table,write,filp,buffer,lenp,ppos) \ - proc_dointvec_ms_jiffies(table, write, buffer, lenp, ppos) -#define spl_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos) \ + proc_dointvec_ms_jiffies(table, write, buffer, lenp, ppos) +#define spl_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos) \ proc_doulongvec_minmax(table, write, buffer, lenp, ppos) -#define spl_proc_doulongvec_ms_jiffies_minmax(table,write,filp,buffer,lenp,ppos) \ +#define spl_proc_doulongvec_ms_jiffies_minmax(table,write,filp,buffer,lenp,ppos)\ proc_doulongvec_ms_jiffies_minmax(table, write, buffer, lenp, ppos) - -#else /* HAVE_5ARGS_PROC_HANDLER */ - + +#else /* HAVE_5ARGS_PROC_HANDLER */ + #define SPL_PROC_HANDLER(proc_handler) \ static int \ proc_handler(struct ctl_table *table, int write, struct file *filp, \ - void __user *buffer, size_t *lenp, loff_t *ppos) - + void __user *buffer, size_t *lenp, loff_t *ppos) + #define spl_proc_dostring(table, write, filp, buffer, lenp, ppos) \ - proc_dostring(table, write, filp, buffer, lenp, ppos) + proc_dostring(table, write, filp, buffer, lenp, ppos) #define spl_proc_dointvec(table, write, filp, buffer, lenp, ppos) \ proc_dointvec(table, write, filp, buffer, lenp, ppos) #define spl_proc_dointvec_minmax(table, write, filp, buffer, lenp, ppos) \ diff --git a/include/linux/time_compat.h b/include/linux/time_compat.h index 1b4727dcd..fa996d346 100644 --- a/include/linux/time_compat.h +++ b/include/linux/time_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_TIME_COMPAT_H #define _SPL_TIME_COMPAT_H diff --git a/include/linux/uaccess_compat.h b/include/linux/uaccess_compat.h index a1bfa52a5..c00669a57 100644 --- a/include/linux/uaccess_compat.h +++ b/include/linux/uaccess_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_UACCESS_COMPAT_H #define _SPL_UACCESS_COMPAT_H diff --git a/include/linux/workqueue_compat.h b/include/linux/workqueue_compat.h index 3dab8776a..a92800ce5 100644 --- a/include/linux/workqueue_compat.h +++ b/include/linux/workqueue_compat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_WORKQUEUE_COMPAT_H #define _SPL_WORKQUEUE_COMPAT_H diff --git a/include/rpc/types.h b/include/rpc/types.h index e73fd9c05..137a381dc 100644 --- a/include/rpc/types.h +++ b/include/rpc/types.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_RPC_TYPES_H #define _SPL_RPC_TYPES_H diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index 43919ca25..c828a38e3 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -1,22 +1,23 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * +/*****************************************************************************\ * Copyright (c) 2008 Sun Microsystems, Inc. + * Written by Ricardo Correia * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_RPC_XDR_H #define _SPL_RPC_XDR_H diff --git a/include/sharefs/share.h b/include/sharefs/share.h index f7c649c70..b3ad6993f 100644 --- a/include/sharefs/share.h +++ b/include/sharefs/share.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SHARE_H #define _SPL_SHARE_H diff --git a/include/spl-ctl.h b/include/spl-ctl.h index 9cc8ab86a..9db139073 100644 --- a/include/spl-ctl.h +++ b/include/spl-ctl.h @@ -1,36 +1,34 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _DEBUG_CTL_H #define _DEBUG_CTL_H -/* Contains shared definitions which both the userspace - * and kernelspace portions of splat must agree on. +/* + * Contains shared definitions which both the user space + * and kernel space portions of splat must agree on. */ - typedef struct spl_debug_header { int ph_len; int ph_flags; diff --git a/include/spl-device.h b/include/spl-device.h index d8c2d09ba..6c3789cd7 100644 --- a/include/spl-device.h +++ b/include/spl-device.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DEVICE_H #define _SPL_DEVICE_H diff --git a/include/splat-ctl.h b/include/splat-ctl.h index fc68395e8..61c7e0e3c 100644 --- a/include/splat-ctl.h +++ b/include/splat-ctl.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPLAT_CTL_H #define _SPLAT_CTL_H diff --git a/include/strings.h b/include/strings.h index 697ac4db6..65ee3e7c3 100644 --- a/include/strings.h +++ b/include/strings.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_STRINGS_H #define _SPL_STRINGS_H diff --git a/include/sys/acl.h b/include/sys/acl.h index 61b5bdf07..7b49b0bc2 100644 --- a/include/sys/acl.h +++ b/include/sys/acl.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ACL_H #define _SPL_ACL_H diff --git a/include/sys/acl_impl.h b/include/sys/acl_impl.h index 0c8698cbd..9bc45ff96 100644 --- a/include/sys/acl_impl.h +++ b/include/sys/acl_impl.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ACL_IMPL_H #define _SPL_ACL_IMPL_H diff --git a/include/sys/atomic.h b/include/sys/atomic.h index f522781fc..699f4456e 100644 --- a/include/sys/atomic.h +++ b/include/sys/atomic.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_ATOMIC_H #define _SPL_ATOMIC_H diff --git a/include/sys/attr.h b/include/sys/attr.h index 47469ced6..42f21cfeb 100644 --- a/include/sys/attr.h +++ b/include/sys/attr.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ATTR_H #define _SPL_ATTR_H diff --git a/include/sys/bitmap.h b/include/sys/bitmap.h index 1bf09e66c..85dcb2e3b 100644 --- a/include/sys/bitmap.h +++ b/include/sys/bitmap.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_BITMAP_H #define _SPL_BITMAP_H diff --git a/include/sys/bootconf.h b/include/sys/bootconf.h index 29c885a08..b9d40527c 100644 --- a/include/sys/bootconf.h +++ b/include/sys/bootconf.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_BOOTCONF_H #define _SPL_BOOTCONF_H diff --git a/include/sys/buf.h b/include/sys/buf.h index b6627301f..b1ffa479c 100644 --- a/include/sys/buf.h +++ b/include/sys/buf.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_BUF_H #define _SPL_BUF_H diff --git a/include/sys/byteorder.h b/include/sys/byteorder.h index 7e7d04809..30700f6b3 100644 --- a/include/sys/byteorder.h +++ b/include/sys/byteorder.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_BYTEORDER_H #define _SPL_BYTEORDER_H diff --git a/include/sys/callb.h b/include/sys/callb.h index b37bb278a..9db823650 100644 --- a/include/sys/callb.h +++ b/include/sys/callb.h @@ -1,10 +1,30 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CALLB_H #define _SPL_CALLB_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -31,9 +51,5 @@ typedef struct callb_cpr { mutex_exit((cp)->cc_lockp); \ } -#ifdef __cplusplus -} -#endif - #endif /* _SPL_CALLB_H */ diff --git a/include/sys/cmn_err.h b/include/sys/cmn_err.h index 62417e83e..9359c1a3b 100644 --- a/include/sys/cmn_err.h +++ b/include/sys/cmn_err.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CMN_ERR_H #define _SPL_CMN_ERR_H diff --git a/include/sys/compress.h b/include/sys/compress.h index a12f6784c..8095cff9c 100644 --- a/include/sys/compress.h +++ b/include/sys/compress.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_COMPRESS_H #define _SPL_COMPRESS_H diff --git a/include/sys/condvar.h b/include/sys/condvar.h index bf1347b0f..d854026ac 100644 --- a/include/sys/condvar.h +++ b/include/sys/condvar.h @@ -1,42 +1,37 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_CONDVAR_H #define _SPL_CONDVAR_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include #include -/* The kcondvar_t struct is protected by mutex taken externally before +/* + * The kcondvar_t struct is protected by mutex taken externally before * calling any of the wait/signal funs, and passed into the wait funs. */ #define CV_MAGIC 0x346545f4 diff --git a/include/sys/conf.h b/include/sys/conf.h index 4166b0c23..bca0ebf05 100644 --- a/include/sys/conf.h +++ b/include/sys/conf.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CONF_H #define _SPL_CONF_H diff --git a/include/sys/console.h b/include/sys/console.h index eff52916c..31d419923 100644 --- a/include/sys/console.h +++ b/include/sys/console.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CONSOLE_H #define _SPL_CONSOLE_H diff --git a/include/sys/cpuvar.h b/include/sys/cpuvar.h index 56ad7a41e..ca5a8b0a0 100644 --- a/include/sys/cpuvar.h +++ b/include/sys/cpuvar.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CPUVAR_H #define _SPL_CPUVAR_H diff --git a/include/sys/crc32.h b/include/sys/crc32.h index b80157965..000a1dca5 100644 --- a/include/sys/crc32.h +++ b/include/sys/crc32.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CRC32_H #define _SPL_CRC32_H diff --git a/include/sys/cred.h b/include/sys/cred.h index 9717b66bc..6f4cde73c 100644 --- a/include/sys/cred.h +++ b/include/sys/cred.h @@ -1,10 +1,30 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CRED_H #define _SPL_CRED_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -37,8 +57,4 @@ extern int crgetngroups(const cred_t *cr); extern gid_t * crgetgroups(const cred_t *cr); extern int groupmember(gid_t gid, const cred_t *cr); -#ifdef __cplusplus -} -#endif - #endif /* _SPL_CRED_H */ diff --git a/include/sys/ctype.h b/include/sys/ctype.h index 93c76a17e..7ec2bc7fa 100644 --- a/include/sys/ctype.h +++ b/include/sys/ctype.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_CTYPE_H #define _SPL_CTYPE_H diff --git a/include/sys/ddi.h b/include/sys/ddi.h index 186aa5ed2..903b1dd13 100644 --- a/include/sys/ddi.h +++ b/include/sys/ddi.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DDI_H #define _SPL_DDI_H diff --git a/include/sys/debug.h b/include/sys/debug.h index 639b4cc28..848c885a6 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_DEBUG_H #define _SPL_DEBUG_H -#ifdef __cplusplus -extern "C" { -#endif - #include /* THREAD_SIZE */ #include @@ -444,8 +438,4 @@ extern void spl_debug_bug(char *file, const char *func, const int line, int flag extern int spl_debug_clear_buffer(void); extern int spl_debug_mark_buffer(char *text); -#ifdef __cplusplus -} -#endif - #endif /* SPL_DEBUG_H */ diff --git a/include/sys/dirent.h b/include/sys/dirent.h index ac4c701bb..b99542e85 100644 --- a/include/sys/dirent.h +++ b/include/sys/dirent.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DIRENT_H #define _SPL_DIRENT_H diff --git a/include/sys/disp.h b/include/sys/disp.h index 7ff9e3ba3..a0a1b0957 100644 --- a/include/sys/disp.h +++ b/include/sys/disp.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DISP_H #define _SPL_DISP_H diff --git a/include/sys/dkio.h b/include/sys/dkio.h index efe7fa270..0659e9082 100644 --- a/include/sys/dkio.h +++ b/include/sys/dkio.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DKIO_H #define _SPL_DKIO_H diff --git a/include/sys/dklabel.h b/include/sys/dklabel.h index df6bc4791..bd42622d1 100644 --- a/include/sys/dklabel.h +++ b/include/sys/dklabel.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DKLABEL_H #define _SPL_DKLABEL_H diff --git a/include/sys/dnlc.h b/include/sys/dnlc.h index 38f8dd6b1..693e3d294 100644 --- a/include/sys/dnlc.h +++ b/include/sys/dnlc.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DNLC_H #define _SPL_DNLC_H diff --git a/include/sys/dumphdr.h b/include/sys/dumphdr.h index fe4087317..07396e2e6 100644 --- a/include/sys/dumphdr.h +++ b/include/sys/dumphdr.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_DUMPHDR_H #define _SPL_DUMPHDR_H diff --git a/include/sys/efi_partition.h b/include/sys/efi_partition.h index 369062301..75df64f92 100644 --- a/include/sys/efi_partition.h +++ b/include/sys/efi_partition.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_EFI_PARTITION_H #define _SPL_EFI_PARTITION_H diff --git a/include/sys/errno.h b/include/sys/errno.h index f33fe8682..e6b446803 100644 --- a/include/sys/errno.h +++ b/include/sys/errno.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ERRNO_H #define _SPL_ERRNO_H diff --git a/include/sys/file.h b/include/sys/file.h index f5ee2f0df..4fee255fd 100644 --- a/include/sys/file.h +++ b/include/sys/file.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_FILE_H #define _SPL_FILE_H diff --git a/include/sys/fm/protocol.h b/include/sys/fm/protocol.h index ffd8108ba..8c47f7c9b 100644 --- a/include/sys/fm/protocol.h +++ b/include/sys/fm/protocol.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_FM_PROTOCOL_H #define _SPL_FM_PROTOCOL_H diff --git a/include/sys/fm/util.h b/include/sys/fm/util.h index 6c3412f5b..40b8d47b2 100644 --- a/include/sys/fm/util.h +++ b/include/sys/fm/util.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_FM_UTIL_H #define _SPL_FM_UTIL_H diff --git a/include/sys/fs/swapnode.h b/include/sys/fs/swapnode.h index 12f2137a3..31be71620 100644 --- a/include/sys/fs/swapnode.h +++ b/include/sys/fs/swapnode.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SWAPNODE_H #define _SPL_SWAPNODE_H diff --git a/include/sys/int_limits.h b/include/sys/int_limits.h index 13193e6f1..ed4ad9d19 100644 --- a/include/sys/int_limits.h +++ b/include/sys/int_limits.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_INT_LIMITS_H #define _SPL_INT_LIMITS_H diff --git a/include/sys/int_types.h b/include/sys/int_types.h index a30a8cc44..c97f47f6b 100644 --- a/include/sys/int_types.h +++ b/include/sys/int_types.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_INT_TYPES_H #define _SPL_INT_TYPES_H diff --git a/include/sys/inttypes.h b/include/sys/inttypes.h index ff7a65a98..6f7020134 100644 --- a/include/sys/inttypes.h +++ b/include/sys/inttypes.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_INTTYPES_H #define _SPL_INTTYPES_H diff --git a/include/sys/isa_defs.h b/include/sys/isa_defs.h index 081133e5a..10c0e0d3d 100644 --- a/include/sys/isa_defs.h +++ b/include/sys/isa_defs.h @@ -1,10 +1,30 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ISA_DEFS_H #define _SPL_ISA_DEFS_H -#ifdef __cplusplus -extern "C" { -#endif - /* x86_64 arch specific defines */ #if defined(__x86_64) || defined(__x86_64__) @@ -80,8 +100,4 @@ extern "C" { #error "Neither _LITTLE_ENDIAN or _BIG_ENDIAN are defined" #endif -#ifdef __cplusplus -} -#endif - #endif /* _SPL_ISA_DEFS_H */ diff --git a/include/sys/kidmap.h b/include/sys/kidmap.h index d1c8d913f..f77656738 100644 --- a/include/sys/kidmap.h +++ b/include/sys/kidmap.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_KIDMAP_H #define _SPL_KIDMAP_H diff --git a/include/sys/kmem.h b/include/sys/kmem.h index f40d0813d..257f2d856 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_KMEM_H #define _SPL_KMEM_H -#ifdef __cplusplus -extern "C" { -#endif - #undef DEBUG_KMEM_UNIMPLEMENTED #include @@ -411,8 +405,4 @@ void spl_kmem_fini(void); #define kmem_virt(ptr) (((ptr) >= (void *)VMALLOC_START) && \ ((ptr) < (void *)VMALLOC_END)) -#ifdef __cplusplus -} -#endif - #endif /* _SPL_KMEM_H */ diff --git a/include/sys/kobj.h b/include/sys/kobj.h index 8d79a0fbf..b682e3f9d 100644 --- a/include/sys/kobj.h +++ b/include/sys/kobj.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_KOBJ_H #define _SPL_KOBJ_H -#ifdef __cplusplus -extern "C" { -#endif - #include typedef struct _buf { @@ -45,8 +39,4 @@ extern int kobj_read_file(struct _buf *file, char *buf, ssize_t size, offset_t off); extern int kobj_get_filesize(struct _buf *file, uint64_t *size); -#ifdef __cplusplus -} -#endif - #endif /* SPL_KOBJ_H */ diff --git a/include/sys/kstat.h b/include/sys/kstat.h index 362bae286..6595f0a8b 100644 --- a/include/sys/kstat.h +++ b/include/sys/kstat.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_KSTAT_H #define _SPL_KSTAT_H @@ -163,4 +161,3 @@ extern void __kstat_delete(kstat_t *ksp); #define kstat_delete(k) __kstat_delete(k) #endif /* _SPL_KSTAT_H */ - diff --git a/include/sys/list.h b/include/sys/list.h index faf7c7a45..e30d7b7e0 100644 --- a/include/sys/list.h +++ b/include/sys/list.h @@ -1,10 +1,35 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_LIST_H #define _SPL_LIST_H #include #include -/* NOTE: We have implemented the Solaris list API in terms of the native +/* + * NOTE: I have implemented the Solaris list API in terms of the native * linux API. This has certain advantages in terms of leveraging the linux * list debugging infrastructure, but it also means that the internals of a * list differ slightly than on Solaris. This is not a problem as long as diff --git a/include/sys/mkdev.h b/include/sys/mkdev.h index f92ad08fa..89a9000d4 100644 --- a/include/sys/mkdev.h +++ b/include/sys/mkdev.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MKDEV_H #define _SPL_MKDEV_H diff --git a/include/sys/mntent.h b/include/sys/mntent.h index b124e342b..5f0565f4c 100644 --- a/include/sys/mntent.h +++ b/include/sys/mntent.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MNTENT_H #define _SPL_MNTENT_H diff --git a/include/sys/modctl.h b/include/sys/modctl.h index 85f936915..52f679ad5 100644 --- a/include/sys/modctl.h +++ b/include/sys/modctl.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MODCTL_H #define _SPL_MODCTL_H diff --git a/include/sys/mode.h b/include/sys/mode.h index 7ca1b4889..f3d890944 100644 --- a/include/sys/mode.h +++ b/include/sys/mode.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MODE_H #define _SPL_MODE_H diff --git a/include/sys/mount.h b/include/sys/mount.h index 435dd44c4..5b33a6d3a 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_MOUNT_H #define _SPL_MOUNT_H diff --git a/include/sys/mutex.h b/include/sys/mutex.h index 1eedd4565..b36c7e256 100644 --- a/include/sys/mutex.h +++ b/include/sys/mutex.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2009 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_MUTEX_H #define _SPL_MUTEX_H diff --git a/include/sys/note.h b/include/sys/note.h index 835d1d5ad..6fcffc22e 100644 --- a/include/sys/note.h +++ b/include/sys/note.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_NOTE_H #define _SPL_NOTE_H diff --git a/include/sys/open.h b/include/sys/open.h index eba9fa7d7..aafedd0a1 100644 --- a/include/sys/open.h +++ b/include/sys/open.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_OPEN_H #define _SPL_OPEN_H diff --git a/include/sys/param.h b/include/sys/param.h index dbcdb6e9c..be3dd4bf3 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_PARAM_H #define _SPL_PARAM_H diff --git a/include/sys/pathname.h b/include/sys/pathname.h index ffdf585b8..d22c4f297 100644 --- a/include/sys/pathname.h +++ b/include/sys/pathname.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_PATHNAME_H #define _SPL_PATHNAME_H diff --git a/include/sys/policy.h b/include/sys/policy.h index f6467fe18..2224c41a6 100644 --- a/include/sys/policy.h +++ b/include/sys/policy.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_POLICY_H #define _SPL_POLICY_H diff --git a/include/sys/proc.h b/include/sys/proc.h index 2938414b7..64b26bb3f 100644 --- a/include/sys/proc.h +++ b/include/sys/proc.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_PROC_H #define _SPL_PROC_H diff --git a/include/sys/processor.h b/include/sys/processor.h index 65285868a..65438a4da 100644 --- a/include/sys/processor.h +++ b/include/sys/processor.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_PROCESSOR_H #define _SPL_PROCESSOR_H diff --git a/include/sys/random.h b/include/sys/random.h index 2e206ccae..8960240b1 100644 --- a/include/sys/random.h +++ b/include/sys/random.h @@ -1,45 +1,33 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_RANDOM_H #define _SPL_RANDOM_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include -/* FIXME: - * Should add support for blocking in the future to - * ensure that proper entopy is collected. ZFS doesn't - * use it at the moment so this is good enough for now. - * Always will succeed by returning 0. - */ static __inline__ int random_get_bytes(uint8_t *ptr, size_t len) { @@ -47,7 +35,6 @@ random_get_bytes(uint8_t *ptr, size_t len) return 0; } - /* Always will succeed by returning 0. */ static __inline__ int random_get_pseudo_bytes(uint8_t *ptr, size_t len) { @@ -55,8 +42,4 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len) return 0; } -#ifdef __cplusplus -} -#endif - #endif /* _SPL_RANDOM_H */ diff --git a/include/sys/refstr.h b/include/sys/refstr.h index 041ea23af..a8d0edbfe 100644 --- a/include/sys/refstr.h +++ b/include/sys/refstr.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_REFSTR_H #define _SPL_REFSTR_H diff --git a/include/sys/resource.h b/include/sys/resource.h index 6488794ff..68e3d2500 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_RESOURCE_H #define _SPL_RESOURCE_H diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index 0fc8d24f7..9c4fb7e0f 100644 --- a/include/sys/rwlock.h +++ b/include/sys/rwlock.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2009 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_RWLOCK_H #define _SPL_RWLOCK_H diff --git a/include/sys/sdt.h b/include/sys/sdt.h index 1f94f4a1d..ed4680df9 100644 --- a/include/sys/sdt.h +++ b/include/sys/sdt.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SDT_H #define _SPL_SDT_H diff --git a/include/sys/sid.h b/include/sys/sid.h index f798d24a8..9d4c7192b 100644 --- a/include/sys/sid.h +++ b/include/sys/sid.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SID_H #define _SPL_SID_H diff --git a/include/sys/signal.h b/include/sys/signal.h index 4b1e82115..c7e293968 100644 --- a/include/sys/signal.h +++ b/include/sys/signal.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_SIGNAL_H #define _SPL_SIGNAL_H diff --git a/include/sys/stat.h b/include/sys/stat.h index 7f67064ba..ccc01a025 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_STAT_H #define _SPL_STAT_H diff --git a/include/sys/stropts.h b/include/sys/stropts.h index b92949fee..ae20c4d70 100644 --- a/include/sys/stropts.h +++ b/include/sys/stropts.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_STROPTS_H #define _SPL_STROPTS_H diff --git a/include/sys/sunddi.h b/include/sys/sunddi.h index c1773f504..c48066b9c 100644 --- a/include/sys/sunddi.h +++ b/include/sys/sunddi.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_SUNDDI_H #define _SPL_SUNDDI_H diff --git a/include/sys/sunldi.h b/include/sys/sunldi.h index 97952ad2f..a1a6a12c2 100644 --- a/include/sys/sunldi.h +++ b/include/sys/sunldi.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_SUNLDI_H #define _SPL_SUNLDI_H diff --git a/include/sys/sysevent.h b/include/sys/sysevent.h index 45c960846..723220f0f 100644 --- a/include/sys/sysevent.h +++ b/include/sys/sysevent.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SYSEVENT_H #define _SPL_SYSEVENT_H diff --git a/include/sys/sysevent/eventdefs.h b/include/sys/sysevent/eventdefs.h index d7b28f62b..2112e29ed 100644 --- a/include/sys/sysevent/eventdefs.h +++ b/include/sys/sysevent/eventdefs.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SYSEVENT_EVENTDEFS_H #define _SPL_SYSEVENT_EVENTDEFS_H diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 4ed41d4c5..f76c6dd7f 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_SYSMACROS_H #define _SPL_SYSMACROS_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -41,8 +35,6 @@ extern "C" { #define _KERNEL __KERNEL__ #endif -/* Missing defines. - */ #define FALSE 0 #define TRUE 1 @@ -214,8 +206,4 @@ extern void spl_cleanup(void); #define offsetof(s, m) ((size_t)(&(((s *)0)->m))) #endif -#ifdef __cplusplus -} -#endif - #endif /* _SPL_SYSMACROS_H */ diff --git a/include/sys/systeminfo.h b/include/sys/systeminfo.h index 0e8934554..592d71584 100644 --- a/include/sys/systeminfo.h +++ b/include/sys/systeminfo.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SYSTEMINFO_H #define _SPL_SYSTEMINFO_H diff --git a/include/sys/systm.h b/include/sys/systm.h index 68bd9badf..f3e310a13 100644 --- a/include/sys/systm.h +++ b/include/sys/systm.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SYSTM_H #define _SPL_SYSTM_H diff --git a/include/sys/t_lock.h b/include/sys/t_lock.h index 0e7d8ae9e..1055f7f6a 100644 --- a/include/sys/t_lock.h +++ b/include/sys/t_lock.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_T_LOCK_H #define _SPL_T_LOCK_H diff --git a/include/sys/taskq.h b/include/sys/taskq.h index 603fde680..d8578499b 100644 --- a/include/sys/taskq.h +++ b/include/sys/taskq.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_TASKQ_H #define _SPL_TASKQ_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -102,8 +96,4 @@ void spl_taskq_fini(void); #define taskq_create(n, th, p, mi, ma, fl) __taskq_create(n, th, p, mi, ma, fl) #define taskq_destroy(tq) __taskq_destroy(tq) -#ifdef __cplusplus -} -#endif - #endif /* _SPL_TASKQ_H */ diff --git a/include/sys/thread.h b/include/sys/thread.h index 745f93e2b..4cad648df 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_THREAD_H #define _SPL_THREAD_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -67,9 +61,5 @@ extern kthread_t *__thread_create(caddr_t stk, size_t stksize, int state, pri_t pri); extern void __thread_exit(void); -#ifdef __cplusplus -} -#endif - #endif /* _SPL_THREAD_H */ diff --git a/include/sys/time.h b/include/sys/time.h index 5b263f82c..e4470a491 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_TIME_H #define _SPL_TIME_H @@ -31,11 +29,6 @@ * Structure returned by gettimeofday(2) system call, * and used in other calls. */ - -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -89,8 +82,4 @@ gethrestime_sec(void) return now.tv_sec; } -#ifdef __cplusplus -} -#endif - #endif /* _SPL_TIME_H */ diff --git a/include/sys/timer.h b/include/sys/timer.h index b7aff1184..3af57d8f5 100644 --- a/include/sys/timer.h +++ b/include/sys/timer.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_TIMER_H #define _SPL_TIMER_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -40,9 +34,5 @@ extern "C" { #define delay(ticks) schedule_timeout((long)(ticks)) -#ifdef __cplusplus -} -#endif - #endif /* _SPL_TIMER_H */ diff --git a/include/sys/types.h b/include/sys/types.h index 2804974dd..498abdff4 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -1,10 +1,30 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_TYPES_H #define _SPL_TYPES_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include diff --git a/include/sys/types32.h b/include/sys/types32.h index 290da02f3..25c4642dc 100644 --- a/include/sys/types32.h +++ b/include/sys/types32.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_TYPES32_H #define _SPL_TYPES32_H diff --git a/include/sys/u8_textprep.h b/include/sys/u8_textprep.h index e659548e3..456077c6f 100644 --- a/include/sys/u8_textprep.h +++ b/include/sys/u8_textprep.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_U8_TEXTPREP_H #define _SPL_U8_TEXTPREP_H diff --git a/include/sys/uio.h b/include/sys/uio.h index 0ef7aab63..83e9cc62a 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_UIO_H #define _SPL_UIO_H @@ -32,15 +56,4 @@ typedef struct aio_req { void *aio_private; } aio_req_t; -/* XXX: Must be fully implemented when ZVOL is needed, for reference: - * http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/move.c - */ -#if 0 -static __inline__ int -uiomove(void *p, size_t n, enum uio_rw rw, struct uio *uio) -{ - return 0; -} -#endif - #endif /* SPL_UIO_H */ diff --git a/include/sys/unistd.h b/include/sys/unistd.h index c6b298a34..a2acfa705 100644 --- a/include/sys/unistd.h +++ b/include/sys/unistd.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_UNISTD_H #define _SPL_UNISTD_H diff --git a/include/sys/utsname.h b/include/sys/utsname.h index d4b9dc8ae..fa403ff52 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_UTSNAME_H #define _SPL_UTSNAME_H diff --git a/include/sys/va_list.h b/include/sys/va_list.h index 6eb763ff9..644812881 100644 --- a/include/sys/va_list.h +++ b/include/sys/va_list.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_VA_LIST_H #define _SPL_VA_LIST_H diff --git a/include/sys/varargs.h b/include/sys/varargs.h index 056967eaa..b74570c21 100644 --- a/include/sys/varargs.h +++ b/include/sys/varargs.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_VARARGS_H #define _SPL_VARARGS_H diff --git a/include/sys/vfs.h b/include/sys/vfs.h index 0b968faa5..b18c90928 100644 --- a/include/sys/vfs.h +++ b/include/sys/vfs.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ZFS_H #define _SPL_ZFS_H diff --git a/include/sys/vfs_opreg.h b/include/sys/vfs_opreg.h index 8f3f556cb..5dda4d36b 100644 --- a/include/sys/vfs_opreg.h +++ b/include/sys/vfs_opreg.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_OPREG_H #define _SPL_OPREG_H diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index 1c367d7cd..b8191f3ac 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_VMSYSTM_H #define _SPL_VMSYSTM_H diff --git a/include/sys/vnode.h b/include/sys/vnode.h index 9568a1392..d3a74a738 100644 --- a/include/sys/vnode.h +++ b/include/sys/vnode.h @@ -1,36 +1,30 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPL_VNODE_H #define _SPL_VNODE_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -245,8 +239,4 @@ vn_putpage(vnode_t *vp, offset_t off, ssize_t size, extern vnode_t *rootdir; -#ifdef __cplusplus -} -#endif - #endif /* SPL_VNODE_H */ diff --git a/include/sys/zmod.h b/include/sys/zmod.h index bc901b346..f1a63174a 100644 --- a/include/sys/zmod.h +++ b/include/sys/zmod.h @@ -1,42 +1,63 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * z_compress_level/z_uncompress are nearly identical copies of the + * compress2/uncompress functions provided by the official zlib package + * available at http://zlib.net/. The only changes made we to slightly + * adapt the functions called to match the linux kernel implementation + * of zlib. The full zlib license follows: + * + * zlib.h -- interface of the 'zlib' general purpose compression library + * version 1.2.5, April 19th, 2010 + * + * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + * Jean-loup Gailly + * Mark Adler +\*****************************************************************************/ #ifndef _SPL_ZMOD_H #define _SPL_ZMOD_H #include -/* NOTE: z_compress_level/z_uncompress are nearly identical copies of - * the compress2/uncompress functions provided by the official zlib - * package available at http://zlib.net/. The only changes made we to - * slightly adapt the functioned called to match the linux kernel - * implementation of zlib. - */ - -/* =========================================================================== +/* * Compresses the source buffer into the destination buffer. The level * parameter has the same meaning as in deflateInit. sourceLen is the byte * length of the source buffer. Upon entry, destLen is the total size of the @@ -82,7 +103,7 @@ z_compress_level(void *dest, size_t *destLen, const void *source, return err; } /* z_compress_level() */ -/* =========================================================================== +/* * Decompresses the source buffer into the destination buffer. sourceLen is * the byte length of the source buffer. Upon entry, destLen is the total * size of the destination buffer, which must be large enough to hold the diff --git a/include/sys/zone.h b/include/sys/zone.h index d3dd73794..9c2652fd2 100644 --- a/include/sys/zone.h +++ b/include/sys/zone.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_ZONE_H #define _SPL_ZONE_H diff --git a/include/unistd.h b/include/unistd.h index c6b298a34..a2acfa705 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_UNISTD_H #define _SPL_UNISTD_H diff --git a/include/util/qsort.h b/include/util/qsort.h index f7bb26847..890674acd 100644 --- a/include/util/qsort.h +++ b/include/util/qsort.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_QSORT_H #define _SPL_QSORT_H diff --git a/include/vm/anon.h b/include/vm/anon.h index 0198e729e..51e8512ba 100644 --- a/include/vm/anon.h +++ b/include/vm/anon.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_VM_ANON_H #define _SPL_VM_ANON_H diff --git a/include/vm/pvn.h b/include/vm/pvn.h index e89ee1748..c206b1b77 100644 --- a/include/vm/pvn.h +++ b/include/vm/pvn.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_VM_PVN_H #define _SPL_VM_PVN_H diff --git a/include/vm/seg_kmem.h b/include/vm/seg_kmem.h index df620e73d..b21f71a52 100644 --- a/include/vm/seg_kmem.h +++ b/include/vm/seg_kmem.h @@ -1,3 +1,27 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + #ifndef _SPL_SEG_KMEM_H #define _SPL_SEG_KMEM_H diff --git a/lib/Makefile.in b/lib/Makefile.in index ed3f85b5a..9c5dfebdf 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -15,6 +15,14 @@ @SET_MAKE@ +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf . +############################################################################### +# Common rules for user space components. +############################################################################### + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ diff --git a/lib/list.c b/lib/list.c index fbee2d97d..55367e449 100644 --- a/lib/list.c +++ b/lib/list.c @@ -1,30 +1,28 @@ /***************************************************************************** - * $Id: list.c 3709 2006-11-29 00:51:22Z dun $ - ***************************************************************************** - * Copyright (C) 2001-2002 The Regents of the University of California. + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2001-2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . + * UCRL-CODE-235197 * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * - * LSD-Tools is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. + * LSD-Tools is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * * LSD-Tools is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. * * You should have received a copy of the GNU General Public License along - * with LSD-Tools; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * with LSD-Tools. If not, see . ***************************************************************************** * Refer to "list.h" for documentation on public functions. *****************************************************************************/ - #ifdef WITH_PTHREADS # include #endif /* WITH_PTHREADS */ diff --git a/lib/list.h b/lib/list.h index fe3fd006b..01adedd59 100644 --- a/lib/list.h +++ b/lib/list.h @@ -1,10 +1,10 @@ /***************************************************************************** - * $Id: list.h 2899 2002-12-11 19:00:36Z dun $ - ***************************************************************************** - * Copyright (C) 2001-2002 The Regents of the University of California. + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2001-2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . - * + * UCRL-CODE-235197 + * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools is free software; you can redistribute it and/or modify it under @@ -18,11 +18,9 @@ * more details. * * You should have received a copy of the GNU General Public License along - * with LSD-Tools; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * with LSD-Tools. If not, see . *****************************************************************************/ - #ifndef LSD_LIST_H #define LSD_LIST_H diff --git a/module/spl/spl-atomic.c b/module/spl/spl-atomic.c index decf9515e..f2dd67384 100644 --- a/module/spl/spl-atomic.c +++ b/module/spl/spl-atomic.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Atomic Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c index d5b9be721..269b0ab61 100644 --- a/module/spl/spl-condvar.c +++ b/module/spl/spl-condvar.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Credential Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-cred.c b/module/spl/spl-cred.c index 826a228dd..dd5d9da01 100644 --- a/module/spl/spl-cred.c +++ b/module/spl/spl-cred.c @@ -1,26 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2009 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Credential Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 0602a1a89..e28926c12 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -1,35 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * This file was originally part of Lustre, http://www.lustre.org. - * but has subsequently been adapted for use in the SPL in - * accordance with the GPL. - * - * Copyright (C) 2004 Cluster File Systems, Inc. - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Zach Brown - * Phil Schwan - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Debug Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index fcf701400..1d5202827 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Error Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index aaf1a4c10..29b698889 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Generic Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index d62a6f61b..ca89f6fed 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Kmem Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index e78cd9244..42a264172 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Kobj Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 53089c311..2b45549d6 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Kstat Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-module.c b/module/spl/spl-module.c index f17974873..37dd4f4c1 100644 --- a/module/spl/spl-module.c +++ b/module/spl/spl-module.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Module Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-mutex.c b/module/spl/spl-mutex.c index 0af74571d..983245dc0 100644 --- a/module/spl/spl-mutex.c +++ b/module/spl/spl-mutex.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2009 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Mutex Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 6db4664da..3bc8b40cf 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Proc Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-rwlock.c b/module/spl/spl-rwlock.c index 5120b2c81..c0f974f1b 100644 --- a/module/spl/spl-rwlock.c +++ b/module/spl/spl-rwlock.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Reader/Writer Lock Implementation. +\*****************************************************************************/ #include diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 64719d762..805749a14 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Task Queue Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index 953c5ce7f..de959119e 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Thread Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c index 6806dcf71..4c08b754d 100644 --- a/module/spl/spl-time.c +++ b/module/spl/spl-time.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Time Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index a113ecb2f..ec312aad1 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) Vnode Implementation. +\*****************************************************************************/ #include #include diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index 16e42c336..174f76f19 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -1,22 +1,25 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. +/*****************************************************************************\ + * Copyright (c) 2008-2010 Sun Microsystems, Inc. + * Written by Ricardo Correia * - * Copyright (c) 2008 Sun Microsystems, Inc. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting Layer (SPL) XDR Implementation. +\*****************************************************************************/ #include @@ -263,7 +266,7 @@ static bool_t xdrmem_enc_char(XDR *xdrs, char *cp) { uint32_t val; - + BUILD_BUG_ON(sizeof(char) != 1); val = *((unsigned char *) cp); diff --git a/module/splat/splat-atomic.c b/module/splat/splat-atomic.c index 3a651103e..9cdaa69df 100644 --- a/module/splat/splat-atomic.c +++ b/module/splat/splat-atomic.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Atomic Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-condvar.c b/module/splat/splat-condvar.c index baef871c2..ace9823c3 100644 --- a/module/splat/splat-condvar.c +++ b/module/splat/splat-condvar.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Condition Variable Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-cred.c b/module/splat/splat-cred.c index f808625e8..db36ece98 100644 --- a/module/splat/splat-cred.c +++ b/module/splat/splat-cred.c @@ -1,26 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2009 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Credential Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 36a690743..09f084710 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -1,44 +1,47 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * My intent is to create a loadable 'splat' (Solaris Porting LAyer - * Tests) module which can be used as an access point to run - * in kernel Solaris ABI regression tests. This provides a - * nice mechanism to validate the shim primates are working properly. + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Test Control Interface. * - * The basic design is the splat module is that it is constructed of - * various splat_* source files each of which contains regression tests. - * For example the splat_linux_kmem.c file contains tests for validating - * kmem correctness. When the splat module is loaded splat_*_init() - * will be called for each subsystems tests, similarly splat_*_fini() is - * called when the splat module is removed. Each test can then be - * run by making an ioctl() call from a userspace control application - * to pick the subsystem and test which should be run. - */ + * The 'splat' (Solaris Porting LAyer Tests) module is designed as a + * framework which runs various in kernel regression tests to validate + * the SPL primitives honor the Solaris ABI. + * + * The splat module is constructed of various splat_* source files each + * of which contain regression tests for a particular subsystem. For + * example, the splat_kmem.c file contains all the tests for validating + * the kmem interfaces have been implemented correctly. When the splat + * module is loaded splat_*_init() will be called for each subsystems + * tests. It is the responsibility of splat_*_init() to register all + * the tests for this subsystem using the SPLAT_TEST_INIT() macro. + * Similarly splat_*_fini() is called when the splat module is removed + * and is responsible for unregistering its tests via the SPLAT_TEST_FINI + * macro. Once a test is registered it can then be run with an ioctl() + * call which specifies the subsystem and test to be run. The provided + * splat command line tool can be used to display all available + * subsystems and tests. It can also be used to run the full suite + * of regression tests or particular tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-generic.c b/module/splat/splat-generic.c index d963e50f3..8ad6913c0 100644 --- a/module/splat/splat-generic.c +++ b/module/splat/splat-generic.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Generic Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-internal.h b/module/splat/splat-internal.h index fea78e043..ba1224fc1 100644 --- a/module/splat/splat-internal.h +++ b/module/splat/splat-internal.h @@ -1,28 +1,26 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . +\*****************************************************************************/ #ifndef _SPLAT_INTERNAL_H #define _SPLAT_INTERNAL_H diff --git a/module/splat/splat-kmem.c b/module/splat/splat-kmem.c index c743dd163..28b657c15 100644 --- a/module/splat/splat-kmem.c +++ b/module/splat/splat-kmem.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Kmem Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-kobj.c b/module/splat/splat-kobj.c index cd73a98f3..f0720dbf5 100644 --- a/module/splat/splat-kobj.c +++ b/module/splat/splat-kobj.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Kobj Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-list.c b/module/splat/splat-list.c index e68d4be33..d517e7d22 100644 --- a/module/splat/splat-list.c +++ b/module/splat/splat-list.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) List Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-mutex.c b/module/splat/splat-mutex.c index 72fa32c81..96ed27297 100644 --- a/module/splat/splat-mutex.c +++ b/module/splat/splat-mutex.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Mutex Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-random.c b/module/splat/splat-random.c index ed8f694c3..3ee580df7 100644 --- a/module/splat/splat-random.c +++ b/module/splat/splat-random.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Random Number Generator Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-rwlock.c b/module/splat/splat-rwlock.c index 13140260c..6b2ecbe82 100644 --- a/module/splat/splat-rwlock.c +++ b/module/splat/splat-rwlock.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Read/Writer Lock Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-taskq.c b/module/splat/splat-taskq.c index 9214ecf8d..ea79dfa85 100644 --- a/module/splat/splat-taskq.c +++ b/module/splat/splat-taskq.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Task Queue Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-thread.c b/module/splat/splat-thread.c index b88cecb83..d21ded795 100644 --- a/module/splat/splat-thread.c +++ b/module/splat/splat-thread.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Thread Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-time.c b/module/splat/splat-time.c index d9b62be8f..3b06b9ef2 100644 --- a/module/splat/splat-time.c +++ b/module/splat/splat-time.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Time Tests. +\*****************************************************************************/ #include "splat-internal.h" diff --git a/module/splat/splat-vnode.c b/module/splat/splat-vnode.c index 91a719b5f..1955841e2 100644 --- a/module/splat/splat-vnode.c +++ b/module/splat/splat-vnode.c @@ -1,28 +1,28 @@ -/* - * This file is part of the SPL: Solaris Porting Layer. - * - * Copyright (c) 2008 Lawrence Livermore National Security, LLC. - * Produced at Lawrence Livermore National Laboratory - * Written by: - * Brian Behlendorf , - * Herb Wartens , - * Jim Garlick +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . * UCRL-CODE-235197 * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This is distributed in the hope that it will be useful, but WITHOUT + * The SPL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ + * with the SPL. If not, see . + ***************************************************************************** + * Solaris Porting LAyer Tests (SPLAT) Vnode Tests. +\*****************************************************************************/ #include "splat-internal.h" #include diff --git a/scripts/check.sh b/scripts/check.sh index 37f77853a..712605547 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################### +# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). +# Written by Brian Behlendorf . +# UCRL-CODE-235197 +# +# This file is part of the SPL, Solaris Porting Layer. +# For details, see . +# +# The SPL is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# The SPL is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with the SPL. If not, see . +############################################################################### +# This script runs the full set of regression tests. +############################################################################### prog=check.sh spl_module=../module/spl/spl.ko -- cgit v1.2.3 From 55abb0929e4fbe326a9737650a167a1a988ad86b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 19 Jul 2010 14:16:05 -0700 Subject: Split header To avoid symbol conflicts with dependent packages the debug header must be split in to several parts. The header now only contains the Solaris macro's such as ASSERT and VERIFY. The spl-debug.h header contain the spl specific debugging infrastructure and should be included by any package which needs to use the spl logging. Finally the spl-trace.h header contains internal data structures only used for the log facility and should not be included by anythign by spl-debug.c. This way dependent packages can include the standard Solaris headers without picking up any SPL debug macros. However, if the dependant package want to integrate with the SPL debugging subsystem they can then explicitly include spl-debug.h. Along with this change I have dropped the CHECK_STACK macros because the upstream Linux kernel now has much better stack depth checking built in and we don't need this complexity. Additionally SBUG has been replaced with PANIC and provided as part of the Solaris macro set. While the Solaris version is really panic() that conflicts with the Linux kernel so we'll just have to make due to PANIC. It should rarely be called directly, the prefered usage would be an ASSERT or VERIFY. There's lots of change here but this cleanup was overdue. --- include/linux/file_compat.h | 1 + include/spl-debug.h | 181 +++++++++++++++++ include/spl-trace.h | 132 ++++++++++++ include/sys/debug.h | 462 ++++++++---------------------------------- include/sys/kmem.h | 1 - include/sys/rwlock.h | 4 +- include/sys/signal.h | 2 + include/sys/sunddi.h | 2 - include/sys/thread.h | 2 +- module/spl/spl-condvar.c | 1 + module/spl/spl-debug.c | 70 +++---- module/spl/spl-err.c | 3 +- module/spl/spl-generic.c | 5 +- module/spl/spl-kmem.c | 1 + module/spl/spl-kobj.c | 1 + module/spl/spl-kstat.c | 13 +- module/spl/spl-module.c | 2 +- module/spl/spl-proc.c | 10 +- module/spl/spl-taskq.c | 13 +- module/spl/spl-thread.c | 1 + module/spl/spl-vnode.c | 3 +- module/spl/spl-xdr.c | 3 +- module/splat/splat-atomic.c | 2 +- module/splat/splat-internal.h | 1 + scripts/check.sh | 2 +- 25 files changed, 460 insertions(+), 458 deletions(-) create mode 100644 include/spl-debug.h create mode 100644 include/spl-trace.h (limited to 'module/spl/spl-err.c') diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h index b03373ebd..77d5a27c3 100644 --- a/include/linux/file_compat.h +++ b/include/linux/file_compat.h @@ -25,6 +25,7 @@ #ifndef _SPL_FILE_COMPAT_H #define _SPL_FILE_COMPAT_H +#include #ifdef HAVE_FDTABLE_HEADER #include #endif diff --git a/include/spl-debug.h b/include/spl-debug.h new file mode 100644 index 000000000..b5ca64f87 --- /dev/null +++ b/include/spl-debug.h @@ -0,0 +1,181 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + +/* + * Available debug functions. These function should be used by any + * package which needs to integrate with the SPL log infrastructure. + * + * CDEBUG() - Log debug message with specified mask. + * CDEBUG_LIMIT() - Log just 1 debug message with specified mask. + * CWARN() - Log a warning message. + * CERROR() - Log an error message. + * CEMERG() - Log an emergency error message. + * CONSOLE() - Log a generic message to the console. + * + * ENTRY - Log entry point to a function. + * EXIT - Log exit point from a function. + * RETURN(x) - Log return from a function. + * GOTO(x, y) - Log goto within a function. + */ + +#ifndef _SPL_DEBUG_INTERNAL_H +#define _SPL_DEBUG_INTERNAL_H + +#include + +#define S_UNDEFINED 0x00000001 +#define S_ATOMIC 0x00000002 +#define S_KOBJ 0x00000004 +#define S_VNODE 0x00000008 +#define S_TIME 0x00000010 +#define S_RWLOCK 0x00000020 +#define S_THREAD 0x00000040 +#define S_CONDVAR 0x00000080 +#define S_MUTEX 0x00000100 +#define S_RNG 0x00000200 +#define S_TASKQ 0x00000400 +#define S_KMEM 0x00000800 +#define S_DEBUG 0x00001000 +#define S_GENERIC 0x00002000 +#define S_PROC 0x00004000 +#define S_MODULE 0x00008000 +#define S_CRED 0x00010000 + +#define D_TRACE 0x00000001 +#define D_INFO 0x00000002 +#define D_WARNING 0x00000004 +#define D_ERROR 0x00000008 +#define D_EMERG 0x00000010 +#define D_CONSOLE 0x00000020 +#define D_IOCTL 0x00000040 +#define D_DPRINTF 0x00000080 +#define D_OTHER 0x00000100 + +#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) +#define DEBUG_SUBSYSTEM S_UNDEFINED + +#ifdef NDEBUG /* Debugging Disabled */ + +#define CDEBUG(mask, fmt, a...) ((void)0) +#define CDEBUG_LIMIT(x, y, fmt, a...) ((void)0) +#define CWARN(fmt, a...) ((void)0) +#define CERROR(fmt, a...) ((void)0) +#define CEMERG(fmt, a...) ((void)0) +#define CONSOLE(mask, fmt, a...) ((void)0) + +#define ENTRY ((void)0) +#define EXIT ((void)0) +#define RETURN(x) return (x) +#define GOTO(x, y) { ((void)(y)); goto x; } + +#else /* Debugging Enabled */ + +#define __CDEBUG(cdls, subsys, mask, format, a...) \ +do { \ + if (((mask) & D_CANTMASK) != 0 || \ + ((spl_debug_mask & (mask)) != 0 && \ + (spl_debug_subsys & (subsys)) != 0)) \ + spl_debug_msg(cdls, subsys, mask, __FILE__, \ + __FUNCTION__, __LINE__, format, ## a); \ +} while (0) + +#define CDEBUG(mask, format, a...) \ + __CDEBUG(NULL, DEBUG_SUBSYSTEM, mask, format, ## a) + +#define __CDEBUG_LIMIT(subsys, mask, format, a...) \ +do { \ + static spl_debug_limit_state_t cdls; \ + \ + __CDEBUG(&cdls, subsys, mask, format, ## a); \ +} while (0) + +#define CDEBUG_LIMIT(mask, format, a...) \ + __CDEBUG_LIMIT(DEBUG_SUBSYSTEM, mask, format, ## a) + +#define CWARN(fmt, a...) CDEBUG_LIMIT(D_WARNING, fmt, ## a) +#define CERROR(fmt, a...) CDEBUG_LIMIT(D_ERROR, fmt, ## a) +#define CEMERG(fmt, a...) CDEBUG_LIMIT(D_EMERG, fmt, ## a) +#define CONSOLE(mask, fmt, a...) CDEBUG(D_CONSOLE | (mask), fmt, ## a) + +#define ENTRY CDEBUG(D_TRACE, "Process entered\n") +#define EXIT CDEBUG(D_TRACE, "Process leaving\n") + +#define RETURN(rc) \ +do { \ + typeof(rc) RETURN__ret = (rc); \ + CDEBUG(D_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ + (long)RETURN__ret, (long)RETURN__ret, (long)RETURN__ret); \ + return RETURN__ret; \ +} while (0) + +#define GOTO(label, rc) \ +do { \ + long GOTO__ret = (long)(rc); \ + CDEBUG(D_TRACE,"Process leaving via %s (rc=%lu : %ld : %lx)\n", \ + #label, (unsigned long)GOTO__ret, (signed long)GOTO__ret, \ + (signed long)GOTO__ret); \ + goto label; \ +} while (0) + +#endif /* NDEBUG */ + +typedef struct { + unsigned long cdls_next; + int cdls_count; + long cdls_delay; +} spl_debug_limit_state_t; + +/* Global debug variables */ +extern unsigned long spl_debug_subsys; +extern unsigned long spl_debug_mask; +extern unsigned long spl_debug_printk; +extern int spl_debug_mb; +extern unsigned int spl_debug_binary; +extern unsigned int spl_debug_catastrophe; +extern unsigned int spl_debug_panic_on_bug; +extern char spl_debug_file_path[PATH_MAX]; +extern unsigned int spl_console_ratelimit; +extern long spl_console_max_delay; +extern long spl_console_min_delay; +extern unsigned int spl_console_backoff; +extern unsigned int spl_debug_stack; + +/* Exported debug functions */ +extern int spl_debug_mask2str(char *str, int size, unsigned long mask, int ss); +extern int spl_debug_str2mask(unsigned long *mask, const char *str, int ss); +extern unsigned long spl_debug_set_mask(unsigned long mask); +extern unsigned long spl_debug_get_mask(void); +extern unsigned long spl_debug_set_subsys(unsigned long mask); +extern unsigned long spl_debug_get_subsys(void); +extern int spl_debug_set_mb(int mb); +extern int spl_debug_get_mb(void); +extern int spl_debug_dumplog(int flags); +extern void spl_debug_dumpstack(struct task_struct *tsk); +extern int spl_debug_clear_buffer(void); +extern int spl_debug_mark_buffer(char *text); + +int debug_init(void); +void debug_fini(void); + +#endif /* SPL_DEBUG_INTERNAL_H */ diff --git a/include/spl-trace.h b/include/spl-trace.h new file mode 100644 index 000000000..709b1326e --- /dev/null +++ b/include/spl-trace.h @@ -0,0 +1,132 @@ +/*****************************************************************************\ + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * For details, see . + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . +\*****************************************************************************/ + +#ifndef _SPL_TRACE_H +#define _SPL_TRACE_H + +#define TCD_MAX_PAGES (5 << (20 - PAGE_SHIFT)) +#define TCD_STOCK_PAGES (TCD_MAX_PAGES) +#define TRACE_CONSOLE_BUFFER_SIZE 1024 + +#define SPL_DEFAULT_MAX_DELAY (600 * HZ) +#define SPL_DEFAULT_MIN_DELAY ((HZ + 1) / 2) +#define SPL_DEFAULT_BACKOFF 2 + +#define DL_NOTHREAD 0x0001 /* Do not create a new thread */ +#define DL_SINGLE_CPU 0x0002 /* Collect pages from this CPU*/ + +typedef struct dumplog_priv { + wait_queue_head_t dp_waitq; + pid_t dp_pid; + int dp_flags; + atomic_t dp_done; +} dumplog_priv_t; + +/* Three trace data types */ +typedef enum { + TCD_TYPE_PROC, + TCD_TYPE_SOFTIRQ, + TCD_TYPE_IRQ, + TCD_TYPE_MAX +} tcd_type_t; + +union trace_data_union { + struct trace_cpu_data { + /* pages with trace records not yet processed by tracefiled */ + struct list_head tcd_pages; + /* number of pages on ->tcd_pages */ + unsigned long tcd_cur_pages; + /* Max number of pages allowed on ->tcd_pages */ + unsigned long tcd_max_pages; + + /* + * preallocated pages to write trace records into. Pages from + * ->tcd_stock_pages are moved to ->tcd_pages by spl_debug_msg(). + * + * This list is necessary, because on some platforms it's + * impossible to perform efficient atomic page allocation in a + * non-blockable context. + * + * Such platforms fill ->tcd_stock_pages "on occasion", when + * tracing code is entered in blockable context. + * + * trace_get_tage_try() tries to get a page from + * ->tcd_stock_pages first and resorts to atomic page + * allocation only if this queue is empty. ->tcd_stock_pages + * is replenished when tracing code is entered in blocking + * context (darwin-tracefile.c:trace_get_tcd()). We try to + * maintain TCD_STOCK_PAGES (40 by default) pages in this + * queue. Atomic allocation is only required if more than + * TCD_STOCK_PAGES pagesful are consumed by trace records all + * emitted in non-blocking contexts. Which is quite unlikely. + */ + struct list_head tcd_stock_pages; + /* number of pages on ->tcd_stock_pages */ + unsigned long tcd_cur_stock_pages; + + unsigned short tcd_shutting_down; + unsigned short tcd_cpu; + unsigned short tcd_type; + /* The factors to share debug memory. */ + unsigned short tcd_pages_factor; + + /* + * This spinlock is needed to workaround the problem of + * set_cpus_allowed() being GPL-only. Since we cannot + * schedule a thread on a specific CPU when dumping the + * pages, we must use the spinlock for mutual exclusion. + */ + spinlock_t tcd_lock; + unsigned long tcd_lock_flags; + } tcd; + char __pad[L1_CACHE_ALIGN(sizeof(struct trace_cpu_data))]; +}; + +extern union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS]; + +#define tcd_for_each(tcd, i, j) \ + for (i = 0; i < TCD_TYPE_MAX && trace_data[i]; i++) \ + for (j = 0, ((tcd) = &(*trace_data[i])[j].tcd); \ + j < num_possible_cpus(); j++, (tcd) = &(*trace_data[i])[j].tcd) + +#define tcd_for_each_type_lock(tcd, i, cpu) \ + for (i = 0; i < TCD_TYPE_MAX && trace_data[i] && \ + (tcd = &(*trace_data[i])[cpu].tcd) && \ + trace_lock_tcd(tcd); trace_unlock_tcd(tcd), i++) + +struct trace_page { + struct page *page; /* page itself */ + struct list_head linkage; /* Used by trace_data_union */ + unsigned int used; /* number of bytes used within this page */ + unsigned short cpu; /* cpu that owns this page */ + unsigned short type; /* type(context) of this page */ +}; + +struct page_collection { + struct list_head pc_pages; + spinlock_t pc_lock; + int pc_want_daemon_pages; +}; + +#endif /* SPL_TRACE_H */ diff --git a/include/sys/debug.h b/include/sys/debug.h index 848c885a6..0da7e31bb 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -22,420 +22,118 @@ * with the SPL. If not, see . \*****************************************************************************/ +/* + * Available Solaris debug functions. All of the ASSERT() macros will be + * compiled out when NDEBUG is defined, this is the default behavior for + * the SPL. To enable assertions use the --enable-debug with configure. + * The VERIFY() functions are never compiled out and cannot be disabled. + * + * PANIC() - Panic the node and print message. + * ASSERT() - Assert X is true, if not panic. + * ASSERTF() - Assert X is true, if not panic and print message. + * ASSERTV() - Wraps a variable declaration which is only used by ASSERT(). + * ASSERT3S() - Assert signed X OP Y is true, if not panic. + * ASSERT3U() - Assert unsigned X OP Y is true, if not panic. + * ASSERT3P() - Assert pointer X OP Y is true, if not panic. + * VERIFY() - Verify X is true, if not panic. + * VERIFY3S() - Verify signed X OP Y is true, if not panic. + * VERIFY3U() - Verify unsigned X OP Y is true, if not panic. + * VERIFY3P() - Verify pointer X OP Y is true, if not panic. + */ + #ifndef _SPL_DEBUG_H #define _SPL_DEBUG_H -#include /* THREAD_SIZE */ -#include - -extern unsigned long spl_debug_mask; -extern unsigned long spl_debug_subsys; - -#define S_UNDEFINED 0x00000001 -#define S_ATOMIC 0x00000002 -#define S_KOBJ 0x00000004 -#define S_VNODE 0x00000008 -#define S_TIME 0x00000010 -#define S_RWLOCK 0x00000020 -#define S_THREAD 0x00000040 -#define S_CONDVAR 0x00000080 -#define S_MUTEX 0x00000100 -#define S_RNG 0x00000200 -#define S_TASKQ 0x00000400 -#define S_KMEM 0x00000800 -#define S_DEBUG 0x00001000 -#define S_GENERIC 0x00002000 -#define S_PROC 0x00004000 -#define S_MODULE 0x00008000 -#define S_CRED 0x00010000 - -#define D_TRACE 0x00000001 -#define D_INFO 0x00000002 -#define D_WARNING 0x00000004 -#define D_ERROR 0x00000008 -#define D_EMERG 0x00000010 -#define D_CONSOLE 0x00000020 -#define D_IOCTL 0x00000040 -#define D_DPRINTF 0x00000080 -#define D_OTHER 0x00000100 - -#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) -#define DEBUG_SUBSYSTEM S_UNDEFINED - -int debug_init(void); -void debug_fini(void); -int spl_debug_mask2str(char *str, int size, unsigned long mask, int is_subsys); -int spl_debug_str2mask(unsigned long *mask, const char *str, int is_subsys); - -extern unsigned long spl_debug_subsys; -extern unsigned long spl_debug_mask; -extern unsigned long spl_debug_printk; -extern int spl_debug_mb; -extern unsigned int spl_debug_binary; -extern unsigned int spl_debug_catastrophe; -extern unsigned int spl_debug_panic_on_bug; -extern char spl_debug_file_path[PATH_MAX]; -extern unsigned int spl_console_ratelimit; -extern long spl_console_max_delay; -extern long spl_console_min_delay; -extern unsigned int spl_console_backoff; -extern unsigned int spl_debug_stack; - -#define TCD_MAX_PAGES (5 << (20 - PAGE_SHIFT)) -#define TCD_STOCK_PAGES (TCD_MAX_PAGES) -#define TRACE_CONSOLE_BUFFER_SIZE 1024 - -#define SPL_DEFAULT_MAX_DELAY (600 * HZ) -#define SPL_DEFAULT_MIN_DELAY ((HZ + 1) / 2) -#define SPL_DEFAULT_BACKOFF 2 - -#define DL_NOTHREAD 0x0001 /* Do not create a new thread */ -#define DL_SINGLE_CPU 0x0002 /* Collect pages from this CPU */ - -typedef struct dumplog_priv { - wait_queue_head_t dp_waitq; - pid_t dp_pid; - int dp_flags; - atomic_t dp_done; -} dumplog_priv_t; - -typedef struct { - unsigned long cdls_next; - int cdls_count; - long cdls_delay; -} spl_debug_limit_state_t; - -/* Three trace data types */ -typedef enum { - TCD_TYPE_PROC, - TCD_TYPE_SOFTIRQ, - TCD_TYPE_IRQ, - TCD_TYPE_MAX -} tcd_type_t; - -union trace_data_union { - struct trace_cpu_data { - /* pages with trace records not yet processed by tracefiled */ - struct list_head tcd_pages; - /* number of pages on ->tcd_pages */ - unsigned long tcd_cur_pages; - /* Max number of pages allowed on ->tcd_pages */ - unsigned long tcd_max_pages; - - /* - * preallocated pages to write trace records into. Pages from - * ->tcd_stock_pages are moved to ->tcd_pages by spl_debug_msg(). - * - * This list is necessary, because on some platforms it's - * impossible to perform efficient atomic page allocation in a - * non-blockable context. - * - * Such platforms fill ->tcd_stock_pages "on occasion", when - * tracing code is entered in blockable context. - * - * trace_get_tage_try() tries to get a page from - * ->tcd_stock_pages first and resorts to atomic page - * allocation only if this queue is empty. ->tcd_stock_pages - * is replenished when tracing code is entered in blocking - * context (darwin-tracefile.c:trace_get_tcd()). We try to - * maintain TCD_STOCK_PAGES (40 by default) pages in this - * queue. Atomic allocation is only required if more than - * TCD_STOCK_PAGES pagesful are consumed by trace records all - * emitted in non-blocking contexts. Which is quite unlikely. - */ - struct list_head tcd_stock_pages; - /* number of pages on ->tcd_stock_pages */ - unsigned long tcd_cur_stock_pages; - - unsigned short tcd_shutting_down; - unsigned short tcd_cpu; - unsigned short tcd_type; - /* The factors to share debug memory. */ - unsigned short tcd_pages_factor; - - /* - * This spinlock is needed to workaround the problem of - * set_cpus_allowed() being GPL-only. Since we cannot - * schedule a thread on a specific CPU when dumping the - * pages, we must use the spinlock for mutual exclusion. - */ - spinlock_t tcd_lock; - unsigned long tcd_lock_flags; - } tcd; - char __pad[L1_CACHE_ALIGN(sizeof(struct trace_cpu_data))]; -}; - -extern union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS]; - -#define tcd_for_each(tcd, i, j) \ - for (i = 0; i < TCD_TYPE_MAX && trace_data[i]; i++) \ - for (j = 0, ((tcd) = &(*trace_data[i])[j].tcd); \ - j < num_possible_cpus(); j++, (tcd) = &(*trace_data[i])[j].tcd) - -#define tcd_for_each_type_lock(tcd, i, cpu) \ - for (i = 0; i < TCD_TYPE_MAX && trace_data[i] && \ - (tcd = &(*trace_data[i])[cpu].tcd) && \ - trace_lock_tcd(tcd); trace_unlock_tcd(tcd), i++) - -struct trace_page { - struct page * page; /* page itself */ - struct list_head linkage; /* Used by lists in trace_data_union */ - unsigned int used; /* number of bytes used within this page */ - unsigned short cpu; /* cpu that owns this page */ - unsigned short type; /* type(context) of this page */ -}; - -struct page_collection { - struct list_head pc_pages; - spinlock_t pc_lock; - int pc_want_daemon_pages; -}; - -#define SBUG() spl_debug_bug(__FILE__, __FUNCTION__, __LINE__, 0); - -#ifdef NDEBUG +#ifdef NDEBUG /* Debugging Disabled */ -#define CDEBUG_STACK() (0) -#define CDEBUG_LIMIT(x, y, z, a...) ((void)0) -#define __CDEBUG_LIMIT(x, y, z, a...) ((void)0) -#define CDEBUG(mask, format, a...) ((void)0) -#define CWARN(fmt, a...) ((void)0) -#define CERROR(fmt, a...) ((void)0) -#define CEMERG(fmt, a...) ((void)0) -#define CONSOLE(mask, fmt, a...) ((void)0) - -#define ENTRY ((void)0) -#define EXIT ((void)0) -#define RETURN(x) return (x) -#define GOTO(x, y) { ((void)(y)); goto x; } +#define PANIC(fmt, a...) \ +do { \ + printk(KERN_EMERG fmt, ## a); \ + spl_debug_bug(__FILE__, __FUNCTION__, __LINE__, 0); \ +} while (0) #define __ASSERT(x) ((void)0) -#define __ASSERT_TAGE_INVARIANT(x) ((void)0) #define ASSERT(x) ((void)0) #define ASSERTF(x, y, z...) ((void)0) #define ASSERTV(x) -#define VERIFY(cond) \ -do { \ - if (unlikely(!(cond))) { \ - printk(KERN_ERR "VERIFY(" #cond ") failed\n"); \ - SBUG(); \ - } \ +#define VERIFY(cond) \ +do { \ + if (unlikely(!(cond))) \ + PANIC("VERIFY(" #cond ") failed\n"); \ } while (0) -#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ -do { \ - if (!((TYPE)(LEFT) OP (TYPE)(RIGHT))) { \ - printk(KERN_ERR \ - "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ - "failed (" FMT " " #OP " " FMT ")\n", \ - CAST (LEFT), CAST (RIGHT)); \ - SBUG(); \ - } \ +#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ +do { \ + if (!((TYPE)(LEFT) OP (TYPE)(RIGHT))) \ + PANIC("VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ + "failed (" FMT " " #OP " " FMT ")\n", \ + CAST (LEFT), CAST (RIGHT)); \ } while (0) -#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) -#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ - (unsigned long long)) -#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) +#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) +#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ + (unsigned long long)) +#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) -#define ASSERT3S(x,y,z) ((void)0) -#define ASSERT3U(x,y,z) ((void)0) -#define ASSERT3P(x,y,z) ((void)0) +#define ASSERT3S(x,y,z) ((void)0) +#define ASSERT3U(x,y,z) ((void)0) +#define ASSERT3P(x,y,z) ((void)0) -#else /* NDEBUG */ +#else /* Debugging Enabled */ -#ifdef __ia64__ -#define CDEBUG_STACK() (THREAD_SIZE - \ - ((unsigned long)__builtin_dwarf_cfa() & \ - (THREAD_SIZE - 1))) -#else -#define CDEBUG_STACK() (THREAD_SIZE - \ - ((unsigned long)__builtin_frame_address(0) & \ - (THREAD_SIZE - 1))) -# endif /* __ia64__ */ - -/* DL_SINGLE_CPU flag is passed to spl_debug_bug() because we are about - * to over run our stack and likely damage at least one other unknown - * thread stack. We must finish generating the needed debug info within - * this thread context because once we yeild the CPU its very likely - * the system will crash. - */ -#define __CHECK_STACK(file, func, line) \ -do { \ - if (unlikely(CDEBUG_STACK() > spl_debug_stack)) { \ - spl_debug_stack = CDEBUG_STACK(); \ - \ - if (unlikely(CDEBUG_STACK() > (4 * THREAD_SIZE) / 5)) { \ - spl_debug_msg(NULL, D_TRACE, D_WARNING, \ - file, func, line, "Error " \ - "exceeded maximum safe stack " \ - "size (%lu/%lu)\n", \ - CDEBUG_STACK(), THREAD_SIZE); \ - spl_debug_bug(file, func, line, DL_SINGLE_CPU); \ - } \ - } \ +#define PANIC(fmt, a...) \ +do { \ + spl_debug_msg(NULL, 0, 0, \ + __FILE__, __FUNCTION__, __LINE__, fmt, ## a); \ + spl_debug_bug(__FILE__, __FUNCTION__, __LINE__, 0); \ } while (0) -/* NOTE: The run time stack overflow checking is being disabled by default - * because it is not safe for use with 2.6.29 and latter kernels. These - * kernels do now have their own stack overflow checking so this support - * has become redundant anyway. It can be re-enabled for older kernels or - * arches without stack overflow checking by redefining CHECK_STACK(). - * - * #define CHECK_STACK() __CHECK_STACK(__FILE__, __func__, __LINE__) - */ -#define CHECK_STACK() ((void)0) - /* ASSERTION that is safe to use within the debug system */ -#define __ASSERT(cond) \ -do { \ - if (unlikely(!(cond))) { \ - printk(KERN_ERR "ASSERTION(" #cond ") failed\n"); \ - BUG(); \ - } \ +#define __ASSERT(cond) \ +do { \ + if (unlikely(!(cond))) { \ + printk(KERN_EMERG "ASSERTION(" #cond ") failed\n"); \ + BUG(); \ + } \ } while (0) -#define __ASSERT_TAGE_INVARIANT(tage) \ -do { \ - __ASSERT(tage != NULL); \ - __ASSERT(tage->page != NULL); \ - __ASSERT(tage->used <= PAGE_SIZE); \ - __ASSERT(page_count(tage->page) > 0); \ -} while(0) - /* ASSERTION that will debug log used outside the debug sysytem */ -#define ASSERT(cond) \ -do { \ - CHECK_STACK(); \ - \ - if (unlikely(!(cond))) { \ - spl_debug_msg(NULL, DEBUG_SUBSYSTEM, D_EMERG, \ - __FILE__, __FUNCTION__, __LINE__, \ - "ASSERTION(" #cond ") failed\n"); \ - SBUG(); \ - } \ -} while (0) - -#define ASSERTF(cond, fmt, a...) \ -do { \ - CHECK_STACK(); \ - \ - if (unlikely(!(cond))) { \ - spl_debug_msg(NULL, DEBUG_SUBSYSTEM, D_EMERG, \ - __FILE__, __FUNCTION__, __LINE__, \ - "ASSERTION(" #cond ") failed: " fmt, \ - ## a); \ - SBUG(); \ - } \ -} while (0) - -#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ -do { \ - CHECK_STACK(); \ - \ - if (!((TYPE)(LEFT) OP (TYPE)(RIGHT))) { \ - spl_debug_msg(NULL, DEBUG_SUBSYSTEM, D_EMERG, \ - __FILE__, __FUNCTION__, __LINE__, \ - "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ - "failed (" FMT " " #OP " " FMT ")\n", \ - CAST (LEFT), CAST (RIGHT)); \ - SBUG(); \ - } \ -} while (0) - -#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) -#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ - (unsigned long long)) -#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) - -#define ASSERT3S(x,y,z) VERIFY3S(x, y, z) -#define ASSERT3U(x,y,z) VERIFY3U(x, y, z) -#define ASSERT3P(x,y,z) VERIFY3P(x, y, z) - -#define ASSERTV(x) x -#define VERIFY(x) ASSERT(x) - -#define __CDEBUG(cdls, subsys, mask, format, a...) \ -do { \ - CHECK_STACK(); \ - \ - if (((mask) & D_CANTMASK) != 0 || \ - ((spl_debug_mask & (mask)) != 0 && \ - (spl_debug_subsys & (subsys)) != 0)) \ - spl_debug_msg(cdls, subsys, mask, \ - __FILE__, __FUNCTION__, __LINE__, \ - format, ## a); \ +#define ASSERT(cond) \ +do { \ + if (unlikely(!(cond))) \ + PANIC("ASSERTION(" #cond ") failed\n"); \ } while (0) -#define CDEBUG(mask, format, a...) \ - __CDEBUG(NULL, DEBUG_SUBSYSTEM, mask, format, ## a) - -#define __CDEBUG_LIMIT(subsys, mask, format, a...) \ -do { \ - static spl_debug_limit_state_t cdls; \ - \ - __CDEBUG(&cdls, subsys, mask, format, ## a); \ +#define ASSERTF(cond, fmt, a...) \ +do { \ + if (unlikely(!(cond))) \ + PANIC("ASSERTION(" #cond ") failed: " fmt, ## a); \ } while (0) -#define CDEBUG_LIMIT(mask, format, a...) \ - __CDEBUG_LIMIT(DEBUG_SUBSYSTEM, mask, format, ## a) - -#define CWARN(fmt, a...) CDEBUG_LIMIT(D_WARNING, fmt, ## a) -#define CERROR(fmt, a...) CDEBUG_LIMIT(D_ERROR, fmt, ## a) -#define CEMERG(fmt, a...) CDEBUG_LIMIT(D_EMERG, fmt, ## a) -#define CONSOLE(mask, fmt, a...) CDEBUG(D_CONSOLE | (mask), fmt, ## a) - -#define GOTO(label, rc) \ -do { \ - long GOTO__ret = (long)(rc); \ - CDEBUG(D_TRACE,"Process leaving via %s (rc=%lu : %ld : %lx)\n", \ - #label, (unsigned long)GOTO__ret, (signed long)GOTO__ret,\ - (signed long)GOTO__ret); \ - goto label; \ +#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ +do { \ + if (!((TYPE)(LEFT) OP (TYPE)(RIGHT))) \ + PANIC("VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ + "failed (" FMT " " #OP " " FMT ")\n", \ + CAST (LEFT), CAST (RIGHT)); \ } while (0) -#define RETURN(rc) \ -do { \ - typeof(rc) RETURN__ret = (rc); \ - CDEBUG(D_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ - (long)RETURN__ret, (long)RETURN__ret, (long)RETURN__ret);\ - return RETURN__ret; \ -} while (0) +#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) +#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ + (unsigned long long)) +#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) -#define __ENTRY(subsys) \ -do { \ - __CDEBUG(NULL, subsys, D_TRACE, "Process entered\n"); \ -} while (0) +#define ASSERT3S(x,y,z) VERIFY3S(x, y, z) +#define ASSERT3U(x,y,z) VERIFY3U(x, y, z) +#define ASSERT3P(x,y,z) VERIFY3P(x, y, z) -#define __EXIT(subsys) \ -do { \ - __CDEBUG(NULL, subsys, D_TRACE, "Process leaving\n"); \ -} while(0) +#define ASSERTV(x) x +#define VERIFY(x) ASSERT(x) -#define ENTRY __ENTRY(DEBUG_SUBSYSTEM) -#define EXIT __EXIT(DEBUG_SUBSYSTEM) #endif /* NDEBUG */ -#define spl_debug_msg(cdls, subsys, mask, file, fn, line, format, a...) \ - spl_debug_vmsg(cdls, subsys, mask, file, fn, \ - line, NULL, NULL, format, ##a) - -extern int spl_debug_vmsg(spl_debug_limit_state_t *cdls, int subsys, int mask, - const char *file, const char *fn, const int line, - const char *format1, va_list args, const char *format2, ...); - -extern unsigned long spl_debug_set_mask(unsigned long mask); -extern unsigned long spl_debug_get_mask(void); -extern unsigned long spl_debug_set_subsys(unsigned long mask); -extern unsigned long spl_debug_get_subsys(void); -extern int spl_debug_set_mb(int mb); -extern int spl_debug_get_mb(void); - -extern int spl_debug_dumplog(int flags); -extern void spl_debug_dumpstack(struct task_struct *tsk); -extern void spl_debug_bug(char *file, const char *func, const int line, int flags); - -extern int spl_debug_clear_buffer(void); -extern int spl_debug_mark_buffer(char *text); +extern void spl_debug_bug(char *file, const char *fn, const int line, int fl); +extern int spl_debug_msg(void *arg, int subsys, int mask, const char *file, + const char *fn, const int line, const char *format, ...); #endif /* SPL_DEBUG_H */ diff --git a/include/sys/kmem.h b/include/sys/kmem.h index a5758bd61..17b3a2276 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -35,7 +35,6 @@ #include #include #include -#include #include #include diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index e2be77c54..eb763ec78 100644 --- a/include/sys/rwlock.h +++ b/include/sys/rwlock.h @@ -156,7 +156,7 @@ RW_LOCK_HELD(krwlock_t *rwp) spl_rw_set_owner(rwp); \ break; \ default: \ - SBUG(); \ + VERIFY(0); \ } \ _rc_; \ }) @@ -172,7 +172,7 @@ RW_LOCK_HELD(krwlock_t *rwp) spl_rw_set_owner(rwp); \ break; \ default: \ - SBUG(); \ + VERIFY(0); \ } \ }) diff --git a/include/sys/signal.h b/include/sys/signal.h index c7e293968..254bf0641 100644 --- a/include/sys/signal.h +++ b/include/sys/signal.h @@ -25,6 +25,8 @@ #ifndef _SPL_SIGNAL_H #define _SPL_SIGNAL_H +#include + #define FORREAL 0 /* Usual side-effects */ #define JUSTLOOKING 1 /* Don't stop the process */ diff --git a/include/sys/sunddi.h b/include/sys/sunddi.h index c48066b9c..65df2a053 100644 --- a/include/sys/sunddi.h +++ b/include/sys/sunddi.h @@ -268,7 +268,6 @@ ddi_create_minor_node(dev_info_t *di, char *name, int spec_type, rc = PTR_ERR(di->di_class); di->di_class = NULL; ddi_remove_minor_node(di, name); - CERROR("Error creating %s class, %d\n", name, rc); return DDI_FAILURE; } @@ -285,7 +284,6 @@ ddi_create_minor_node(dev_info_t *di, char *name, int spec_type, if (name) { rc = __mod_mknod(di->di_name, "c", di->di_major, di->di_minor); if (rc) { - CERROR("Error mknod %s, %d\n", di->di_name, rc); ddi_remove_minor_node(di, name); } } diff --git a/include/sys/thread.h b/include/sys/thread.h index e29715d83..06db6d4c9 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -48,7 +48,7 @@ typedef void (*thread_func_t)(void *); __thread_create(stk, stksize, (thread_func_t)func, \ #func, arg, len, pp, state, pri) #define thread_exit() __thread_exit() -#define thread_join(t) SBUG() +#define thread_join(t) VERIFY(0) #define curthread get_current() extern kthread_t *__thread_create(caddr_t stk, size_t stksize, diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c index 269b0ab61..002dcdb45 100644 --- a/module/spl/spl-condvar.c +++ b/module/spl/spl-condvar.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 75778752b..5284eb339 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -37,7 +37,8 @@ #include #include #include -#include +#include +#include #include #ifdef DEBUG_SUBSYSTEM @@ -48,17 +49,17 @@ unsigned long spl_debug_subsys = ~0; EXPORT_SYMBOL(spl_debug_subsys); -module_param(spl_debug_subsys, long, 0644); +module_param(spl_debug_subsys, ulong, 0644); MODULE_PARM_DESC(spl_debug_subsys, "Subsystem debugging level mask."); unsigned long spl_debug_mask = (D_EMERG | D_ERROR | D_WARNING | D_CONSOLE); EXPORT_SYMBOL(spl_debug_mask); -module_param(spl_debug_mask, long, 0644); +module_param(spl_debug_mask, ulong, 0644); MODULE_PARM_DESC(spl_debug_mask, "Debugging level mask."); unsigned long spl_debug_printk = D_CANTMASK; EXPORT_SYMBOL(spl_debug_printk); -module_param(spl_debug_printk, long, 0644); +module_param(spl_debug_printk, ulong, 0644); MODULE_PARM_DESC(spl_debug_printk, "Console printk level mask."); int spl_debug_mb = -1; @@ -74,7 +75,7 @@ EXPORT_SYMBOL(spl_debug_catastrophe); unsigned int spl_debug_panic_on_bug = 0; EXPORT_SYMBOL(spl_debug_panic_on_bug); -module_param(spl_debug_panic_on_bug, int, 0644); +module_param(spl_debug_panic_on_bug, uint, 0644); MODULE_PARM_DESC(spl_debug_panic_on_bug, "Panic on BUG"); static char spl_debug_file_name[PATH_MAX]; @@ -633,10 +634,10 @@ trace_get_tage(struct trace_cpu_data *tcd, unsigned long len) } int -spl_debug_vmsg(spl_debug_limit_state_t *cdls, int subsys, int mask, - const char *file, const char *fn, const int line, - const char *format1, va_list args, const char *format2, ...) +spl_debug_msg(void *arg, int subsys, int mask, const char *file, + const char *fn, const int line, const char *format, ...) { + spl_debug_limit_state_t *cdls = arg; struct trace_cpu_data *tcd = NULL; struct spl_debug_header header = { 0, }; struct trace_page *tage; @@ -650,10 +651,16 @@ spl_debug_vmsg(spl_debug_limit_state_t *cdls, int subsys, int mask, int i; int remain; + if (subsys == 0) + subsys = DEBUG_SUBSYSTEM; + + if (mask == 0) + mask = D_EMERG; + if (strchr(file, '/')) file = strrchr(file, '/') + 1; - trace_set_debug_header(&header, subsys, mask, line, CDEBUG_STACK()); + trace_set_debug_header(&header, subsys, mask, line, 0); tcd = trace_get_tcd(); if (tcd == NULL) @@ -698,19 +705,14 @@ spl_debug_vmsg(spl_debug_limit_state_t *cdls, int subsys, int mask, } needed = 0; - if (format1) { - va_copy(ap, args); - needed = vsnprintf(string_buf, max_nob, format1, ap); - va_end(ap); - } - - if (format2) { + if (format) { remain = max_nob - needed; if (remain < 0) remain = 0; - va_start(ap, format2); - needed += vsnprintf(string_buf+needed, remain, format2, ap); + va_start(ap, format); + needed += vsnprintf(string_buf+needed, remain, + format, ap); va_end(ap); } @@ -784,16 +786,12 @@ console: string_buf = trace_get_console_buffer(); needed = 0; - if (format1 != NULL) { - va_copy(ap, args); - needed = vsnprintf(string_buf, TRACE_CONSOLE_BUFFER_SIZE, format1, ap); - va_end(ap); - } - if (format2 != NULL) { + if (format != NULL) { remain = TRACE_CONSOLE_BUFFER_SIZE - needed; if (remain > 0) { - va_start(ap, format2); - needed += vsnprintf(string_buf+needed, remain, format2, ap); + va_start(ap, format); + needed += vsnprintf(string_buf+needed, remain, + format, ap); va_end(ap); } } @@ -819,7 +817,7 @@ console: return 0; } -EXPORT_SYMBOL(spl_debug_vmsg); +EXPORT_SYMBOL(spl_debug_msg); /* Do the collect_pages job on a single CPU: assumes that all other * CPUs have been stopped during a panic. If this isn't true for @@ -881,9 +879,6 @@ put_pages_back_on_all_cpus(struct page_collection *pc) list_for_each_entry_safe(tage, tmp, &pc->pc_pages, linkage) { - - __ASSERT_TAGE_INVARIANT(tage); - if (tage->cpu != cpu || tage->type != i) continue; @@ -935,8 +930,6 @@ spl_debug_dump_all_pages(dumplog_priv_t *dp, char *filename) set_fs(get_ds()); list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) { - __ASSERT_TAGE_INVARIANT(tage); - rc = spl_filp_write(filp, page_address(tage->page), tage->used, spl_filp_poff(filp)); if (rc != (int)tage->used) { @@ -979,7 +972,6 @@ spl_debug_flush_pages(void) collect_pages(&dp, &pc); list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) { - __ASSERT_TAGE_INVARIANT(tage); list_del(&tage->linkage); tage_free(tage); } @@ -1077,12 +1069,10 @@ EXPORT_SYMBOL(spl_debug_dumpstack); void spl_debug_bug(char *file, const char *func, const int line, int flags) { spl_debug_catastrophe = 1; - spl_debug_msg(NULL, 0, D_EMERG, file, func, line, "SBUG\n"); + spl_debug_msg(NULL, 0, D_EMERG, file, func, line, "SPL PANIC\n"); - if (in_interrupt()) { - panic("SBUG in interrupt.\n"); - /* not reached */ - } + if (in_interrupt()) + panic("SPL PANIC in interrupt.\n"); if (in_atomic() || irqs_disabled()) flags |= DL_NOTHREAD; @@ -1095,7 +1085,7 @@ void spl_debug_bug(char *file, const char *func, const int line, int flags) spl_debug_dumplog(flags); if (spl_debug_panic_on_bug) - panic("SBUG"); + panic("SPL PANIC"); set_task_state(current, TASK_UNINTERRUPTIBLE); while (1) @@ -1208,8 +1198,6 @@ trace_cleanup_on_all_cpus(void) list_for_each_entry_safe(tage, tmp, &tcd->tcd_pages, linkage) { - __ASSERT_TAGE_INVARIANT(tage); - list_del(&tage->linkage); tage_free(tage); } diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 1d5202827..1b059f0c8 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -26,6 +26,7 @@ #include #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM @@ -44,7 +45,7 @@ vpanic(const char *fmt, va_list ap) char msg[MAXMSGLEN]; vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); - panic("%s", msg); + PANIC("%s", msg); } /* vpanic() */ EXPORT_SYMBOL(vpanic); diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index 6a3f49ae0..b875f7d7f 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM @@ -339,12 +340,12 @@ EXPORT_SYMBOL(ddi_copyout); * never be putting away the last reference on a task structure so this will * not be called. However, we still need to define it so the module does not * have undefined symbol at load time. That all said if this impossible - * thing does somehow happen SBUG() immediately so we know about it. + * thing does somehow happen PANIC immediately so we know about it. */ void __put_task_struct(struct task_struct *t) { - SBUG(); + PANIC("Unexpectly put last reference on task %d\n", (int)t->pid); } EXPORT_SYMBOL(__put_task_struct); #endif /* HAVE_PUT_TASK_STRUCT */ diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index a348021d8..e0b7e12e2 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include +#include #ifdef DEBUG_SUBSYSTEM # undef DEBUG_SUBSYSTEM diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index 42a264172..d58a9892b 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 433f3e5b0..238f37ae3 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -24,8 +24,9 @@ * Solaris Porting Layer (SPL) Kstat Implementation. \*****************************************************************************/ -#include #include +#include +#include static spinlock_t kstat_lock; static struct list_head kstat_list; @@ -72,7 +73,7 @@ kstat_seq_show_headers(struct seq_file *f) "min", "max", "start", "stop"); break; default: - SBUG(); /* Unreachable */ + PANIC("Undefined kstat type %d\n", ksp->ks_type); } } @@ -135,7 +136,7 @@ kstat_seq_show_named(struct seq_file *f, kstat_named_t *knp) seq_printf(f, "%s", KSTAT_NAMED_STR_PTR(knp)); break; default: - SBUG(); /* Unreachable */ + PANIC("Undefined kstat data type %d\n", knp->data_type); } seq_printf(f, "\n"); @@ -210,7 +211,7 @@ kstat_seq_show(struct seq_file *f, void *p) rc = kstat_seq_show_timer(f, (kstat_timer_t *)p); break; default: - SBUG(); /* Unreachable */ + PANIC("Undefined kstat type %d\n", ksp->ks_type); } return rc; @@ -239,7 +240,7 @@ kstat_seq_data_addr(kstat_t *ksp, loff_t n) rc = ksp->ks_data + n * sizeof(kstat_timer_t); break; default: - SBUG(); /* Unreachable */ + PANIC("Undefined kstat type %d\n", ksp->ks_type); } RETURN(rc); @@ -377,7 +378,7 @@ __kstat_create(const char *ks_module, int ks_instance, const char *ks_name, ksp->ks_data_size = ks_ndata * sizeof(kstat_timer_t); break; default: - SBUG(); /* Unreachable */ + PANIC("Undefined kstat type %d\n", ksp->ks_type); } if (ksp->ks_flags & KSTAT_FLAG_VIRTUAL) { diff --git a/module/spl/spl-module.c b/module/spl/spl-module.c index 37dd4f4c1..787a4480e 100644 --- a/module/spl/spl-module.c +++ b/module/spl/spl-module.c @@ -24,8 +24,8 @@ * Solaris Porting Layer (SPL) Module Implementation. \*****************************************************************************/ -#include #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 5a71f795c..bc6dac5b8 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM @@ -297,13 +298,10 @@ SPL_PROC_HANDLER(proc_force_bug) { ENTRY; - if (write) { - CERROR("Crashing due to forced SBUG\n"); - SBUG(); - /* Unreachable */ - } else { + if (write) + PANIC("Crashing due to forced panic\n"); + else *lenp = 0; - } RETURN(0); } diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 9aca699c7..d9c83279c 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -26,6 +26,7 @@ #include #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM @@ -90,8 +91,8 @@ retry: RETURN(NULL); } - /* Unreachable, TQ_SLEEP or TQ_NOSLEEP */ - SBUG(); + /* Unreachable, Neither TQ_SLEEP or TQ_NOSLEEP set */ + PANIC("Neither TQ_SLEEP or TQ_NOSLEEP set"); } spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); @@ -254,11 +255,9 @@ __taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) if (!(flags & (TQ_SLEEP | TQ_NOSLEEP))) flags |= TQ_SLEEP; - if (unlikely(in_atomic() && (flags & TQ_SLEEP))) { - CERROR("May schedule while atomic: %s/0x%08x/%d\n", - current->comm, preempt_count(), current->pid); - SBUG(); - } + if (unlikely(in_atomic() && (flags & TQ_SLEEP))) + PANIC("May schedule while atomic: %s/0x%08x/%d\n", + current->comm, preempt_count(), current->pid); spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index bce912c4d..e28b1261a 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -26,6 +26,7 @@ #include #include +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index c67fc4c7f..840bb6718 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -24,9 +24,8 @@ * Solaris Porting Layer (SPL) Vnode Implementation. \*****************************************************************************/ -#include #include - +#include #ifdef DEBUG_SUBSYSTEM #undef DEBUG_SUBSYSTEM diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index 174f76f19..375b74e53 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -22,13 +22,12 @@ \*****************************************************************************/ #include - #include #include #include - #include #include +#include /* * SPL's XDR mem implementation. diff --git a/module/splat/splat-atomic.c b/module/splat/splat-atomic.c index fd86a9fa8..6162d6abf 100644 --- a/module/splat/splat-atomic.c +++ b/module/splat/splat-atomic.c @@ -109,7 +109,7 @@ splat_atomic_work(void *priv) atomic_sub_64_nv(&ap->ap_atomic, 5); break; default: - SBUG(); + PANIC("Undefined op %d\n", op); } } diff --git a/module/splat/splat-internal.h b/module/splat/splat-internal.h index ba1224fc1..c42e08d6f 100644 --- a/module/splat/splat-internal.h +++ b/module/splat/splat-internal.h @@ -66,6 +66,7 @@ #include #include "spl-device.h" +#include "spl-debug.h" #include "splat-ctl.h" #define SPLAT_SUBSYSTEM_INIT(type) \ diff --git a/scripts/check.sh b/scripts/check.sh index 712605547..b44b31333 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -62,7 +62,7 @@ if [ ! -f ${spl_module} ] || [ ! -f ${splat_module} ]; then die "Source tree must be built, run 'make'" fi -spl_module_params="spl_debug_mask=-1 spl_debug_subsys=-1" +spl_module_params="spl_debug_mask=0xffffffff spl_debug_subsys=0xffffffff" echo "Loading ${spl_module}" /sbin/insmod ${spl_module} ${spl_module_params} || die "Failed to load ${spl_module}" -- cgit v1.2.3 From b17edc10a9c66543bef54b08e4655832aefe8939 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 20 Jul 2010 11:55:37 -0700 Subject: Prefix all SPL debug macros with 'S' To avoid conflicts with symbols defined by dependent packages all debugging symbols have been prefixed with a 'S' for SPL. Any dependent package needing to integrate with the SPL debug should include the spl-debug.h header and use the 'S' prefixed macros. They must also build with DEBUG defined. --- include/spl-debug.h | 145 ++++++++++++++++++---------------- module/spl/spl-condvar.c | 32 ++++---- module/spl/spl-debug.c | 108 ++++++++++++++----------- module/spl/spl-err.c | 10 +-- module/spl/spl-generic.c | 36 ++++----- module/spl/spl-kmem.c | 200 +++++++++++++++++++++++------------------------ module/spl/spl-kobj.c | 28 +++---- module/spl/spl-kstat.c | 40 ++++++---- module/spl/spl-module.c | 48 ++++++------ module/spl/spl-proc.c | 116 +++++++++++++-------------- module/spl/spl-taskq.c | 88 ++++++++++----------- module/spl/spl-thread.c | 22 +++--- module/spl/spl-vnode.c | 140 ++++++++++++++++----------------- module/spl/spl-xdr.c | 12 ++- 14 files changed, 533 insertions(+), 492 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/include/spl-debug.h b/include/spl-debug.h index b5ca64f87..cf0d58cad 100644 --- a/include/spl-debug.h +++ b/include/spl-debug.h @@ -26,17 +26,17 @@ * Available debug functions. These function should be used by any * package which needs to integrate with the SPL log infrastructure. * - * CDEBUG() - Log debug message with specified mask. - * CDEBUG_LIMIT() - Log just 1 debug message with specified mask. - * CWARN() - Log a warning message. - * CERROR() - Log an error message. - * CEMERG() - Log an emergency error message. - * CONSOLE() - Log a generic message to the console. + * SDEBUG() - Log debug message with specified mask. + * SDEBUG_LIMIT() - Log just 1 debug message with specified mask. + * SWARN() - Log a warning message. + * SERROR() - Log an error message. + * SEMERG() - Log an emergency error message. + * SCONSOLE() - Log a generic message to the console. * - * ENTRY - Log entry point to a function. - * EXIT - Log exit point from a function. - * RETURN(x) - Log return from a function. - * GOTO(x, y) - Log goto within a function. + * SENTRY - Log entry point to a function. + * SEXIT - Log exit point from a function. + * SRETURN(x) - Log return from a function. + * SGOTO(x, y) - Log goto within a function. */ #ifndef _SPL_DEBUG_INTERNAL_H @@ -44,95 +44,104 @@ #include -#define S_UNDEFINED 0x00000001 -#define S_ATOMIC 0x00000002 -#define S_KOBJ 0x00000004 -#define S_VNODE 0x00000008 -#define S_TIME 0x00000010 -#define S_RWLOCK 0x00000020 -#define S_THREAD 0x00000040 -#define S_CONDVAR 0x00000080 -#define S_MUTEX 0x00000100 -#define S_RNG 0x00000200 -#define S_TASKQ 0x00000400 -#define S_KMEM 0x00000800 -#define S_DEBUG 0x00001000 -#define S_GENERIC 0x00002000 -#define S_PROC 0x00004000 -#define S_MODULE 0x00008000 -#define S_CRED 0x00010000 - -#define D_TRACE 0x00000001 -#define D_INFO 0x00000002 -#define D_WARNING 0x00000004 -#define D_ERROR 0x00000008 -#define D_EMERG 0x00000010 -#define D_CONSOLE 0x00000020 -#define D_IOCTL 0x00000040 -#define D_DPRINTF 0x00000080 -#define D_OTHER 0x00000100 - -#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) -#define DEBUG_SUBSYSTEM S_UNDEFINED +#define SS_UNDEFINED 0x00000001 +#define SS_ATOMIC 0x00000002 +#define SS_KOBJ 0x00000004 +#define SS_VNODE 0x00000008 +#define SS_TIME 0x00000010 +#define SS_RWLOCK 0x00000020 +#define SS_THREAD 0x00000040 +#define SS_CONDVAR 0x00000080 +#define SS_MUTEX 0x00000100 +#define SS_RNG 0x00000200 +#define SS_TASKQ 0x00000400 +#define SS_KMEM 0x00000800 +#define SS_DEBUG 0x00001000 +#define SS_GENERIC 0x00002000 +#define SS_PROC 0x00004000 +#define SS_MODULE 0x00008000 +#define SS_CRED 0x00010000 +#define SS_KSTAT 0x00020000 +#define SS_XDR 0x00040000 +#define SS_USER1 0x01000000 +#define SS_USER2 0x02000000 +#define SS_USER3 0x04000000 +#define SS_USER4 0x08000000 +#define SS_USER5 0x10000000 +#define SS_USER6 0x20000000 +#define SS_USER7 0x40000000 +#define SS_USER8 0x80000000 +#define SS_DEBUG_SUBSYS SS_UNDEFINED + +#define SD_TRACE 0x00000001 +#define SD_INFO 0x00000002 +#define SD_WARNING 0x00000004 +#define SD_ERROR 0x00000008 +#define SD_EMERG 0x00000010 +#define SD_CONSOLE 0x00000020 +#define SD_IOCTL 0x00000040 +#define SD_DPRINTF 0x00000080 +#define SD_OTHER 0x00000100 +#define SD_CANTMASK (SD_ERROR | SD_EMERG | SD_WARNING | SD_CONSOLE) #ifdef NDEBUG /* Debugging Disabled */ -#define CDEBUG(mask, fmt, a...) ((void)0) -#define CDEBUG_LIMIT(x, y, fmt, a...) ((void)0) -#define CWARN(fmt, a...) ((void)0) -#define CERROR(fmt, a...) ((void)0) -#define CEMERG(fmt, a...) ((void)0) -#define CONSOLE(mask, fmt, a...) ((void)0) +#define SDEBUG(mask, fmt, a...) ((void)0) +#define SDEBUG_LIMIT(x, y, fmt, a...) ((void)0) +#define SWARN(fmt, a...) ((void)0) +#define SERROR(fmt, a...) ((void)0) +#define SEMERG(fmt, a...) ((void)0) +#define SCONSOLE(mask, fmt, a...) ((void)0) -#define ENTRY ((void)0) -#define EXIT ((void)0) -#define RETURN(x) return (x) -#define GOTO(x, y) { ((void)(y)); goto x; } +#define SENTRY ((void)0) +#define SEXIT ((void)0) +#define SRETURN(x) return (x) +#define SGOTO(x, y) { ((void)(y)); goto x; } #else /* Debugging Enabled */ -#define __CDEBUG(cdls, subsys, mask, format, a...) \ +#define __SDEBUG(cdls, subsys, mask, format, a...) \ do { \ - if (((mask) & D_CANTMASK) != 0 || \ + if (((mask) & SD_CANTMASK) != 0 || \ ((spl_debug_mask & (mask)) != 0 && \ (spl_debug_subsys & (subsys)) != 0)) \ spl_debug_msg(cdls, subsys, mask, __FILE__, \ __FUNCTION__, __LINE__, format, ## a); \ } while (0) -#define CDEBUG(mask, format, a...) \ - __CDEBUG(NULL, DEBUG_SUBSYSTEM, mask, format, ## a) +#define SDEBUG(mask, format, a...) \ + __SDEBUG(NULL, SS_DEBUG_SUBSYS, mask, format, ## a) -#define __CDEBUG_LIMIT(subsys, mask, format, a...) \ +#define __SDEBUG_LIMIT(subsys, mask, format, a...) \ do { \ static spl_debug_limit_state_t cdls; \ \ - __CDEBUG(&cdls, subsys, mask, format, ## a); \ + __SDEBUG(&cdls, subsys, mask, format, ## a); \ } while (0) -#define CDEBUG_LIMIT(mask, format, a...) \ - __CDEBUG_LIMIT(DEBUG_SUBSYSTEM, mask, format, ## a) +#define SDEBUG_LIMIT(mask, format, a...) \ + __SDEBUG_LIMIT(SS_DEBUG_SUBSYS, mask, format, ## a) -#define CWARN(fmt, a...) CDEBUG_LIMIT(D_WARNING, fmt, ## a) -#define CERROR(fmt, a...) CDEBUG_LIMIT(D_ERROR, fmt, ## a) -#define CEMERG(fmt, a...) CDEBUG_LIMIT(D_EMERG, fmt, ## a) -#define CONSOLE(mask, fmt, a...) CDEBUG(D_CONSOLE | (mask), fmt, ## a) +#define SWARN(fmt, a...) SDEBUG_LIMIT(SD_WARNING, fmt, ## a) +#define SERROR(fmt, a...) SDEBUG_LIMIT(SD_ERROR, fmt, ## a) +#define SEMERG(fmt, a...) SDEBUG_LIMIT(SD_EMERG, fmt, ## a) +#define SCONSOLE(mask, fmt, a...) SDEBUG(SD_CONSOLE | (mask), fmt, ## a) -#define ENTRY CDEBUG(D_TRACE, "Process entered\n") -#define EXIT CDEBUG(D_TRACE, "Process leaving\n") +#define SENTRY SDEBUG(SD_TRACE, "Process entered\n") +#define SEXIT SDEBUG(SD_TRACE, "Process leaving\n") -#define RETURN(rc) \ +#define SRETURN(rc) \ do { \ typeof(rc) RETURN__ret = (rc); \ - CDEBUG(D_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ + SDEBUG(SD_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ (long)RETURN__ret, (long)RETURN__ret, (long)RETURN__ret); \ return RETURN__ret; \ } while (0) -#define GOTO(label, rc) \ +#define SGOTO(label, rc) \ do { \ long GOTO__ret = (long)(rc); \ - CDEBUG(D_TRACE,"Process leaving via %s (rc=%lu : %ld : %lx)\n", \ + SDEBUG(SD_TRACE,"Process leaving via %s (rc=%lu : %ld : %lx)\n",\ #label, (unsigned long)GOTO__ret, (signed long)GOTO__ret, \ (signed long)GOTO__ret); \ goto label; \ diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c index 002dcdb45..6b4512472 100644 --- a/module/spl/spl-condvar.c +++ b/module/spl/spl-condvar.c @@ -27,18 +27,18 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_CONDVAR +#define SS_DEBUG_SUBSYS SS_CONDVAR void __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg) { int flags = KM_SLEEP; - ENTRY; + SENTRY; ASSERT(cvp); ASSERT(name); ASSERT(type == CV_DEFAULT); @@ -62,14 +62,14 @@ __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg) if (cvp->cv_name) strcpy(cvp->cv_name, name); - EXIT; + SEXIT; } EXPORT_SYMBOL(__cv_init); void __cv_destroy(kcondvar_t *cvp) { - ENTRY; + SENTRY; ASSERT(cvp); ASSERT(cvp->cv_magic == CV_MAGIC); spin_lock(&cvp->cv_lock); @@ -81,7 +81,7 @@ __cv_destroy(kcondvar_t *cvp) spin_unlock(&cvp->cv_lock); memset(cvp, CV_POISON, sizeof(*cvp)); - EXIT; + SEXIT; } EXPORT_SYMBOL(__cv_destroy); @@ -89,7 +89,7 @@ static void cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state) { DEFINE_WAIT(wait); - ENTRY; + SENTRY; ASSERT(cvp); ASSERT(mp); @@ -116,7 +116,7 @@ cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state) atomic_dec(&cvp->cv_waiters); finish_wait(&cvp->cv_event, &wait); - EXIT; + SEXIT; } void @@ -141,7 +141,7 @@ __cv_timedwait(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time) { DEFINE_WAIT(wait); clock_t time_left; - ENTRY; + SENTRY; ASSERT(cvp); ASSERT(mp); @@ -159,7 +159,7 @@ __cv_timedwait(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time) /* XXX - Does not handle jiffie wrap properly */ time_left = expire_time - jiffies; if (time_left <= 0) - RETURN(-1); + SRETURN(-1); prepare_to_wait_exclusive(&cvp->cv_event, &wait, TASK_UNINTERRUPTIBLE); @@ -175,14 +175,14 @@ __cv_timedwait(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time) atomic_dec(&cvp->cv_waiters); finish_wait(&cvp->cv_event, &wait); - RETURN(time_left > 0 ? time_left : -1); + SRETURN(time_left > 0 ? time_left : -1); } EXPORT_SYMBOL(__cv_timedwait); void __cv_signal(kcondvar_t *cvp) { - ENTRY; + SENTRY; ASSERT(cvp); ASSERT(cvp->cv_magic == CV_MAGIC); @@ -193,7 +193,7 @@ __cv_signal(kcondvar_t *cvp) if (atomic_read(&cvp->cv_waiters) > 0) wake_up(&cvp->cv_event); - EXIT; + SEXIT; } EXPORT_SYMBOL(__cv_signal); @@ -202,13 +202,13 @@ __cv_broadcast(kcondvar_t *cvp) { ASSERT(cvp); ASSERT(cvp->cv_magic == CV_MAGIC); - ENTRY; + SENTRY; /* Wake_up_all() will wake up all waiters even those which * have the WQ_FLAG_EXCLUSIVE flag set. */ if (atomic_read(&cvp->cv_waiters) > 0) wake_up_all(&cvp->cv_event); - EXIT; + SEXIT; } EXPORT_SYMBOL(__cv_broadcast); diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 5284eb339..f6ec86ac4 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -41,23 +41,23 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_DEBUG +#define SS_DEBUG_SUBSYS SS_DEBUG unsigned long spl_debug_subsys = ~0; EXPORT_SYMBOL(spl_debug_subsys); module_param(spl_debug_subsys, ulong, 0644); MODULE_PARM_DESC(spl_debug_subsys, "Subsystem debugging level mask."); -unsigned long spl_debug_mask = (D_EMERG | D_ERROR | D_WARNING | D_CONSOLE); +unsigned long spl_debug_mask = SD_CANTMASK; EXPORT_SYMBOL(spl_debug_mask); module_param(spl_debug_mask, ulong, 0644); MODULE_PARM_DESC(spl_debug_mask, "Debugging level mask."); -unsigned long spl_debug_printk = D_CANTMASK; +unsigned long spl_debug_printk = SD_CANTMASK; EXPORT_SYMBOL(spl_debug_printk); module_param(spl_debug_printk, ulong, 0644); MODULE_PARM_DESC(spl_debug_printk, "Console printk level mask."); @@ -120,40 +120,60 @@ spl_debug_subsys2str(int subsys) switch (subsys) { default: return NULL; - case S_UNDEFINED: + case SS_UNDEFINED: return "undefined"; - case S_ATOMIC: + case SS_ATOMIC: return "atomic"; - case S_KOBJ: + case SS_KOBJ: return "kobj"; - case S_VNODE: + case SS_VNODE: return "vnode"; - case S_TIME: + case SS_TIME: return "time"; - case S_RWLOCK: + case SS_RWLOCK: return "rwlock"; - case S_THREAD: + case SS_THREAD: return "thread"; - case S_CONDVAR: + case SS_CONDVAR: return "condvar"; - case S_MUTEX: + case SS_MUTEX: return "mutex"; - case S_RNG: + case SS_RNG: return "rng"; - case S_TASKQ: + case SS_TASKQ: return "taskq"; - case S_KMEM: + case SS_KMEM: return "kmem"; - case S_DEBUG: + case SS_DEBUG: return "debug"; - case S_GENERIC: + case SS_GENERIC: return "generic"; - case S_PROC: + case SS_PROC: return "proc"; - case S_MODULE: + case SS_MODULE: return "module"; - case S_CRED: + case SS_CRED: return "cred"; + case SS_KSTAT: + return "kstat"; + case SS_XDR: + return "xdr"; + case SS_USER1: + return "user1"; + case SS_USER2: + return "user2"; + case SS_USER3: + return "user3"; + case SS_USER4: + return "user4"; + case SS_USER5: + return "user5"; + case SS_USER6: + return "user6"; + case SS_USER7: + return "user7"; + case SS_USER8: + return "user8"; } } @@ -163,23 +183,23 @@ spl_debug_dbg2str(int debug) switch (debug) { default: return NULL; - case D_TRACE: + case SD_TRACE: return "trace"; - case D_INFO: + case SD_INFO: return "info"; - case D_WARNING: + case SD_WARNING: return "warning"; - case D_ERROR: + case SD_ERROR: return "error"; - case D_EMERG: + case SD_EMERG: return "emerg"; - case D_CONSOLE: + case SD_CONSOLE: return "console"; - case D_IOCTL: + case SD_IOCTL: return "ioctl"; - case D_DPRINTF: + case SD_DPRINTF: return "dprintf"; - case D_OTHER: + case SD_OTHER: return "other"; } } @@ -493,21 +513,21 @@ trace_print_to_console(struct spl_debug_header *hdr, int mask, const char *buf, { char *prefix = "SPL", *ptype = NULL; - if ((mask & D_EMERG) != 0) { + if ((mask & SD_EMERG) != 0) { prefix = "SPLError"; ptype = KERN_EMERG; - } else if ((mask & D_ERROR) != 0) { + } else if ((mask & SD_ERROR) != 0) { prefix = "SPLError"; ptype = KERN_ERR; - } else if ((mask & D_WARNING) != 0) { + } else if ((mask & SD_WARNING) != 0) { prefix = "SPL"; ptype = KERN_WARNING; - } else if ((mask & (D_CONSOLE | spl_debug_printk)) != 0) { + } else if ((mask & (SD_CONSOLE | spl_debug_printk)) != 0) { prefix = "SPL"; ptype = KERN_INFO; } - if ((mask & D_CONSOLE) != 0) { + if ((mask & SD_CONSOLE) != 0) { printk("%s%s: %.*s", ptype, prefix, len, buf); } else { printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix, @@ -652,10 +672,10 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file, int remain; if (subsys == 0) - subsys = DEBUG_SUBSYSTEM; + subsys = SS_DEBUG_SUBSYS; if (mask == 0) - mask = D_EMERG; + mask = SD_EMERG; if (strchr(file, '/')) file = strrchr(file, '/') + 1; @@ -685,7 +705,7 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file, tage = trace_get_tage(tcd, needed + known_size + 1); if (tage == NULL) { if (needed + known_size > PAGE_SIZE) - mask |= D_ERROR; + mask |= SD_ERROR; trace_put_tcd(tcd); tcd = NULL; @@ -698,7 +718,7 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file, max_nob = PAGE_SIZE - tage->used - known_size; if (max_nob <= 0) { printk(KERN_EMERG "negative max_nob: %i\n", max_nob); - mask |= D_ERROR; + mask |= SD_ERROR; trace_put_tcd(tcd); tcd = NULL; goto console; @@ -1069,7 +1089,7 @@ EXPORT_SYMBOL(spl_debug_dumpstack); void spl_debug_bug(char *file, const char *func, const int line, int flags) { spl_debug_catastrophe = 1; - spl_debug_msg(NULL, 0, D_EMERG, file, func, line, "SPL PANIC\n"); + spl_debug_msg(NULL, 0, SD_EMERG, file, func, line, "SPL PANIC\n"); if (in_interrupt()) panic("SPL PANIC in interrupt.\n"); @@ -1104,9 +1124,9 @@ EXPORT_SYMBOL(spl_debug_clear_buffer); int spl_debug_mark_buffer(char *text) { - CDEBUG(D_WARNING, "*************************************\n"); - CDEBUG(D_WARNING, "DEBUG MARKER: %s\n", text); - CDEBUG(D_WARNING, "*************************************\n"); + SDEBUG(SD_WARNING, "*************************************\n"); + SDEBUG(SD_WARNING, "DEBUG MARKER: %s\n", text); + SDEBUG(SD_WARNING, "*************************************\n"); return 0; } diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 1b059f0c8..200028f3b 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -28,11 +28,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_GENERIC +#define SS_DEBUG_SUBSYS SS_GENERIC #ifndef NDEBUG static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; @@ -61,10 +61,10 @@ vcmn_err(int ce, const char *fmt, va_list ap) vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); if (fmt[0] == '!') - CDEBUG(D_INFO, "%s%s%s", + SDEBUG(SD_INFO, "%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); else - CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); + SERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); } } /* vcmn_err() */ EXPORT_SYMBOL(vcmn_err); diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index b875f7d7f..a7083b6d2 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -41,11 +41,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_GENERIC +#define SS_DEBUG_SUBSYS SS_GENERIC char spl_version[16] = "SPL v" SPL_META_VERSION; EXPORT_SYMBOL(spl_version); @@ -67,10 +67,10 @@ int highbit(unsigned long i) { register int h = 1; - ENTRY; + SENTRY; if (i == 0) - RETURN(0); + SRETURN(0); #if BITS_PER_LONG == 64 if (i & 0xffffffff00000000ul) { h += 32; i >>= 32; @@ -91,7 +91,7 @@ highbit(unsigned long i) if (i & 0x2) { h += 1; } - RETURN(h); + SRETURN(h); } EXPORT_SYMBOL(highbit); @@ -447,39 +447,39 @@ __init spl_init(void) return rc; if ((rc = spl_kmem_init())) - GOTO(out1, rc); + SGOTO(out1, rc); if ((rc = spl_mutex_init())) - GOTO(out2, rc); + SGOTO(out2, rc); if ((rc = spl_rw_init())) - GOTO(out3, rc); + SGOTO(out3, rc); if ((rc = spl_taskq_init())) - GOTO(out4, rc); + SGOTO(out4, rc); if ((rc = vn_init())) - GOTO(out5, rc); + SGOTO(out5, rc); if ((rc = proc_init())) - GOTO(out6, rc); + SGOTO(out6, rc); if ((rc = kstat_init())) - GOTO(out7, rc); + SGOTO(out7, rc); if ((rc = set_hostid())) - GOTO(out8, rc = -EADDRNOTAVAIL); + SGOTO(out8, rc = -EADDRNOTAVAIL); #ifndef HAVE_KALLSYMS_LOOKUP_NAME if ((rc = set_kallsyms_lookup_name())) - GOTO(out8, rc = -EADDRNOTAVAIL); + SGOTO(out8, rc = -EADDRNOTAVAIL); #endif /* HAVE_KALLSYMS_LOOKUP_NAME */ if ((rc = spl_kmem_init_kallsyms_lookup())) - GOTO(out8, rc); + SGOTO(out8, rc); printk("SPL: Loaded Solaris Porting Layer v%s\n", SPL_META_VERSION); - RETURN(rc); + SRETURN(rc); out8: kstat_fini(); out7: @@ -505,7 +505,7 @@ out1: static void spl_fini(void) { - ENTRY; + SENTRY; printk("SPL: Unloaded Solaris Porting Layer v%s\n", SPL_META_VERSION); kstat_fini(); diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index e0b7e12e2..100c60230 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -27,11 +27,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -# undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_KMEM +#define SS_DEBUG_SUBSYS SS_KMEM /* * The minimum amount of memory measured in pages to be free at all @@ -416,7 +416,7 @@ kmem_del_init(spinlock_t *lock, struct hlist_head *table, int bits, struct hlist_node *node; struct kmem_debug *p; unsigned long flags; - ENTRY; + SENTRY; spin_lock_irqsave(lock, flags); @@ -432,7 +432,7 @@ kmem_del_init(spinlock_t *lock, struct hlist_head *table, int bits, spin_unlock_irqrestore(lock, flags); - RETURN(NULL); + SRETURN(NULL); } void * @@ -442,13 +442,13 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, void *ptr = NULL; kmem_debug_t *dptr; unsigned long irq_flags; - ENTRY; + SENTRY; dptr = (kmem_debug_t *) kmalloc_nofail(sizeof(kmem_debug_t), flags & ~__GFP_ZERO); if (dptr == NULL) { - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, "debug " + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "debug " "kmem_alloc(%ld, 0x%x) at %s:%d failed (%lld/%llu)\n", sizeof(kmem_debug_t), flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); @@ -456,7 +456,7 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, /* Marked unlikely because we should never be doing this, * we tolerate to up 2 pages but a single page is best. */ if (unlikely((size > PAGE_SIZE*2) && !(flags & KM_NODEBUG))) { - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, "large " + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "large " "kmem_alloc(%llu, 0x%x) at %s:%d (%lld/%llu)\n", (unsigned long long) size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); @@ -469,7 +469,7 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, dptr->kd_func = kstrdup(func, flags & ~__GFP_ZERO); if (unlikely(dptr->kd_func == NULL)) { kfree(dptr); - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "debug kstrdup() at %s:%d failed (%lld/%llu)\n", func, line, kmem_alloc_used_read(), kmem_alloc_max); goto out; @@ -488,7 +488,7 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, if (unlikely(ptr == NULL)) { kfree(dptr->kd_func); kfree(dptr); - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, "kmem_alloc" + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "kmem_alloc" "(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", (unsigned long long) size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); @@ -512,13 +512,13 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, list_add_tail(&dptr->kd_list, &kmem_list); spin_unlock_irqrestore(&kmem_lock, irq_flags); - CDEBUG_LIMIT(D_INFO, + SDEBUG_LIMIT(SD_INFO, "kmem_alloc(%llu, 0x%x) at %s:%d = %p (%lld/%llu)\n", (unsigned long long) size, flags, func, line, ptr, kmem_alloc_used_read(), kmem_alloc_max); } out: - RETURN(ptr); + SRETURN(ptr); } EXPORT_SYMBOL(kmem_alloc_track); @@ -526,7 +526,7 @@ void kmem_free_track(void *ptr, size_t size) { kmem_debug_t *dptr; - ENTRY; + SENTRY; ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, (unsigned long long) size); @@ -541,7 +541,7 @@ kmem_free_track(void *ptr, size_t size) (unsigned long long) size, dptr->kd_func, dptr->kd_line); kmem_alloc_used_sub(size); - CDEBUG_LIMIT(D_INFO, "kmem_free(%p, %llu) (%lld/%llu)\n", ptr, + SDEBUG_LIMIT(SD_INFO, "kmem_free(%p, %llu) (%lld/%llu)\n", ptr, (unsigned long long) size, kmem_alloc_used_read(), kmem_alloc_max); @@ -553,7 +553,7 @@ kmem_free_track(void *ptr, size_t size) memset(ptr, 0x5a, size); kfree(ptr); - EXIT; + SEXIT; } EXPORT_SYMBOL(kmem_free_track); @@ -563,14 +563,14 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) void *ptr = NULL; kmem_debug_t *dptr; unsigned long irq_flags; - ENTRY; + SENTRY; ASSERT(flags & KM_SLEEP); dptr = (kmem_debug_t *) kmalloc_nofail(sizeof(kmem_debug_t), flags & ~__GFP_ZERO); if (dptr == NULL) { - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, "debug " + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "debug " "vmem_alloc(%ld, 0x%x) at %s:%d failed (%lld/%llu)\n", sizeof(kmem_debug_t), flags, func, line, vmem_alloc_used_read(), vmem_alloc_max); @@ -581,7 +581,7 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) dptr->kd_func = kstrdup(func, flags & ~__GFP_ZERO); if (unlikely(dptr->kd_func == NULL)) { kfree(dptr); - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "debug kstrdup() at %s:%d failed (%lld/%llu)\n", func, line, vmem_alloc_used_read(), vmem_alloc_max); goto out; @@ -593,7 +593,7 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) if (unlikely(ptr == NULL)) { kfree(dptr->kd_func); kfree(dptr); - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, "vmem_alloc" + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "vmem_alloc" "(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", (unsigned long long) size, flags, func, line, vmem_alloc_used_read(), vmem_alloc_max); @@ -620,13 +620,13 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) list_add_tail(&dptr->kd_list, &vmem_list); spin_unlock_irqrestore(&vmem_lock, irq_flags); - CDEBUG_LIMIT(D_INFO, + SDEBUG_LIMIT(SD_INFO, "vmem_alloc(%llu, 0x%x) at %s:%d = %p (%lld/%llu)\n", (unsigned long long) size, flags, func, line, ptr, vmem_alloc_used_read(), vmem_alloc_max); } out: - RETURN(ptr); + SRETURN(ptr); } EXPORT_SYMBOL(vmem_alloc_track); @@ -634,7 +634,7 @@ void vmem_free_track(void *ptr, size_t size) { kmem_debug_t *dptr; - ENTRY; + SENTRY; ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, (unsigned long long) size); @@ -648,7 +648,7 @@ vmem_free_track(void *ptr, size_t size) (unsigned long long) size, dptr->kd_func, dptr->kd_line); vmem_alloc_used_sub(size); - CDEBUG_LIMIT(D_INFO, "vmem_free(%p, %llu) (%lld/%llu)\n", ptr, + SDEBUG_LIMIT(SD_INFO, "vmem_free(%p, %llu) (%lld/%llu)\n", ptr, (unsigned long long) size, vmem_alloc_used_read(), vmem_alloc_max); @@ -660,7 +660,7 @@ vmem_free_track(void *ptr, size_t size) memset(ptr, 0x5a, size); vfree(ptr); - EXIT; + SEXIT; } EXPORT_SYMBOL(vmem_free_track); @@ -671,12 +671,12 @@ kmem_alloc_debug(size_t size, int flags, const char *func, int line, int node_alloc, int node) { void *ptr; - ENTRY; + SENTRY; /* Marked unlikely because we should never be doing this, * we tolerate to up 2 pages but a single page is best. */ if (unlikely((size > PAGE_SIZE * 2) && !(flags & KM_NODEBUG))) { - CDEBUG(D_CONSOLE | D_WARNING, + SDEBUG(SD_CONSOLE | SD_WARNING, "Large kmem_alloc(%llu, 0x%x) at %s:%d (%lld/%llu)\n", (unsigned long long) size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); @@ -694,7 +694,7 @@ kmem_alloc_debug(size_t size, int flags, const char *func, int line, } if (ptr == NULL) { - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "kmem_alloc(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", (unsigned long long) size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); @@ -703,32 +703,32 @@ kmem_alloc_debug(size_t size, int flags, const char *func, int line, if (unlikely(kmem_alloc_used_read() > kmem_alloc_max)) kmem_alloc_max = kmem_alloc_used_read(); - CDEBUG_LIMIT(D_INFO, + SDEBUG_LIMIT(SD_INFO, "kmem_alloc(%llu, 0x%x) at %s:%d = %p (%lld/%llu)\n", (unsigned long long) size, flags, func, line, ptr, kmem_alloc_used_read(), kmem_alloc_max); } - RETURN(ptr); + SRETURN(ptr); } EXPORT_SYMBOL(kmem_alloc_debug); void kmem_free_debug(void *ptr, size_t size) { - ENTRY; + SENTRY; ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, (unsigned long long) size); kmem_alloc_used_sub(size); - CDEBUG_LIMIT(D_INFO, "kmem_free(%p, %llu) (%lld/%llu)\n", ptr, + SDEBUG_LIMIT(SD_INFO, "kmem_free(%p, %llu) (%lld/%llu)\n", ptr, (unsigned long long) size, kmem_alloc_used_read(), kmem_alloc_max); memset(ptr, 0x5a, size); kfree(ptr); - EXIT; + SEXIT; } EXPORT_SYMBOL(kmem_free_debug); @@ -736,14 +736,14 @@ void * vmem_alloc_debug(size_t size, int flags, const char *func, int line) { void *ptr; - ENTRY; + SENTRY; ASSERT(flags & KM_SLEEP); ptr = __vmalloc(size, (flags | __GFP_HIGHMEM) & ~__GFP_ZERO, PAGE_KERNEL); if (ptr == NULL) { - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "vmem_alloc(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", (unsigned long long) size, flags, func, line, vmem_alloc_used_read(), vmem_alloc_max); @@ -755,32 +755,32 @@ vmem_alloc_debug(size_t size, int flags, const char *func, int line) if (unlikely(vmem_alloc_used_read() > vmem_alloc_max)) vmem_alloc_max = vmem_alloc_used_read(); - CDEBUG_LIMIT(D_INFO, "vmem_alloc(%llu, 0x%x) = %p " + SDEBUG_LIMIT(SD_INFO, "vmem_alloc(%llu, 0x%x) = %p " "(%lld/%llu)\n", (unsigned long long) size, flags, ptr, vmem_alloc_used_read(), vmem_alloc_max); } - RETURN(ptr); + SRETURN(ptr); } EXPORT_SYMBOL(vmem_alloc_debug); void vmem_free_debug(void *ptr, size_t size) { - ENTRY; + SENTRY; ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, (unsigned long long) size); vmem_alloc_used_sub(size); - CDEBUG_LIMIT(D_INFO, "vmem_free(%p, %llu) (%lld/%llu)\n", ptr, + SDEBUG_LIMIT(SD_INFO, "vmem_free(%p, %llu) (%lld/%llu)\n", ptr, (unsigned long long) size, vmem_alloc_used_read(), vmem_alloc_max); memset(ptr, 0x5a, size); vfree(ptr); - EXIT; + SEXIT; } EXPORT_SYMBOL(vmem_free_debug); @@ -901,7 +901,7 @@ spl_slab_alloc(spl_kmem_cache_t *skc, int flags) base = kv_alloc(skc, skc->skc_slab_size, flags); if (base == NULL) - RETURN(NULL); + SRETURN(NULL); sks = (spl_kmem_slab_t *)base; sks->sks_magic = SKS_MAGIC; @@ -920,7 +920,7 @@ spl_slab_alloc(spl_kmem_cache_t *skc, int flags) if (skc->skc_flags & KMC_OFFSLAB) { obj = kv_alloc(skc, offslab_size, flags); if (!obj) - GOTO(out, rc = -ENOMEM); + SGOTO(out, rc = -ENOMEM); } else { obj = base + spl_sks_size(skc) + (i * obj_size); } @@ -948,7 +948,7 @@ out: sks = NULL; } - RETURN(sks); + SRETURN(sks); } /* @@ -961,7 +961,7 @@ spl_slab_free(spl_kmem_slab_t *sks, struct list_head *sks_list, struct list_head *sko_list) { spl_kmem_cache_t *skc; - ENTRY; + SENTRY; ASSERT(sks->sks_magic == SKS_MAGIC); ASSERT(sks->sks_ref == 0); @@ -982,7 +982,7 @@ spl_slab_free(spl_kmem_slab_t *sks, list_add(&sks->sks_list, sks_list); list_splice_init(&sks->sks_free_list, sko_list); - EXIT; + SEXIT; } /* @@ -1002,7 +1002,7 @@ spl_slab_reclaim(spl_kmem_cache_t *skc, int count, int flag) LIST_HEAD(sko_list); uint32_t size = 0; int i = 0; - ENTRY; + SENTRY; /* * Move empty slabs and objects which have not been touched in @@ -1057,7 +1057,7 @@ spl_slab_reclaim(spl_kmem_cache_t *skc, int count, int flag) cond_resched(); } - EXIT; + SEXIT; } /* @@ -1136,7 +1136,7 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size) for (*size = PAGE_SIZE; *size <= max_size; *size *= 2) { *objs = (*size - sks_size) / obj_size; if (*objs >= SPL_KMEM_CACHE_OBJ_PER_SLAB) - RETURN(0); + SRETURN(0); } /* @@ -1147,10 +1147,10 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size) *size = max_size; *objs = (*size - sks_size) / obj_size; if (*objs >= SPL_KMEM_CACHE_OBJ_PER_SLAB_MIN) - RETURN(0); + SRETURN(0); } - RETURN(-ENOSPC); + SRETURN(-ENOSPC); } /* @@ -1163,7 +1163,7 @@ spl_magazine_size(spl_kmem_cache_t *skc) { uint32_t obj_size = spl_obj_size(skc); int size; - ENTRY; + SENTRY; /* Per-magazine sizes below assume a 4Kib page size */ if (obj_size > (PAGE_SIZE * 256)) @@ -1177,7 +1177,7 @@ spl_magazine_size(spl_kmem_cache_t *skc) else size = 256; - RETURN(size); + SRETURN(size); } /* @@ -1189,7 +1189,7 @@ spl_magazine_alloc(spl_kmem_cache_t *skc, int node) spl_kmem_magazine_t *skm; int size = sizeof(spl_kmem_magazine_t) + sizeof(void *) * skc->skc_mag_size; - ENTRY; + SENTRY; skm = kmem_alloc_node(size, KM_SLEEP, node); if (skm) { @@ -1202,7 +1202,7 @@ spl_magazine_alloc(spl_kmem_cache_t *skc, int node) skm->skm_age = jiffies; } - RETURN(skm); + SRETURN(skm); } /* @@ -1214,12 +1214,12 @@ spl_magazine_free(spl_kmem_magazine_t *skm) int size = sizeof(spl_kmem_magazine_t) + sizeof(void *) * skm->skm_size; - ENTRY; + SENTRY; ASSERT(skm->skm_magic == SKM_MAGIC); ASSERT(skm->skm_avail == 0); kmem_free(skm, size); - EXIT; + SEXIT; } /* @@ -1229,7 +1229,7 @@ static int spl_magazine_create(spl_kmem_cache_t *skc) { int i; - ENTRY; + SENTRY; skc->skc_mag_size = spl_magazine_size(skc); skc->skc_mag_refill = (skc->skc_mag_size + 1) / 2; @@ -1240,7 +1240,7 @@ spl_magazine_create(spl_kmem_cache_t *skc) for (i--; i >= 0; i--) spl_magazine_free(skc->skc_mag[i]); - RETURN(-ENOMEM); + SRETURN(-ENOMEM); } } @@ -1249,7 +1249,7 @@ spl_magazine_create(spl_kmem_cache_t *skc) schedule_delayed_work_on(i, &skc->skc_mag[i]->skm_work, skc->skc_delay / 3 * HZ); - RETURN(0); + SRETURN(0); } /* @@ -1260,7 +1260,7 @@ spl_magazine_destroy(spl_kmem_cache_t *skc) { spl_kmem_magazine_t *skm; int i; - ENTRY; + SENTRY; for_each_online_cpu(i) { skm = skc->skc_mag[i]; @@ -1268,7 +1268,7 @@ spl_magazine_destroy(spl_kmem_cache_t *skc) spl_magazine_free(skm); } - EXIT; + SEXIT; } /* @@ -1300,7 +1300,7 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, { spl_kmem_cache_t *skc; int rc, kmem_flags = KM_SLEEP; - ENTRY; + SENTRY; ASSERTF(!(flags & KMC_NOMAGAZINE), "Bad KMC_NOMAGAZINE (%x)\n", flags); ASSERTF(!(flags & KMC_NOHASH), "Bad KMC_NOHASH (%x)\n", flags); @@ -1321,14 +1321,14 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, skc = (spl_kmem_cache_t *)kmem_zalloc(sizeof(*skc), kmem_flags | KM_NODEBUG); if (skc == NULL) - RETURN(NULL); + SRETURN(NULL); skc->skc_magic = SKC_MAGIC; skc->skc_name_size = strlen(name) + 1; skc->skc_name = (char *)kmem_alloc(skc->skc_name_size, kmem_flags); if (skc->skc_name == NULL) { kmem_free(skc, sizeof(*skc)); - RETURN(NULL); + SRETURN(NULL); } strncpy(skc->skc_name, name, skc->skc_name_size); @@ -1375,11 +1375,11 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, rc = spl_slab_size(skc, &skc->skc_slab_objs, &skc->skc_slab_size); if (rc) - GOTO(out, rc); + SGOTO(out, rc); rc = spl_magazine_create(skc); if (rc) - GOTO(out, rc); + SGOTO(out, rc); spl_init_delayed_work(&skc->skc_work, spl_cache_age, skc); schedule_delayed_work(&skc->skc_work, skc->skc_delay / 3 * HZ); @@ -1388,11 +1388,11 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, list_add_tail(&skc->skc_list, &spl_kmem_cache_list); up_write(&spl_kmem_cache_sem); - RETURN(skc); + SRETURN(skc); out: kmem_free(skc->skc_name, skc->skc_name_size); kmem_free(skc, sizeof(*skc)); - RETURN(NULL); + SRETURN(NULL); } EXPORT_SYMBOL(spl_kmem_cache_create); @@ -1404,7 +1404,7 @@ spl_kmem_cache_destroy(spl_kmem_cache_t *skc) { DECLARE_WAIT_QUEUE_HEAD(wq); int i; - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); @@ -1442,7 +1442,7 @@ spl_kmem_cache_destroy(spl_kmem_cache_t *skc) kmem_free(skc, sizeof(*skc)); - EXIT; + SEXIT; } EXPORT_SYMBOL(spl_kmem_cache_destroy); @@ -1495,7 +1495,7 @@ static spl_kmem_slab_t * spl_cache_grow(spl_kmem_cache_t *skc, int flags) { spl_kmem_slab_t *sks; - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); local_irq_enable(); @@ -1508,13 +1508,13 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags) */ if (test_bit(KMC_BIT_REAPING, &skc->skc_flags)) { schedule(); - GOTO(out, sks= NULL); + SGOTO(out, sks= NULL); } /* Allocate a new slab for the cache */ sks = spl_slab_alloc(skc, flags | __GFP_NORETRY | KM_NODEBUG); if (sks == NULL) - GOTO(out, sks = NULL); + SGOTO(out, sks = NULL); /* Link the new empty slab in to the end of skc_partial_list. */ spin_lock(&skc->skc_lock); @@ -1525,7 +1525,7 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags) out: local_irq_disable(); - RETURN(sks); + SRETURN(sks); } /* @@ -1539,7 +1539,7 @@ spl_cache_refill(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flags) { spl_kmem_slab_t *sks; int rc = 0, refill; - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(skm->skm_magic == SKM_MAGIC); @@ -1554,11 +1554,11 @@ spl_cache_refill(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flags) sks = spl_cache_grow(skc, flags); if (!sks) - GOTO(out, rc); + SGOTO(out, rc); /* Rescheduled to different CPU skm is not local */ if (skm != skc->skc_mag[smp_processor_id()]) - GOTO(out, rc); + SGOTO(out, rc); /* Potentially rescheduled to the same CPU but * allocations may have occured from this CPU while @@ -1594,7 +1594,7 @@ spl_cache_refill(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flags) spin_unlock(&skc->skc_lock); out: /* Returns the number of entries added to cache */ - RETURN(rc); + SRETURN(rc); } /* @@ -1605,7 +1605,7 @@ spl_cache_shrink(spl_kmem_cache_t *skc, void *obj) { spl_kmem_slab_t *sks = NULL; spl_kmem_obj_t *sko = NULL; - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(spin_is_locked(&skc->skc_lock)); @@ -1637,7 +1637,7 @@ spl_cache_shrink(spl_kmem_cache_t *skc, void *obj) skc->skc_slab_alloc--; } - EXIT; + SEXIT; } /* @@ -1651,7 +1651,7 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) { int i, count = MIN(flush, skm->skm_avail); - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(skm->skm_magic == SKM_MAGIC); @@ -1673,7 +1673,7 @@ spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) spin_unlock(&skc->skc_lock); - RETURN(count); + SRETURN(count); } /* @@ -1686,7 +1686,7 @@ spl_kmem_cache_alloc(spl_kmem_cache_t *skc, int flags) spl_kmem_magazine_t *skm; unsigned long irq_flags; void *obj = NULL; - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(!test_bit(KMC_BIT_DESTROY, &skc->skc_flags)); @@ -1712,7 +1712,7 @@ restart: /* Per-CPU cache empty, directly allocate from * the slab and refill the per-CPU cache. */ (void)spl_cache_refill(skc, skm, flags); - GOTO(restart, obj = NULL); + SGOTO(restart, obj = NULL); } local_irq_restore(irq_flags); @@ -1723,7 +1723,7 @@ restart: prefetchw(obj); atomic_dec(&skc->skc_ref); - RETURN(obj); + SRETURN(obj); } EXPORT_SYMBOL(spl_kmem_cache_alloc); @@ -1738,7 +1738,7 @@ spl_kmem_cache_free(spl_kmem_cache_t *skc, void *obj) { spl_kmem_magazine_t *skm; unsigned long flags; - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(!test_bit(KMC_BIT_DESTROY, &skc->skc_flags)); @@ -1762,7 +1762,7 @@ spl_kmem_cache_free(spl_kmem_cache_t *skc, void *obj) local_irq_restore(flags); atomic_dec(&skc->skc_ref); - EXIT; + SEXIT; } EXPORT_SYMBOL(spl_kmem_cache_free); @@ -1814,14 +1814,14 @@ spl_kmem_cache_generic_shrinker(int nr_to_scan, unsigned int gfp_mask) void spl_kmem_cache_reap_now(spl_kmem_cache_t *skc) { - ENTRY; + SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(!test_bit(KMC_BIT_DESTROY, &skc->skc_flags)); /* Prevent concurrent cache reaping when contended */ if (test_and_set_bit(KMC_BIT_REAPING, &skc->skc_flags)) { - EXIT; + SEXIT; return; } @@ -1834,7 +1834,7 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc) clear_bit(KMC_BIT_REAPING, &skc->skc_flags); atomic_dec(&skc->skc_ref); - EXIT; + SEXIT; } EXPORT_SYMBOL(spl_kmem_cache_reap_now); @@ -1894,7 +1894,7 @@ static int spl_kmem_init_tracking(struct list_head *list, spinlock_t *lock, int size) { int i; - ENTRY; + SENTRY; spin_lock_init(lock); INIT_LIST_HEAD(list); @@ -1902,7 +1902,7 @@ spl_kmem_init_tracking(struct list_head *list, spinlock_t *lock, int size) for (i = 0; i < size; i++) INIT_HLIST_HEAD(&kmem_table[i]); - RETURN(0); + SRETURN(0); } static void @@ -1911,7 +1911,7 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock) unsigned long flags; kmem_debug_t *kd; char str[17]; - ENTRY; + SENTRY; spin_lock_irqsave(lock, flags); if (!list_empty(list)) @@ -1924,7 +1924,7 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock) kd->kd_func, kd->kd_line); spin_unlock_irqrestore(lock, flags); - EXIT; + SEXIT; } #else /* DEBUG_KMEM && DEBUG_KMEM_TRACKING */ #define spl_kmem_init_tracking(list, lock, size) @@ -2031,7 +2031,7 @@ int spl_kmem_init(void) { int rc = 0; - ENTRY; + SENTRY; init_rwsem(&spl_kmem_cache_sem); INIT_LIST_HEAD(&spl_kmem_cache_list); @@ -2040,7 +2040,7 @@ spl_kmem_init(void) spl_kmem_cache_shrinker = set_shrinker(KMC_DEFAULT_SEEKS, spl_kmem_cache_generic_shrinker); if (spl_kmem_cache_shrinker == NULL) - RETURN(rc = -ENOMEM); + SRETURN(rc = -ENOMEM); #else register_shrinker(&spl_kmem_cache_shrinker); #endif @@ -2052,7 +2052,7 @@ spl_kmem_init(void) spl_kmem_init_tracking(&kmem_list, &kmem_lock, KMEM_TABLE_SIZE); spl_kmem_init_tracking(&vmem_list, &vmem_lock, VMEM_TABLE_SIZE); #endif - RETURN(rc); + SRETURN(rc); } void @@ -2064,20 +2064,20 @@ spl_kmem_fini(void) * at that address to aid in debugging. Performance is not * a serious concern here since it is module unload time. */ if (kmem_alloc_used_read() != 0) - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "kmem leaked %ld/%ld bytes\n", kmem_alloc_used_read(), kmem_alloc_max); if (vmem_alloc_used_read() != 0) - CDEBUG_LIMIT(D_CONSOLE | D_WARNING, + SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "vmem leaked %ld/%ld bytes\n", vmem_alloc_used_read(), vmem_alloc_max); spl_kmem_fini_tracking(&kmem_list, &kmem_lock); spl_kmem_fini_tracking(&vmem_list, &vmem_lock); #endif /* DEBUG_KMEM */ - ENTRY; + SENTRY; #ifdef HAVE_SET_SHRINKER remove_shrinker(spl_kmem_cache_shrinker); @@ -2085,5 +2085,5 @@ spl_kmem_fini(void) unregister_shrinker(&spl_kmem_cache_shrinker); #endif - EXIT; + SEXIT; } diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index d58a9892b..226a12971 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -27,11 +27,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_KOBJ +#define SS_DEBUG_SUBSYS SS_KOBJ struct _buf * kobj_open_file(const char *name) @@ -39,39 +39,39 @@ kobj_open_file(const char *name) struct _buf *file; vnode_t *vp; int rc; - ENTRY; + SENTRY; file = kmalloc(sizeof(_buf_t), GFP_KERNEL); if (file == NULL) - RETURN((_buf_t *)-1UL); + SRETURN((_buf_t *)-1UL); if ((rc = vn_open(name, UIO_SYSSPACE, FREAD, 0644, &vp, 0, 0))) { kfree(file); - RETURN((_buf_t *)-1UL); + SRETURN((_buf_t *)-1UL); } file->vp = vp; - RETURN(file); + SRETURN(file); } /* kobj_open_file() */ EXPORT_SYMBOL(kobj_open_file); void kobj_close_file(struct _buf *file) { - ENTRY; + SENTRY; VOP_CLOSE(file->vp, 0, 0, 0, 0, 0); VN_RELE(file->vp); kfree(file); - EXIT; + SEXIT; } /* kobj_close_file() */ EXPORT_SYMBOL(kobj_close_file); int kobj_read_file(struct _buf *file, char *buf, ssize_t size, offset_t off) { - ENTRY; - RETURN(vn_rdwr(UIO_READ, file->vp, buf, size, off, + SENTRY; + SRETURN(vn_rdwr(UIO_READ, file->vp, buf, size, off, UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL)); } /* kobj_read_file() */ EXPORT_SYMBOL(kobj_read_file); @@ -81,14 +81,14 @@ kobj_get_filesize(struct _buf *file, uint64_t *size) { vattr_t vap; int rc; - ENTRY; + SENTRY; rc = VOP_GETATTR(file->vp, &vap, 0, 0, NULL); if (rc) - RETURN(rc); + SRETURN(rc); *size = vap.va_size; - RETURN(rc); + SRETURN(rc); } /* kobj_get_filesize() */ EXPORT_SYMBOL(kobj_get_filesize); diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 238f37ae3..5be1c21fc 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -28,6 +28,12 @@ #include #include +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS +#endif + +#define SS_DEBUG_SUBSYS SS_KSTAT + static spinlock_t kstat_lock; static struct list_head kstat_list; static kid_t kstat_id; @@ -221,7 +227,7 @@ static void * kstat_seq_data_addr(kstat_t *ksp, loff_t n) { void *rc = NULL; - ENTRY; + SENTRY; switch (ksp->ks_type) { case KSTAT_TYPE_RAW: @@ -243,7 +249,7 @@ kstat_seq_data_addr(kstat_t *ksp, loff_t n) PANIC("Undefined kstat type %d\n", ksp->ks_type); } - RETURN(rc); + SRETURN(rc); } static void * @@ -252,7 +258,7 @@ kstat_seq_start(struct seq_file *f, loff_t *pos) loff_t n = *pos; kstat_t *ksp = (kstat_t *)f->private; ASSERT(ksp->ks_magic == KS_MAGIC); - ENTRY; + SENTRY; spin_lock(&ksp->ks_lock); ksp->ks_snaptime = gethrtime(); @@ -261,9 +267,9 @@ kstat_seq_start(struct seq_file *f, loff_t *pos) kstat_seq_show_headers(f); if (n >= ksp->ks_ndata) - RETURN(NULL); + SRETURN(NULL); - RETURN(kstat_seq_data_addr(ksp, n)); + SRETURN(kstat_seq_data_addr(ksp, n)); } static void * @@ -271,13 +277,13 @@ kstat_seq_next(struct seq_file *f, void *p, loff_t *pos) { kstat_t *ksp = (kstat_t *)f->private; ASSERT(ksp->ks_magic == KS_MAGIC); - ENTRY; + SENTRY; ++*pos; if (*pos >= ksp->ks_ndata) - RETURN(NULL); + SRETURN(NULL); - RETURN(kstat_seq_data_addr(ksp, *pos)); + SRETURN(kstat_seq_data_addr(ksp, *pos)); } static void @@ -401,7 +407,7 @@ __kstat_install(kstat_t *ksp) struct proc_dir_entry *de_module, *de_name; kstat_t *tmp; int rc = 0; - ENTRY; + SENTRY; spin_lock(&kstat_lock); @@ -409,7 +415,7 @@ __kstat_install(kstat_t *ksp) list_for_each_entry(tmp, &kstat_list, ks_list) { if (tmp == ksp) { spin_unlock(&kstat_lock); - GOTO(out, rc = -EEXIST); + SGOTO(out, rc = -EEXIST); } } @@ -420,12 +426,12 @@ __kstat_install(kstat_t *ksp) if (de_module == NULL) { de_module = proc_mkdir(ksp->ks_module, proc_spl_kstat); if (de_module == NULL) - GOTO(out, rc = -EUNATCH); + SGOTO(out, rc = -EUNATCH); } de_name = create_proc_entry(ksp->ks_name, 0444, de_module); if (de_name == NULL) - GOTO(out, rc = -EUNATCH); + SGOTO(out, rc = -EUNATCH); spin_lock(&ksp->ks_lock); ksp->ks_proc = de_name; @@ -439,7 +445,7 @@ out: spin_unlock(&kstat_lock); } - EXIT; + SEXIT; } EXPORT_SYMBOL(__kstat_install); @@ -473,18 +479,18 @@ EXPORT_SYMBOL(__kstat_delete); int kstat_init(void) { - ENTRY; + SENTRY; spin_lock_init(&kstat_lock); INIT_LIST_HEAD(&kstat_list); kstat_id = 0; - RETURN(0); + SRETURN(0); } void kstat_fini(void) { - ENTRY; + SENTRY; ASSERT(list_empty(&kstat_list)); - EXIT; + SEXIT; } diff --git a/module/spl/spl-module.c b/module/spl/spl-module.c index 787a4480e..ee6bd696a 100644 --- a/module/spl/spl-module.c +++ b/module/spl/spl-module.c @@ -27,11 +27,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_MODULE +#define SS_DEBUG_SUBSYS SS_MODULE static spinlock_t dev_info_lock = SPIN_LOCK_UNLOCKED; static LIST_HEAD(dev_info_list); @@ -98,7 +98,7 @@ __ddi_create_minor_node(dev_info_t *di, char *name, int spec_type, struct cb_ops *cb_ops; struct file_operations *fops; int rc; - ENTRY; + SENTRY; ASSERT(spec_type == S_IFCHR); ASSERT(minor_num < di->di_minors); @@ -106,12 +106,12 @@ __ddi_create_minor_node(dev_info_t *di, char *name, int spec_type, fops = kzalloc(sizeof(struct file_operations), GFP_KERNEL); if (fops == NULL) - RETURN(DDI_FAILURE); + SRETURN(DDI_FAILURE); cdev = cdev_alloc(); if (cdev == NULL) { kfree(fops); - RETURN(DDI_FAILURE); + SRETURN(DDI_FAILURE); } cdev->ops = fops; @@ -169,11 +169,11 @@ __ddi_create_minor_node(dev_info_t *di, char *name, int spec_type, rc = cdev_add(cdev, di->di_dev, 1); if (rc) { - CERROR("Error adding cdev, %d\n", rc); + SERROR("Error adding cdev, %d\n", rc); kfree(fops); cdev_del(cdev); mutex_exit(&di->di_lock); - RETURN(DDI_FAILURE); + SRETURN(DDI_FAILURE); } spin_lock(&dev_info_lock); @@ -182,7 +182,7 @@ __ddi_create_minor_node(dev_info_t *di, char *name, int spec_type, mutex_exit(&di->di_lock); - RETURN(DDI_SUCCESS); + SRETURN(DDI_SUCCESS); } EXPORT_SYMBOL(__ddi_create_minor_node); @@ -202,18 +202,18 @@ __ddi_remove_minor_node_locked(dev_info_t *di, char *name) void __ddi_remove_minor_node(dev_info_t *di, char *name) { - ENTRY; + SENTRY; mutex_enter(&di->di_lock); __ddi_remove_minor_node_locked(di, name); mutex_exit(&di->di_lock); - EXIT; + SEXIT; } EXPORT_SYMBOL(__ddi_remove_minor_node); int ddi_quiesce_not_needed(dev_info_t *dip) { - RETURN(DDI_SUCCESS); + SRETURN(DDI_SUCCESS); } EXPORT_SYMBOL(ddi_quiesce_not_needed); @@ -280,12 +280,12 @@ __mod_install(struct modlinkage *modlp) struct modldrv *drv = modlp->ml_modldrv; struct dev_info *di; int rc; - ENTRY; + SENTRY; di = dev_info_alloc(modlp->ml_major, modlp->ml_minors, drv->drv_dev_ops); if (di == NULL) - RETURN(ENOMEM); + SRETURN(ENOMEM); /* XXX: Really we need to be calling devo_probe if it's available * and then calling devo_attach for each device discovered. However @@ -294,12 +294,12 @@ __mod_install(struct modlinkage *modlp) rc = drv->drv_dev_ops->devo_attach(di, DDI_ATTACH); if (rc != DDI_SUCCESS) { dev_info_free(di); - RETURN(rc); + SRETURN(rc); } drv->drv_dev_info = di; - RETURN(DDI_SUCCESS); + SRETURN(DDI_SUCCESS); } EXPORT_SYMBOL(__mod_install); @@ -333,16 +333,16 @@ __mod_remove(struct modlinkage *modlp) struct modldrv *drv = modlp->ml_modldrv; struct dev_info *di = drv->drv_dev_info; int rc; - ENTRY; + SENTRY; rc = drv->drv_dev_ops->devo_detach(di, DDI_DETACH); if (rc != DDI_SUCCESS) - RETURN(rc); + SRETURN(rc); dev_info_free(di); drv->drv_dev_info = NULL; - RETURN(DDI_SUCCESS); + SRETURN(DDI_SUCCESS); } EXPORT_SYMBOL(__mod_remove); @@ -350,28 +350,28 @@ int ldi_ident_from_mod(struct modlinkage *modlp, ldi_ident_t *lip) { ldi_ident_t li; - ENTRY; + SENTRY; ASSERT(modlp); ASSERT(lip); li = kmalloc(sizeof(struct ldi_ident), GFP_KERNEL); if (li == NULL) - RETURN(ENOMEM); + SRETURN(ENOMEM); li->li_dev = MKDEV(modlp->ml_major, 0); *lip = li; - RETURN(0); + SRETURN(0); } EXPORT_SYMBOL(ldi_ident_from_mod); void ldi_ident_release(ldi_ident_t lip) { - ENTRY; + SENTRY; ASSERT(lip); kfree(lip); - EXIT; + SEXIT; } EXPORT_SYMBOL(ldi_ident_release); diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index bc6dac5b8..789d8e129 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -31,11 +31,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_PROC +#define SS_DEBUG_SUBSYS SS_PROC #ifdef DEBUG_KMEM static unsigned long table_min = 0; @@ -217,21 +217,21 @@ SPL_PROC_HANDLER(proc_dobitmasks) int is_printk = (mask == &spl_debug_printk) ? 1 : 0; int size = 512, rc; char *str; - ENTRY; + SENTRY; str = kmem_alloc(size, KM_SLEEP); if (str == NULL) - RETURN(-ENOMEM); + SRETURN(-ENOMEM); if (write) { rc = proc_copyin_string(str, size, buffer, *lenp); if (rc < 0) - RETURN(rc); + SRETURN(rc); rc = spl_debug_str2mask(mask, str, is_subsys); /* Always print BUG/ASSERT to console, so keep this mask */ if (is_printk) - *mask |= D_EMERG; + *mask |= SD_EMERG; *ppos += *lenp; } else { @@ -248,19 +248,19 @@ SPL_PROC_HANDLER(proc_dobitmasks) } kmem_free(str, size); - RETURN(rc); + SRETURN(rc); } SPL_PROC_HANDLER(proc_debug_mb) { char str[32]; int rc, len; - ENTRY; + SENTRY; if (write) { rc = proc_copyin_string(str, sizeof(str), buffer, *lenp); if (rc < 0) - RETURN(rc); + SRETURN(rc); rc = spl_debug_set_mb(simple_strtoul(str, NULL, 0)); *ppos += *lenp; @@ -277,12 +277,12 @@ SPL_PROC_HANDLER(proc_debug_mb) } } - RETURN(rc); + SRETURN(rc); } SPL_PROC_HANDLER(proc_dump_kernel) { - ENTRY; + SENTRY; if (write) { spl_debug_dumplog(0); @@ -291,19 +291,19 @@ SPL_PROC_HANDLER(proc_dump_kernel) *lenp = 0; } - RETURN(0); + SRETURN(0); } SPL_PROC_HANDLER(proc_force_bug) { - ENTRY; + SENTRY; if (write) PANIC("Crashing due to forced panic\n"); else *lenp = 0; - RETURN(0); + SRETURN(0); } SPL_PROC_HANDLER(proc_console_max_delay_cs) @@ -311,7 +311,7 @@ SPL_PROC_HANDLER(proc_console_max_delay_cs) int rc, max_delay_cs; struct ctl_table dummy = *table; long d; - ENTRY; + SENTRY; dummy.data = &max_delay_cs; dummy.proc_handler = &proc_dointvec; @@ -320,14 +320,14 @@ SPL_PROC_HANDLER(proc_console_max_delay_cs) max_delay_cs = 0; rc = spl_proc_dointvec(&dummy,write,filp,buffer,lenp,ppos); if (rc < 0) - RETURN(rc); + SRETURN(rc); if (max_delay_cs <= 0) - RETURN(-EINVAL); + SRETURN(-EINVAL); d = (max_delay_cs * HZ) / 100; if (d == 0 || d < spl_console_min_delay) - RETURN(-EINVAL); + SRETURN(-EINVAL); spl_console_max_delay = d; } else { @@ -335,7 +335,7 @@ SPL_PROC_HANDLER(proc_console_max_delay_cs) rc = spl_proc_dointvec(&dummy,write,filp,buffer,lenp,ppos); } - RETURN(rc); + SRETURN(rc); } SPL_PROC_HANDLER(proc_console_min_delay_cs) @@ -343,7 +343,7 @@ SPL_PROC_HANDLER(proc_console_min_delay_cs) int rc, min_delay_cs; struct ctl_table dummy = *table; long d; - ENTRY; + SENTRY; dummy.data = &min_delay_cs; dummy.proc_handler = &proc_dointvec; @@ -352,14 +352,14 @@ SPL_PROC_HANDLER(proc_console_min_delay_cs) min_delay_cs = 0; rc = spl_proc_dointvec(&dummy,write,filp,buffer,lenp,ppos); if (rc < 0) - RETURN(rc); + SRETURN(rc); if (min_delay_cs <= 0) - RETURN(-EINVAL); + SRETURN(-EINVAL); d = (min_delay_cs * HZ) / 100; if (d == 0 || d > spl_console_max_delay) - RETURN(-EINVAL); + SRETURN(-EINVAL); spl_console_min_delay = d; } else { @@ -367,14 +367,14 @@ SPL_PROC_HANDLER(proc_console_min_delay_cs) rc = spl_proc_dointvec(&dummy,write,filp,buffer,lenp,ppos); } - RETURN(rc); + SRETURN(rc); } SPL_PROC_HANDLER(proc_console_backoff) { int rc, backoff; struct ctl_table dummy = *table; - ENTRY; + SENTRY; dummy.data = &backoff; dummy.proc_handler = &proc_dointvec; @@ -383,10 +383,10 @@ SPL_PROC_HANDLER(proc_console_backoff) backoff = 0; rc = spl_proc_dointvec(&dummy,write,filp,buffer,lenp,ppos); if (rc < 0) - RETURN(rc); + SRETURN(rc); if (backoff <= 0) - RETURN(-EINVAL); + SRETURN(-EINVAL); spl_console_backoff = backoff; } else { @@ -394,7 +394,7 @@ SPL_PROC_HANDLER(proc_console_backoff) rc = spl_proc_dointvec(&dummy,write,filp,buffer,lenp,ppos); } - RETURN(rc); + SRETURN(rc); } #ifdef DEBUG_KMEM @@ -403,7 +403,7 @@ SPL_PROC_HANDLER(proc_domemused) int rc = 0; unsigned long min = 0, max = ~0, val; struct ctl_table dummy = *table; - ENTRY; + SENTRY; dummy.data = &val; dummy.proc_handler = &proc_dointvec; @@ -422,7 +422,7 @@ SPL_PROC_HANDLER(proc_domemused) buffer, lenp, ppos); } - RETURN(rc); + SRETURN(rc); } #endif /* DEBUG_KMEM */ @@ -431,7 +431,7 @@ SPL_PROC_HANDLER(proc_dohostid) int len, rc = 0; int32_t val; char *end, str[32]; - ENTRY; + SENTRY; if (write) { /* We can't use spl_proc_doulongvec_minmax() in the write @@ -439,11 +439,11 @@ SPL_PROC_HANDLER(proc_dohostid) * leading 0x which confuses the helper function. */ rc = proc_copyin_string(str, sizeof(str), buffer, *lenp); if (rc < 0) - RETURN(rc); + SRETURN(rc); val = simple_strtol(str, &end, 16); if (str == end) - RETURN(-EINVAL); + SRETURN(-EINVAL); spl_hostid = (long) val; (void) snprintf(hw_serial, HW_HOSTID_LEN, "%u", @@ -463,7 +463,7 @@ SPL_PROC_HANDLER(proc_dohostid) } } - RETURN(rc); + SRETURN(rc); } #ifndef HAVE_KALLSYMS_LOOKUP_NAME @@ -471,24 +471,24 @@ SPL_PROC_HANDLER(proc_dokallsyms_lookup_name) { int len, rc = 0; char *end, str[32]; - ENTRY; + SENTRY; if (write) { /* This may only be set once at module load time */ if (spl_kallsyms_lookup_name_fn != SYMBOL_POISON) - RETURN(-EEXIST); + SRETURN(-EEXIST); /* We can't use spl_proc_doulongvec_minmax() in the write * case hear because the address while a hex value has no * leading 0x which confuses the helper function. */ rc = proc_copyin_string(str, sizeof(str), buffer, *lenp); if (rc < 0) - RETURN(rc); + SRETURN(rc); spl_kallsyms_lookup_name_fn = (kallsyms_lookup_name_t)simple_strtoul(str, &end, 16); if (str == end) - RETURN(-EINVAL); + SRETURN(-EINVAL); *ppos += *lenp; } else { @@ -505,7 +505,7 @@ SPL_PROC_HANDLER(proc_dokallsyms_lookup_name) } } - RETURN(rc); + SRETURN(rc); } #endif /* HAVE_KALLSYMS_LOOKUP_NAME */ @@ -513,7 +513,7 @@ SPL_PROC_HANDLER(proc_doavailrmem) { int len, rc = 0; char str[32]; - ENTRY; + SENTRY; if (write) { *ppos += *lenp; @@ -531,14 +531,14 @@ SPL_PROC_HANDLER(proc_doavailrmem) } } - RETURN(rc); + SRETURN(rc); } SPL_PROC_HANDLER(proc_dofreemem) { int len, rc = 0; char str[32]; - ENTRY; + SENTRY; if (write) { *ppos += *lenp; @@ -555,7 +555,7 @@ SPL_PROC_HANDLER(proc_dofreemem) } } - RETURN(rc); + SRETURN(rc); } #ifdef DEBUG_KMEM @@ -605,7 +605,7 @@ slab_seq_start(struct seq_file *f, loff_t *pos) { struct list_head *p; loff_t n = *pos; - ENTRY; + SENTRY; down_read(&spl_kmem_cache_sem); if (!n) @@ -615,20 +615,20 @@ slab_seq_start(struct seq_file *f, loff_t *pos) while (n--) { p = p->next; if (p == &spl_kmem_cache_list) - RETURN(NULL); + SRETURN(NULL); } - RETURN(list_entry(p, spl_kmem_cache_t, skc_list)); + SRETURN(list_entry(p, spl_kmem_cache_t, skc_list)); } static void * slab_seq_next(struct seq_file *f, void *p, loff_t *pos) { spl_kmem_cache_t *skc = p; - ENTRY; + SENTRY; ++*pos; - RETURN((skc->skc_list.next == &spl_kmem_cache_list) ? + SRETURN((skc->skc_list.next == &spl_kmem_cache_list) ? NULL : list_entry(skc->skc_list.next,spl_kmem_cache_t,skc_list)); } @@ -1025,33 +1025,33 @@ int proc_init(void) { int rc = 0; - ENTRY; + SENTRY; #ifdef CONFIG_SYSCTL spl_header = spl_register_sysctl_table(spl_root, 0); if (spl_header == NULL) - RETURN(-EUNATCH); + SRETURN(-EUNATCH); #endif /* CONFIG_SYSCTL */ proc_spl = proc_mkdir("spl", NULL); if (proc_spl == NULL) - GOTO(out, rc = -EUNATCH); + SGOTO(out, rc = -EUNATCH); #ifdef DEBUG_KMEM proc_spl_kmem = proc_mkdir("kmem", proc_spl); if (proc_spl_kmem == NULL) - GOTO(out, rc = -EUNATCH); + SGOTO(out, rc = -EUNATCH); proc_spl_kmem_slab = create_proc_entry("slab", 0444, proc_spl_kmem); if (proc_spl_kmem_slab == NULL) - GOTO(out, rc = -EUNATCH); + SGOTO(out, rc = -EUNATCH); proc_spl_kmem_slab->proc_fops = &proc_slab_operations; #endif /* DEBUG_KMEM */ proc_spl_kstat = proc_mkdir("kstat", proc_spl); if (proc_spl_kstat == NULL) - GOTO(out, rc = -EUNATCH); + SGOTO(out, rc = -EUNATCH); out: if (rc) { remove_proc_entry("kstat", proc_spl); @@ -1065,13 +1065,13 @@ out: #endif /* CONFIG_SYSCTL */ } - RETURN(rc); + SRETURN(rc); } void proc_fini(void) { - ENTRY; + SENTRY; remove_proc_entry("kstat", proc_spl); #ifdef DEBUG_KMEM @@ -1085,5 +1085,5 @@ proc_fini(void) spl_unregister_sysctl_table(spl_header); #endif /* CONFIG_SYSCTL */ - EXIT; + SEXIT; } diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index d9c83279c..201cb5949 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -28,11 +28,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_TASKQ +#define SS_DEBUG_SUBSYS SS_TASKQ /* Global system-wide dynamic task queue available for all consumers */ taskq_t *system_taskq; @@ -55,7 +55,7 @@ task_alloc(taskq_t *tq, uint_t flags) { spl_task_t *t; int count = 0; - ENTRY; + SENTRY; ASSERT(tq); ASSERT(flags & (TQ_SLEEP | TQ_NOSLEEP)); /* One set */ @@ -66,17 +66,17 @@ retry: if (!list_empty(&tq->tq_free_list) && !(flags & TQ_NEW)) { t = list_entry(tq->tq_free_list.next, spl_task_t, t_list); list_del_init(&t->t_list); - RETURN(t); + SRETURN(t); } /* Free list is empty and memory allocations are prohibited */ if (flags & TQ_NOALLOC) - RETURN(NULL); + SRETURN(NULL); /* Hit maximum spl_task_t pool size */ if (tq->tq_nalloc >= tq->tq_maxalloc) { if (flags & TQ_NOSLEEP) - RETURN(NULL); + SRETURN(NULL); /* Sleep periodically polling the free list for an available * spl_task_t. If a full second passes and we have not found @@ -86,9 +86,9 @@ retry: schedule_timeout(HZ / 100); spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); if (count < 100) - GOTO(retry, count++); + SGOTO(retry, count++); - RETURN(NULL); + SRETURN(NULL); } /* Unreachable, Neither TQ_SLEEP or TQ_NOSLEEP set */ @@ -108,7 +108,7 @@ retry: tq->tq_nalloc++; } - RETURN(t); + SRETURN(t); } /* @@ -118,7 +118,7 @@ retry: static void task_free(taskq_t *tq, spl_task_t *t) { - ENTRY; + SENTRY; ASSERT(tq); ASSERT(t); @@ -128,7 +128,7 @@ task_free(taskq_t *tq, spl_task_t *t) kmem_free(t, sizeof(spl_task_t)); tq->tq_nalloc--; - EXIT; + SEXIT; } /* @@ -138,7 +138,7 @@ task_free(taskq_t *tq, spl_task_t *t) static void task_done(taskq_t *tq, spl_task_t *t) { - ENTRY; + SENTRY; ASSERT(tq); ASSERT(t); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -154,7 +154,7 @@ task_done(taskq_t *tq, spl_task_t *t) task_free(tq, t); } - EXIT; + SEXIT; } /* @@ -190,18 +190,18 @@ taskq_wait_check(taskq_t *tq, taskqid_t id) rc = (id < tq->tq_lowest_id); spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - RETURN(rc); + SRETURN(rc); } void __taskq_wait_id(taskq_t *tq, taskqid_t id) { - ENTRY; + SENTRY; ASSERT(tq); wait_event(tq->tq_wait_waitq, taskq_wait_check(tq, id)); - EXIT; + SEXIT; } EXPORT_SYMBOL(__taskq_wait_id); @@ -209,7 +209,7 @@ void __taskq_wait(taskq_t *tq) { taskqid_t id; - ENTRY; + SENTRY; ASSERT(tq); /* Wait for the largest outstanding taskqid */ @@ -219,7 +219,7 @@ __taskq_wait(taskq_t *tq) __taskq_wait_id(tq, id); - EXIT; + SEXIT; } EXPORT_SYMBOL(__taskq_wait); @@ -228,16 +228,16 @@ int __taskq_member(taskq_t *tq, void *t) { int i; - ENTRY; + SENTRY; ASSERT(tq); ASSERT(t); for (i = 0; i < tq->tq_nthreads; i++) if (tq->tq_threads[i] == (struct task_struct *)t) - RETURN(1); + SRETURN(1); - RETURN(0); + SRETURN(0); } EXPORT_SYMBOL(__taskq_member); @@ -246,7 +246,7 @@ __taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) { spl_task_t *t; taskqid_t rc = 0; - ENTRY; + SENTRY; ASSERT(tq); ASSERT(func); @@ -263,15 +263,15 @@ __taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) /* Taskq being destroyed and all tasks drained */ if (!(tq->tq_flags & TQ_ACTIVE)) - GOTO(out, rc = 0); + SGOTO(out, rc = 0); /* Do not queue the task unless there is idle thread for it */ ASSERT(tq->tq_nactive <= tq->tq_nthreads); if ((flags & TQ_NOQUEUE) && (tq->tq_nactive == tq->tq_nthreads)) - GOTO(out, rc = 0); + SGOTO(out, rc = 0); if ((t = task_alloc(tq, flags)) == NULL) - GOTO(out, rc = 0); + SGOTO(out, rc = 0); spin_lock(&t->t_lock); @@ -290,7 +290,7 @@ __taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) wake_up(&tq->tq_work_waitq); out: spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - RETURN(rc); + SRETURN(rc); } EXPORT_SYMBOL(__taskq_dispatch); @@ -305,7 +305,7 @@ taskq_lowest_id(taskq_t *tq) { taskqid_t lowest_id = tq->tq_next_id; spl_task_t *t; - ENTRY; + SENTRY; ASSERT(tq); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -325,7 +325,7 @@ taskq_lowest_id(taskq_t *tq) lowest_id = MIN(lowest_id, t->t_id); } - RETURN(lowest_id); + SRETURN(lowest_id); } /* @@ -338,7 +338,7 @@ taskq_insert_in_order(taskq_t *tq, spl_task_t *t) spl_task_t *w; struct list_head *l; - ENTRY; + SENTRY; ASSERT(tq); ASSERT(t); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -353,7 +353,7 @@ taskq_insert_in_order(taskq_t *tq, spl_task_t *t) if (l == &tq->tq_work_list) list_add(&t->t_list, &tq->tq_work_list); - EXIT; + SEXIT; } static int @@ -365,7 +365,7 @@ taskq_thread(void *args) taskq_t *tq = args; spl_task_t *t; struct list_head *pend_list; - ENTRY; + SENTRY; ASSERT(tq); current->flags |= PF_NOFREEZE; @@ -433,7 +433,7 @@ taskq_thread(void *args) tq->tq_nthreads--; spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - RETURN(0); + SRETURN(0); } taskq_t * @@ -443,7 +443,7 @@ __taskq_create(const char *name, int nthreads, pri_t pri, taskq_t *tq; struct task_struct *t; int rc = 0, i, j = 0; - ENTRY; + SENTRY; ASSERT(name != NULL); ASSERT(pri <= maxclsyspri); @@ -462,12 +462,12 @@ __taskq_create(const char *name, int nthreads, pri_t pri, tq = kmem_alloc(sizeof(*tq), KM_SLEEP); if (tq == NULL) - RETURN(NULL); + SRETURN(NULL); tq->tq_threads = kmem_alloc(nthreads * sizeof(t), KM_SLEEP); if (tq->tq_threads == NULL) { kmem_free(tq, sizeof(*tq)); - RETURN(NULL); + SRETURN(NULL); } spin_lock_init(&tq->tq_lock); @@ -517,7 +517,7 @@ __taskq_create(const char *name, int nthreads, pri_t pri, tq = NULL; } - RETURN(tq); + SRETURN(tq); } EXPORT_SYMBOL(__taskq_create); @@ -526,7 +526,7 @@ __taskq_destroy(taskq_t *tq) { spl_task_t *t; int i, nthreads; - ENTRY; + SENTRY; ASSERT(tq); spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); @@ -560,29 +560,29 @@ __taskq_destroy(taskq_t *tq) kmem_free(tq->tq_threads, nthreads * sizeof(spl_task_t *)); kmem_free(tq, sizeof(taskq_t)); - EXIT; + SEXIT; } EXPORT_SYMBOL(__taskq_destroy); int spl_taskq_init(void) { - ENTRY; + SENTRY; /* Solaris creates a dynamic taskq of up to 64 threads, however in * a Linux environment 1 thread per-core is usually about right */ system_taskq = taskq_create("spl_system_taskq", num_online_cpus(), minclsyspri, 4, 512, TASKQ_PREPOPULATE); if (system_taskq == NULL) - RETURN(1); + SRETURN(1); - RETURN(0); + SRETURN(0); } void spl_taskq_fini(void) { - ENTRY; + SENTRY; taskq_destroy(system_taskq); - EXIT; + SEXIT; } diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index e28b1261a..5de12ac33 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -28,11 +28,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_THREAD +#define SS_DEBUG_SUBSYS SS_THREAD /* * Thread interfaces @@ -72,8 +72,8 @@ thread_generic_wrapper(void *arg) void __thread_exit(void) { - ENTRY; - EXIT; + SENTRY; + SEXIT; complete_and_exit(NULL, 0); /* Unreachable */ } @@ -90,7 +90,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, thread_priv_t *tp; struct task_struct *tsk; char *p; - ENTRY; + SENTRY; /* Option pp is simply ignored */ /* Variable stack size unsupported */ @@ -98,7 +98,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tp = kmem_alloc(sizeof(thread_priv_t), KM_SLEEP); if (tp == NULL) - RETURN(NULL); + SRETURN(NULL); tp->tp_magic = TP_MAGIC; tp->tp_name_size = strlen(name) + 1; @@ -106,7 +106,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tp->tp_name = kmem_alloc(tp->tp_name_size, KM_SLEEP); if (tp->tp_name == NULL) { kmem_free(tp, sizeof(thread_priv_t)); - RETURN(NULL); + SRETURN(NULL); } strncpy(tp->tp_name, name, tp->tp_name_size); @@ -127,11 +127,11 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tsk = kthread_create(thread_generic_wrapper, (void *)tp, "%s", tp->tp_name); if (IS_ERR(tsk)) { - CERROR("Failed to create thread: %ld\n", PTR_ERR(tsk)); - RETURN(NULL); + SERROR("Failed to create thread: %ld\n", PTR_ERR(tsk)); + SRETURN(NULL); } wake_up_process(tsk); - RETURN((kthread_t *)tsk); + SRETURN((kthread_t *)tsk); } EXPORT_SYMBOL(__thread_create); diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 840bb6718..9bfead8cf 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -27,11 +27,11 @@ #include #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS #endif -#define DEBUG_SUBSYSTEM S_VNODE +#define SS_DEBUG_SUBSYS SS_VNODE vnode_t *rootdir = (vnode_t *)0xabcd1234; EXPORT_SYMBOL(rootdir); @@ -76,7 +76,7 @@ vnode_t * vn_alloc(int flag) { vnode_t *vp; - ENTRY; + SENTRY; vp = kmem_cache_alloc(vn_cache, flag); if (vp != NULL) { @@ -84,16 +84,16 @@ vn_alloc(int flag) vp->v_type = 0; } - RETURN(vp); + SRETURN(vp); } /* vn_alloc() */ EXPORT_SYMBOL(vn_alloc); void vn_free(vnode_t *vp) { - ENTRY; + SENTRY; kmem_cache_free(vn_cache, vp); - EXIT; + SEXIT; } /* vn_free() */ EXPORT_SYMBOL(vn_free); @@ -105,7 +105,7 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, struct kstat stat; int rc, saved_umask = 0; vnode_t *vp; - ENTRY; + SENTRY; ASSERT(flags & (FWRITE | FREAD)); ASSERT(seg == UIO_SYSSPACE); @@ -131,18 +131,18 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, (void)xchg(¤t->fs->umask, saved_umask); if (IS_ERR(fp)) - RETURN(-PTR_ERR(fp)); + SRETURN(-PTR_ERR(fp)); rc = vfs_getattr(fp->f_vfsmnt, fp->f_dentry, &stat); if (rc) { filp_close(fp, 0); - RETURN(-rc); + SRETURN(-rc); } vp = vn_alloc(KM_SLEEP); if (!vp) { filp_close(fp, 0); - RETURN(ENOMEM); + SRETURN(ENOMEM); } mutex_enter(&vp->v_lock); @@ -151,7 +151,7 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, *vpp = vp; mutex_exit(&vp->v_lock); - RETURN(0); + SRETURN(0); } /* vn_open() */ EXPORT_SYMBOL(vn_open); @@ -161,20 +161,20 @@ vn_openat(const char *path, uio_seg_t seg, int flags, int mode, { char *realpath; int len, rc; - ENTRY; + SENTRY; ASSERT(vp == rootdir); len = strlen(path) + 2; realpath = kmalloc(len, GFP_KERNEL); if (!realpath) - RETURN(ENOMEM); + SRETURN(ENOMEM); (void)snprintf(realpath, len, "/%s", path); rc = vn_open(realpath, seg, flags, mode, vpp, x1, x2); kfree(realpath); - RETURN(rc); + SRETURN(rc); } /* vn_openat() */ EXPORT_SYMBOL(vn_openat); @@ -186,7 +186,7 @@ vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off, mm_segment_t saved_fs; struct file *fp; int rc; - ENTRY; + SENTRY; ASSERT(uio == UIO_WRITE || uio == UIO_READ); ASSERT(vp); @@ -215,16 +215,16 @@ vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off, set_fs(saved_fs); if (rc < 0) - RETURN(-rc); + SRETURN(-rc); if (residp) { *residp = len - rc; } else { if (rc != len) - RETURN(EIO); + SRETURN(EIO); } - RETURN(0); + SRETURN(0); } /* vn_rdwr() */ EXPORT_SYMBOL(vn_rdwr); @@ -232,7 +232,7 @@ int vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4) { int rc; - ENTRY; + SENTRY; ASSERT(vp); ASSERT(vp->v_file); @@ -240,7 +240,7 @@ vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4) rc = filp_close(vp->v_file, 0); vn_free(vp); - RETURN(-rc); + SRETURN(-rc); } /* vn_close() */ EXPORT_SYMBOL(vn_close); @@ -275,18 +275,18 @@ vn_remove(const char *path, uio_seg_t seg, int flags) struct nameidata nd; struct inode *inode = NULL; int rc = 0; - ENTRY; + SENTRY; ASSERT(seg == UIO_SYSSPACE); ASSERT(flags == RMFILE); rc = path_lookup(path, LOOKUP_PARENT, &nd); if (rc) - GOTO(exit, rc); + SGOTO(exit, rc); rc = -EISDIR; if (nd.last_type != LAST_NORM) - GOTO(exit1, rc); + SGOTO(exit1, rc); #ifdef HAVE_INODE_I_MUTEX mutex_lock_nested(&nd.nd_dentry->d_inode->i_mutex, I_MUTEX_PARENT); @@ -298,7 +298,7 @@ vn_remove(const char *path, uio_seg_t seg, int flags) if (!IS_ERR(dentry)) { /* Why not before? Because we want correct rc value */ if (nd.last.name[nd.last.len]) - GOTO(slashes, rc); + SGOTO(slashes, rc); inode = dentry->d_inode; if (inode) @@ -321,12 +321,12 @@ exit2: exit1: vn_path_release(&nd); exit: - RETURN(-rc); + SRETURN(-rc); slashes: rc = !dentry->d_inode ? -ENOENT : S_ISDIR(dentry->d_inode->i_mode) ? -EISDIR : -ENOTDIR; - GOTO(exit2, rc); + SGOTO(exit2, rc); } /* vn_remove() */ EXPORT_SYMBOL(vn_remove); @@ -339,28 +339,28 @@ vn_rename(const char *oldname, const char *newname, int x1) struct dentry *trap; struct nameidata oldnd, newnd; int rc = 0; - ENTRY; + SENTRY; rc = path_lookup(oldname, LOOKUP_PARENT, &oldnd); if (rc) - GOTO(exit, rc); + SGOTO(exit, rc); rc = path_lookup(newname, LOOKUP_PARENT, &newnd); if (rc) - GOTO(exit1, rc); + SGOTO(exit1, rc); rc = -EXDEV; if (oldnd.nd_mnt != newnd.nd_mnt) - GOTO(exit2, rc); + SGOTO(exit2, rc); old_dir = oldnd.nd_dentry; rc = -EBUSY; if (oldnd.last_type != LAST_NORM) - GOTO(exit2, rc); + SGOTO(exit2, rc); new_dir = newnd.nd_dentry; if (newnd.last_type != LAST_NORM) - GOTO(exit2, rc); + SGOTO(exit2, rc); trap = lock_rename(new_dir, old_dir); @@ -368,36 +368,36 @@ vn_rename(const char *oldname, const char *newname, int x1) rc = PTR_ERR(old_dentry); if (IS_ERR(old_dentry)) - GOTO(exit3, rc); + SGOTO(exit3, rc); /* source must exist */ rc = -ENOENT; if (!old_dentry->d_inode) - GOTO(exit4, rc); + SGOTO(exit4, rc); /* unless the source is a directory trailing slashes give -ENOTDIR */ if (!S_ISDIR(old_dentry->d_inode->i_mode)) { rc = -ENOTDIR; if (oldnd.last.name[oldnd.last.len]) - GOTO(exit4, rc); + SGOTO(exit4, rc); if (newnd.last.name[newnd.last.len]) - GOTO(exit4, rc); + SGOTO(exit4, rc); } /* source should not be ancestor of target */ rc = -EINVAL; if (old_dentry == trap) - GOTO(exit4, rc); + SGOTO(exit4, rc); new_dentry = vn_lookup_hash(&newnd); rc = PTR_ERR(new_dentry); if (IS_ERR(new_dentry)) - GOTO(exit4, rc); + SGOTO(exit4, rc); /* target should not be an ancestor of source */ rc = -ENOTEMPTY; if (new_dentry == trap) - GOTO(exit5, rc); + SGOTO(exit5, rc); #ifdef HAVE_4ARGS_VFS_RENAME rc = vfs_rename(old_dir->d_inode, old_dentry, @@ -417,7 +417,7 @@ exit2: exit1: vn_path_release(&oldnd); exit: - RETURN(-rc); + SRETURN(-rc); } EXPORT_SYMBOL(vn_rename); @@ -427,7 +427,7 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) struct file *fp; struct kstat stat; int rc; - ENTRY; + SENTRY; ASSERT(vp); ASSERT(vp->v_file); @@ -437,7 +437,7 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) rc = vfs_getattr(fp->f_vfsmnt, fp->f_dentry, &stat); if (rc) - RETURN(-rc); + SRETURN(-rc); vap->va_type = vn_get_sol_type(stat.mode); vap->va_mode = stat.mode; @@ -457,14 +457,14 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) vap->va_rdev = stat.rdev; vap->va_blocks = stat.blocks; - RETURN(0); + SRETURN(0); } EXPORT_SYMBOL(vn_getattr); int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4) { int datasync = 0; - ENTRY; + SENTRY; ASSERT(vp); ASSERT(vp->v_file); @@ -472,7 +472,7 @@ int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4) if (flags & FDSYNC) datasync = 1; - RETURN(-spl_filp_fsync(vp->v_file, datasync)); + SRETURN(-spl_filp_fsync(vp->v_file, datasync)); } /* vn_fsync() */ EXPORT_SYMBOL(vn_fsync); @@ -502,7 +502,7 @@ vn_getf(int fd) file_t *fp; vnode_t *vp; int rc = 0; - ENTRY; + SENTRY; /* Already open just take an extra reference */ spin_lock(&vn_file_lock); @@ -511,7 +511,7 @@ vn_getf(int fd) if (fp) { atomic_inc(&fp->f_ref); spin_unlock(&vn_file_lock); - RETURN(fp); + SRETURN(fp); } spin_unlock(&vn_file_lock); @@ -519,7 +519,7 @@ vn_getf(int fd) /* File was not yet opened create the object and setup */ fp = kmem_cache_alloc(vn_file_cache, KM_SLEEP); if (fp == NULL) - GOTO(out, rc); + SGOTO(out, rc); mutex_enter(&fp->f_lock); @@ -529,14 +529,14 @@ vn_getf(int fd) lfp = fget(fd); if (lfp == NULL) - GOTO(out_mutex, rc); + SGOTO(out_mutex, rc); vp = vn_alloc(KM_SLEEP); if (vp == NULL) - GOTO(out_fget, rc); + SGOTO(out_fget, rc); if (vfs_getattr(lfp->f_vfsmnt, lfp->f_dentry, &stat)) - GOTO(out_vnode, rc); + SGOTO(out_vnode, rc); mutex_enter(&vp->v_lock); vp->v_type = vn_get_sol_type(stat.mode); @@ -552,7 +552,7 @@ vn_getf(int fd) spin_unlock(&vn_file_lock); mutex_exit(&fp->f_lock); - RETURN(fp); + SRETURN(fp); out_vnode: vn_free(vp); @@ -562,7 +562,7 @@ out_mutex: mutex_exit(&fp->f_lock); kmem_cache_free(vn_file_cache, fp); out: - RETURN(NULL); + SRETURN(NULL); } /* getf() */ EXPORT_SYMBOL(getf); @@ -582,7 +582,7 @@ void vn_releasef(int fd) { file_t *fp; - ENTRY; + SENTRY; spin_lock(&vn_file_lock); fp = file_find(fd); @@ -590,7 +590,7 @@ vn_releasef(int fd) atomic_dec(&fp->f_ref); if (atomic_read(&fp->f_ref) > 0) { spin_unlock(&vn_file_lock); - EXIT; + SEXIT; return; } @@ -599,7 +599,7 @@ vn_releasef(int fd) } spin_unlock(&vn_file_lock); - EXIT; + SEXIT; return; } /* releasef() */ EXPORT_SYMBOL(releasef); @@ -654,7 +654,7 @@ vn_set_pwd(const char *filename) #endif /* HAVE_2ARGS_SET_FS_PWD */ mm_segment_t saved_fs; int rc; - ENTRY; + SENTRY; /* * user_path_dir() and __user_walk() both expect 'filename' to be @@ -668,11 +668,11 @@ vn_set_pwd(const char *filename) # ifdef HAVE_USER_PATH_DIR rc = user_path_dir(filename, &path); if (rc) - GOTO(out, rc); + SGOTO(out, rc); rc = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); if (rc) - GOTO(dput_and_out, rc); + SGOTO(dput_and_out, rc); set_fs_pwd(current->fs, &path); @@ -682,11 +682,11 @@ dput_and_out: rc = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd); if (rc) - GOTO(out, rc); + SGOTO(out, rc); rc = vfs_permission(&nd, MAY_EXEC); if (rc) - GOTO(dput_and_out, rc); + SGOTO(dput_and_out, rc); set_fs_pwd(current->fs, &nd.path); @@ -697,11 +697,11 @@ dput_and_out: rc = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd); if (rc) - GOTO(out, rc); + SGOTO(out, rc); rc = vfs_permission(&nd, MAY_EXEC); if (rc) - GOTO(dput_and_out, rc); + SGOTO(dput_and_out, rc); set_fs_pwd(current->fs, nd.nd_mnt, nd.nd_dentry); @@ -711,7 +711,7 @@ dput_and_out: out: set_fs(saved_fs); - RETURN(-rc); + SRETURN(-rc); } /* vn_set_pwd() */ EXPORT_SYMBOL(vn_set_pwd); @@ -756,7 +756,7 @@ vn_file_cache_destructor(void *buf, void *cdrarg) int vn_init(void) { - ENTRY; + SENTRY; vn_cache = kmem_cache_create("spl_vn_cache", sizeof(struct vnode), 64, vn_cache_constructor, @@ -768,7 +768,7 @@ vn_init(void) vn_file_cache_constructor, vn_file_cache_destructor, NULL, NULL, NULL, 0); - RETURN(0); + SRETURN(0); } /* vn_init() */ void @@ -776,7 +776,7 @@ vn_fini(void) { file_t *fp, *next_fp; int leaked = 0; - ENTRY; + SENTRY; spin_lock(&vn_file_lock); @@ -791,10 +791,10 @@ vn_fini(void) spin_unlock(&vn_file_lock); if (leaked > 0) - CWARN("Warning %d files leaked\n", leaked); + SWARN("Warning %d files leaked\n", leaked); kmem_cache_destroy(vn_cache); - EXIT; + SEXIT; return; } /* vn_fini() */ diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index 375b74e53..eba470a4b 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -29,6 +29,12 @@ #include #include +#ifdef SS_DEBUG_SUBSYS +#undef SS_DEBUG_SUBSYS +#endif + +#define SS_DEBUG_SUBSYS SS_XDR + /* * SPL's XDR mem implementation. * @@ -144,7 +150,7 @@ xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size, xdrs->x_ops = &xdrmem_decode_ops; break; default: - CWARN("Invalid op value: %d\n", op); + SWARN("Invalid op value: %d\n", op); xdrs->x_ops = NULL; /* Let the caller know we failed */ return; } @@ -154,7 +160,7 @@ xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size, xdrs->x_addr_end = addr + size; if (xdrs->x_addr_end < xdrs->x_addr) { - CWARN("Overflow while creating xdrmem: %p, %u\n", addr, size); + SWARN("Overflow while creating xdrmem: %p, %u\n", addr, size); xdrs->x_ops = NULL; } } @@ -166,7 +172,7 @@ xdrmem_control(XDR *xdrs, int req, void *info) struct xdr_bytesrec *rec = (struct xdr_bytesrec *) info; if (req != XDR_GET_BYTES_AVAIL) { - CWARN("Called with unknown request: %d\n", req); + SWARN("Called with unknown request: %d\n", req); return FALSE; } -- cgit v1.2.3 From 4b2220f0b937018b79154ac368c845e6176a8a66 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 20 Jan 2012 16:39:12 -0800 Subject: Add --enable-debug-log configure option Until now the notion of an internal debug logging infrastructure was conflated with enabling ASSERT()s. This patch clarifies things by cleanly breaking the two subsystem apart. The result of this is the following behavior. --enable-debug - Enable/disable code wrapped in ASSERT()s. --disable-debug ASSERT()s are used to check invariants and are never required for correct operation. They are disabled by default because they may impact performance. --enable-debug-log - Enable/disable the debug log infrastructure. --disable-debug-log This infrastructure allows the spl code and its consumer to log messages to an in-kernel log. The granularity of the logging can be controlled by a debug mask. By default the mask disables most debug messages resulting in a negligible performance impact. Because of this the debug log is enabled by default. Signed-off-by: Brian Behlendorf --- config/spl-build.m4 | 28 ++++++++++++++++++ configure | 78 +++++++++++++++++++++++++++++++++++++++++--------- include/spl-debug.h | 56 +++++++++++++++++++++++++----------- include/sys/debug.h | 7 ++--- module/spl/spl-debug.c | 5 ++++ module/spl/spl-err.c | 2 +- module/spl/spl-kmem.c | 2 +- module/spl/spl-proc.c | 8 ++++++ scripts/check.sh | 3 +- spl_config.h.in | 3 ++ 10 files changed, 152 insertions(+), 40 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/config/spl-build.m4 b/config/spl-build.m4 index a20ee38d1..205eb6bc5 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -19,6 +19,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ AC_SUBST(KERNELCPPFLAGS) SPL_AC_DEBUG + SPL_AC_DEBUG_LOG SPL_AC_DEBUG_KMEM SPL_AC_DEBUG_KMEM_TRACKING SPL_AC_ATOMIC_SPINLOCK @@ -485,6 +486,33 @@ AC_DEFUN([SPL_AC_DEBUG], [ AC_MSG_RESULT([$enable_debug]) ]) +dnl # +dnl # Enabled by default it provides a basic debug log infrastructure. +dnl # Each subsystem registers itself with a name and logs messages +dnl # using predefined types. If the debug mask it set to allow the +dnl # message type it will be written to the internal log. The log +dnl # can be dumped to a file by echoing 1 to the 'dump' proc entry, +dnl # after dumping the log it must be decoded using the spl utility. +dnl # +dnl # echo 1 >/proc/sys/kernel/spl/debug/dump +dnl # spl /tmp/spl-log.xxx.yyy /tmp/spl-log.xxx.yyy.txt +dnl # +AC_DEFUN([SPL_AC_DEBUG_LOG], [ + AC_ARG_ENABLE([debug-log], + [AS_HELP_STRING([--enable-debug-log], + [Enable basic debug logging @<:@default=yes@:>@])], + [], + [enable_debug_log=yes]) + + AS_IF([test "x$enable_debug_log" = xyes], + [AC_DEFINE([DEBUG_LOG], [1], + [Define to 1 to enable basic debug logging]) + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_LOG"]) + + AC_MSG_CHECKING([whether basic debug logging is enabled]) + AC_MSG_RESULT([$enable_debug_log]) +]) + dnl # dnl # Enabled by default it provides a minimal level of memory tracking. dnl # A total count of bytes allocated is kept for each alloc and free. diff --git a/configure b/configure index 7b93f564f..3b3439ad1 100755 --- a/configure +++ b/configure @@ -961,6 +961,7 @@ with_config with_linux with_linux_obj enable_debug +enable_debug_log enable_debug_kmem enable_debug_kmem_tracking enable_atomic_spinlocks @@ -1615,6 +1616,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Enable generic debug support [default=no] + --enable-debug-log Enable basic debug logging [default=yes] --enable-debug-kmem Enable basic kmem accounting [default=yes] --enable-debug-kmem-tracking Enable detailed kmem tracking [default=no] @@ -4783,13 +4785,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4786: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4788: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4789: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4791: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4792: output\"" >&5) + (eval echo "\"\$as_me:4794: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5995,7 +5997,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5998 "configure"' > conftest.$ac_ext + echo '#line 6000 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7848,11 +7850,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7851: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7853: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7855: \$? = $ac_status" >&5 + echo "$as_me:7857: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8187,11 +8189,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8190: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8192: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8194: \$? = $ac_status" >&5 + echo "$as_me:8196: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8292,11 +8294,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8295: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8297: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8299: \$? = $ac_status" >&5 + echo "$as_me:8301: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8347,11 +8349,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8350: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8352: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8354: \$? = $ac_status" >&5 + echo "$as_me:8356: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11150,7 +11152,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11153 "configure" +#line 11155 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11246,7 +11248,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11249 "configure" +#line 11251 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11980,6 +11982,30 @@ fi $as_echo "$enable_debug" >&6; } + # Check whether --enable-debug-log was given. +if test "${enable_debug_log+set}" = set; then + enableval=$enable_debug_log; +else + enable_debug_log=yes +fi + + + if test "x$enable_debug_log" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define DEBUG_LOG 1 +_ACEOF + + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_LOG" +fi + + + { $as_echo "$as_me:$LINENO: checking whether basic debug logging is enabled" >&5 +$as_echo_n "checking whether basic debug logging is enabled... " >&6; } + { $as_echo "$as_me:$LINENO: result: $enable_debug_log" >&5 +$as_echo "$enable_debug_log" >&6; } + + # Check whether --enable-debug-kmem was given. if test "${enable_debug_kmem+set}" = set; then enableval=$enable_debug_kmem; @@ -16359,6 +16385,30 @@ fi $as_echo "$enable_debug" >&6; } + # Check whether --enable-debug-log was given. +if test "${enable_debug_log+set}" = set; then + enableval=$enable_debug_log; +else + enable_debug_log=yes +fi + + + if test "x$enable_debug_log" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define DEBUG_LOG 1 +_ACEOF + + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_LOG" +fi + + + { $as_echo "$as_me:$LINENO: checking whether basic debug logging is enabled" >&5 +$as_echo_n "checking whether basic debug logging is enabled... " >&6; } + { $as_echo "$as_me:$LINENO: result: $enable_debug_log" >&5 +$as_echo "$enable_debug_log" >&6; } + + # Check whether --enable-debug-kmem was given. if test "${enable_debug_kmem+set}" = set; then enableval=$enable_debug_kmem; diff --git a/include/spl-debug.h b/include/spl-debug.h index 1e08e77bc..98164966c 100644 --- a/include/spl-debug.h +++ b/include/spl-debug.h @@ -43,6 +43,7 @@ #define _SPL_DEBUG_INTERNAL_H #include +#include #define SS_UNDEFINED 0x00000001 #define SS_ATOMIC 0x00000002 @@ -86,21 +87,8 @@ #define SD_OTHER 0x00000100 #define SD_CANTMASK (SD_ERROR | SD_EMERG | SD_WARNING | SD_CONSOLE) -#ifdef NDEBUG /* Debugging Disabled */ - -#define SDEBUG(mask, fmt, a...) ((void)0) -#define SDEBUG_LIMIT(x, y, fmt, a...) ((void)0) -#define SWARN(fmt, a...) ((void)0) -#define SERROR(fmt, a...) ((void)0) -#define SEMERG(fmt, a...) ((void)0) -#define SCONSOLE(mask, fmt, a...) ((void)0) - -#define SENTRY ((void)0) -#define SEXIT ((void)0) -#define SRETURN(x) return (x) -#define SGOTO(x, y) { ((void)(y)); goto x; } - -#else /* Debugging Enabled */ +/* Debug log support enabled */ +#ifdef DEBUG_LOG #define __SDEBUG(cdls, subsys, mask, format, a...) \ do { \ @@ -149,8 +137,6 @@ do { \ goto label; \ } while (0) -#endif /* NDEBUG */ - typedef struct { unsigned long cdls_next; int cdls_count; @@ -183,10 +169,46 @@ extern int spl_debug_set_mb(int mb); extern int spl_debug_get_mb(void); extern int spl_debug_dumplog(int flags); extern void spl_debug_dumpstack(struct task_struct *tsk); +extern void spl_debug_bug(char *file, const char *fn, const int line, int fl); +extern int spl_debug_msg(void *arg, int subsys, int mask, const char *file, + const char *fn, const int line, const char *format, ...); extern int spl_debug_clear_buffer(void); extern int spl_debug_mark_buffer(char *text); int spl_debug_init(void); void spl_debug_fini(void); +/* Debug log support disabled */ +#else /* DEBUG_LOG */ + +#define SDEBUG(mask, fmt, a...) ((void)0) +#define SDEBUG_LIMIT(x, y, fmt, a...) ((void)0) +#define SWARN(fmt, a...) ((void)0) +#define SERROR(fmt, a...) ((void)0) +#define SEMERG(fmt, a...) ((void)0) +#define SCONSOLE(mask, fmt, a...) ((void)0) + +#define SENTRY ((void)0) +#define SEXIT ((void)0) +#define SRETURN(x) return (x) +#define SGOTO(x, y) { ((void)(y)); goto x; } + +static inline int spl_debug_init(void) { return (0); } +static inline void spl_debug_fini(void) { return; } + +static inline void +spl_debug_bug(char *file, const char *fn, const int line, int fl) +{ + return; +} + +static inline int +spl_debug_msg(void *arg, int subsys, int mask, const char *file, + const char *fn, const int line, const char *format, ...) +{ + return (0); +} + +#endif /* DEBUG_LOG */ + #endif /* SPL_DEBUG_INTERNAL_H */ diff --git a/include/sys/debug.h b/include/sys/debug.h index fbf15143f..271dbc210 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -44,6 +44,8 @@ #ifndef _SPL_DEBUG_H #define _SPL_DEBUG_H +#include + #ifdef NDEBUG /* Debugging Disabled */ /* Define SPL_DEBUG_STR to make clear which ASSERT definitions are used */ @@ -137,9 +139,4 @@ do { \ #define VERIFY(x) ASSERT(x) #endif /* NDEBUG */ - -extern void spl_debug_bug(char *file, const char *fn, const int line, int fl); -extern int spl_debug_msg(void *arg, int subsys, int mask, const char *file, - const char *fn, const int line, const char *format, ...); - #endif /* SPL_DEBUG_H */ diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 0dbbb5a7c..4bcc34a8e 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -47,6 +47,9 @@ #define SS_DEBUG_SUBSYS SS_DEBUG +/* Debug log support enabled */ +#ifdef DEBUG_LOG + unsigned long spl_debug_subsys = ~0; EXPORT_SYMBOL(spl_debug_subsys); module_param(spl_debug_subsys, ulong, 0644); @@ -1248,3 +1251,5 @@ spl_debug_fini(void) { trace_fini(); } + +#endif /* DEBUG_LOG */ diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 200028f3b..c837d1eaa 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -34,7 +34,7 @@ #define SS_DEBUG_SUBSYS SS_GENERIC -#ifndef NDEBUG +#ifdef DEBUG_LOG static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" }; #endif diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 5a6011ad6..446dab128 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -672,7 +672,7 @@ kmem_alloc_debug(size_t size, int flags, const char *func, int line, "large kmem_alloc(%llu, 0x%x) at %s:%d (%lld/%llu)\n", (unsigned long long) size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); - spl_debug_dumpstack(NULL); + dump_stack(); } /* Use the correct allocator */ diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 745b10714..8149143ae 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -125,6 +125,7 @@ enum { CTL_HW_SERIAL, /* Hardware serial number from hostid */ CTL_KALLSYMS, /* Address of kallsyms_lookup_name */ +#ifdef DEBUG_LOG CTL_DEBUG_SUBSYS, /* Debug subsystem */ CTL_DEBUG_MASK, /* Debug mask */ CTL_DEBUG_PRINTK, /* Force all messages to console */ @@ -136,6 +137,7 @@ enum { CTL_DEBUG_DUMP, /* Dump debug buffer to file */ CTL_DEBUG_FORCE_BUG, /* Hook to force a BUG */ CTL_DEBUG_STACK_SIZE, /* Max observed stack size */ +#endif CTL_CONSOLE_RATELIMIT, /* Ratelimit console messages */ CTL_CONSOLE_MAX_DELAY_CS, /* Max delay which we skip messages */ @@ -221,6 +223,7 @@ proc_copyout_string(char *ubuffer, int ubuffer_size, return size; } +#ifdef DEBUG_LOG SPL_PROC_HANDLER(proc_dobitmasks) { unsigned long *mask = table->data; @@ -407,6 +410,7 @@ SPL_PROC_HANDLER(proc_console_backoff) SRETURN(rc); } +#endif /* DEBUG_LOG */ #ifdef DEBUG_KMEM SPL_PROC_HANDLER(proc_domemused) @@ -716,6 +720,7 @@ static struct file_operations proc_slab_operations = { }; #endif /* DEBUG_KMEM */ +#ifdef DEBUG_LOG static struct ctl_table spl_debug_table[] = { { CTL_NAME (CTL_DEBUG_SUBSYS) @@ -829,6 +834,7 @@ static struct ctl_table spl_debug_table[] = { }, {0}, }; +#endif /* DEBUG_LOG */ static struct ctl_table spl_vm_table[] = { { @@ -1056,12 +1062,14 @@ static struct ctl_table spl_table[] = { .proc_handler = &proc_dokallsyms_lookup_name, }, #endif +#ifdef DEBUG_LOG { CTL_NAME (CTL_SPL_DEBUG) .procname = "debug", .mode = 0555, .child = spl_debug_table, }, +#endif { CTL_NAME (CTL_SPL_VM) .procname = "vm", diff --git a/scripts/check.sh b/scripts/check.sh index 8c0e0c5cb..4334ff3a5 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -65,9 +65,8 @@ fi /sbin/modprobe zlib_inflate &>/dev/null /sbin/modprobe zlib_deflate &>/dev/null -spl_module_params="spl_debug_mask=0xffffffff spl_debug_subsys=0xffffffff" echo "Loading ${spl_module}" -/sbin/insmod ${spl_module} ${spl_module_params} || die "Failed to load ${spl_module}" +/sbin/insmod ${spl_module} || die "Failed to load ${spl_module}" echo "Loading ${splat_module}" /sbin/insmod ${splat_module} || die "Unable to load ${splat_module}" diff --git a/spl_config.h.in b/spl_config.h.in index 847da2137..05dcdc504 100644 --- a/spl_config.h.in +++ b/spl_config.h.in @@ -9,6 +9,9 @@ /* Define to 1 to enable detailed kmem tracking */ #undef DEBUG_KMEM_TRACKING +/* Define to 1 to enable basic debug logging */ +#undef DEBUG_LOG + /* invalidate_inodes() wants 2 args */ #undef HAVE_2ARGS_INVALIDATE_INODES -- cgit v1.2.3 From 3d6af2dd6d598bebf6ab04d0e2b6f6ba6e5d0f00 Mon Sep 17 00:00:00 2001 From: Ned Bass Date: Mon, 4 Mar 2013 17:26:55 -0800 Subject: Refresh links to web site Update links to refer to the official ZFS on Linux website instead of @behlendorf's personal fork on github. Signed-off-by: Brian Behlendorf --- cmd/spl.c | 2 +- cmd/splat.c | 2 +- cmd/splat.h | 2 +- configure.ac | 2 +- include/fs/fs_subr.h | 2 +- include/linux/bitops_compat.h | 2 +- include/linux/compiler_compat.h | 2 +- include/linux/file_compat.h | 2 +- include/linux/kallsyms_compat.h | 2 +- include/linux/list_compat.h | 2 +- include/linux/math64_compat.h | 2 +- include/linux/mm_compat.h | 2 +- include/linux/module_compat.h | 2 +- include/linux/mutex_compat.h | 2 +- include/linux/proc_compat.h | 2 +- include/linux/rwsem_compat.h | 2 +- include/linux/smp_compat.h | 2 +- include/linux/sysctl_compat.h | 2 +- include/linux/time_compat.h | 2 +- include/linux/uaccess_compat.h | 2 +- include/linux/zlib_compat.h | 2 +- include/rpc/types.h | 2 +- include/rpc/xdr.h | 2 +- include/sharefs/share.h | 2 +- include/spl-ctl.h | 2 +- include/spl-debug.h | 2 +- include/spl-device.h | 2 +- include/spl-trace.h | 2 +- include/splat-ctl.h | 2 +- include/strings.h | 2 +- include/sys/acl.h | 2 +- include/sys/acl_impl.h | 2 +- include/sys/atomic.h | 2 +- include/sys/attr.h | 2 +- include/sys/bitmap.h | 2 +- include/sys/bootconf.h | 2 +- include/sys/bootprops.h | 2 +- include/sys/buf.h | 2 +- include/sys/byteorder.h | 2 +- include/sys/callb.h | 2 +- include/sys/cmn_err.h | 2 +- include/sys/compress.h | 2 +- include/sys/condvar.h | 2 +- include/sys/conf.h | 2 +- include/sys/console.h | 2 +- include/sys/cpupart.h | 2 +- include/sys/cpuvar.h | 2 +- include/sys/crc32.h | 2 +- include/sys/cred.h | 2 +- include/sys/ctype.h | 2 +- include/sys/ddi.h | 2 +- include/sys/debug.h | 2 +- include/sys/dirent.h | 2 +- include/sys/disp.h | 2 +- include/sys/dkio.h | 2 +- include/sys/dklabel.h | 2 +- include/sys/dnlc.h | 2 +- include/sys/dumphdr.h | 2 +- include/sys/efi_partition.h | 2 +- include/sys/errno.h | 2 +- include/sys/extdirent.h | 2 +- include/sys/fcntl.h | 2 +- include/sys/file.h | 2 +- include/sys/fm/protocol.h | 2 +- include/sys/fm/util.h | 2 +- include/sys/fs/swapnode.h | 2 +- include/sys/idmap.h | 2 +- include/sys/int_limits.h | 2 +- include/sys/int_types.h | 2 +- include/sys/inttypes.h | 2 +- include/sys/isa_defs.h | 2 +- include/sys/kidmap.h | 2 +- include/sys/kmem.h | 2 +- include/sys/kobj.h | 2 +- include/sys/kstat.h | 2 +- include/sys/list.h | 2 +- include/sys/mkdev.h | 2 +- include/sys/mntent.h | 2 +- include/sys/modctl.h | 2 +- include/sys/mode.h | 2 +- include/sys/mount.h | 2 +- include/sys/mutex.h | 2 +- include/sys/note.h | 2 +- include/sys/open.h | 2 +- include/sys/param.h | 2 +- include/sys/pathname.h | 2 +- include/sys/policy.h | 2 +- include/sys/pool.h | 2 +- include/sys/priv_impl.h | 2 +- include/sys/proc.h | 2 +- include/sys/processor.h | 2 +- include/sys/pset.h | 2 +- include/sys/random.h | 2 +- include/sys/refstr.h | 2 +- include/sys/resource.h | 2 +- include/sys/rwlock.h | 2 +- include/sys/sdt.h | 2 +- include/sys/sid.h | 2 +- include/sys/signal.h | 2 +- include/sys/stat.h | 2 +- include/sys/stropts.h | 2 +- include/sys/sunddi.h | 2 +- include/sys/sunldi.h | 2 +- include/sys/sysdc.h | 2 +- include/sys/sysevent.h | 2 +- include/sys/sysevent/eventdefs.h | 2 +- include/sys/sysmacros.h | 2 +- include/sys/systeminfo.h | 2 +- include/sys/systm.h | 2 +- include/sys/t_lock.h | 2 +- include/sys/taskq.h | 2 +- include/sys/thread.h | 2 +- include/sys/time.h | 2 +- include/sys/timer.h | 2 +- include/sys/tsd.h | 2 +- include/sys/types.h | 2 +- include/sys/types32.h | 2 +- include/sys/u8_textprep.h | 2 +- include/sys/uio.h | 2 +- include/sys/unistd.h | 2 +- include/sys/utsname.h | 2 +- include/sys/va_list.h | 2 +- include/sys/varargs.h | 2 +- include/sys/vfs.h | 2 +- include/sys/vfs_opreg.h | 2 +- include/sys/vmsystm.h | 2 +- include/sys/vnode.h | 2 +- include/sys/zmod.h | 2 +- include/sys/zone.h | 2 +- include/unistd.h | 2 +- include/util/qsort.h | 2 +- include/util/sscanf.h | 2 +- include/vm/anon.h | 2 +- include/vm/pvn.h | 2 +- include/vm/seg_kmem.h | 2 +- module/spl/spl-atomic.c | 2 +- module/spl/spl-condvar.c | 2 +- module/spl/spl-cred.c | 2 +- module/spl/spl-debug.c | 2 +- module/spl/spl-err.c | 2 +- module/spl/spl-generic.c | 2 +- module/spl/spl-kmem.c | 2 +- module/spl/spl-kobj.c | 2 +- module/spl/spl-kstat.c | 2 +- module/spl/spl-mutex.c | 2 +- module/spl/spl-proc.c | 2 +- module/spl/spl-rwlock.c | 2 +- module/spl/spl-taskq.c | 2 +- module/spl/spl-thread.c | 2 +- module/spl/spl-time.c | 2 +- module/spl/spl-tsd.c | 2 +- module/spl/spl-vnode.c | 2 +- module/spl/spl-xdr.c | 2 +- module/spl/spl-zlib.c | 2 +- module/splat/splat-atomic.c | 2 +- module/splat/splat-condvar.c | 2 +- module/splat/splat-cred.c | 2 +- module/splat/splat-ctl.c | 2 +- module/splat/splat-generic.c | 2 +- module/splat/splat-internal.h | 2 +- module/splat/splat-kmem.c | 2 +- module/splat/splat-kobj.c | 2 +- module/splat/splat-linux.c | 2 +- module/splat/splat-list.c | 2 +- module/splat/splat-mutex.c | 2 +- module/splat/splat-random.c | 2 +- module/splat/splat-rwlock.c | 2 +- module/splat/splat-taskq.c | 2 +- module/splat/splat-thread.c | 2 +- module/splat/splat-time.c | 2 +- module/splat/splat-vnode.c | 2 +- module/splat/splat-zlib.c | 2 +- scripts/check.sh | 2 +- 173 files changed, 173 insertions(+), 173 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/cmd/spl.c b/cmd/spl.c index a77ad9ca4..3028e3ab0 100644 --- a/cmd/spl.c +++ b/cmd/spl.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/cmd/splat.c b/cmd/splat.c index f4caa5639..92962393d 100644 --- a/cmd/splat.c +++ b/cmd/splat.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/cmd/splat.h b/cmd/splat.h index dd943124e..5b838af3a 100644 --- a/cmd/splat.h +++ b/cmd/splat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/configure.ac b/configure.ac index 7a4a729db..c71bc1f53 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ # UCRL-CODE-235197 # # This file is part of the SPL, Solaris Porting Layer. -# For details, see . +# For details, see . # # The SPL is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/include/fs/fs_subr.h b/include/fs/fs_subr.h index 39499b532..33ccc684e 100644 --- a/include/fs/fs_subr.h +++ b/include/fs/fs_subr.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h index d466e0718..9c55844ad 100644 --- a/include/linux/bitops_compat.h +++ b/include/linux/bitops_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/compiler_compat.h b/include/linux/compiler_compat.h index de3b3c391..8dbbeee72 100644 --- a/include/linux/compiler_compat.h +++ b/include/linux/compiler_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h index 3dc33278f..4588d6442 100644 --- a/include/linux/file_compat.h +++ b/include/linux/file_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/kallsyms_compat.h b/include/linux/kallsyms_compat.h index fbe33e8e6..1c7afa5dd 100644 --- a/include/linux/kallsyms_compat.h +++ b/include/linux/kallsyms_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/list_compat.h b/include/linux/list_compat.h index 26d5dfe07..d1e0d9d96 100644 --- a/include/linux/list_compat.h +++ b/include/linux/list_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/math64_compat.h b/include/linux/math64_compat.h index 652082ea2..2c911a64b 100644 --- a/include/linux/math64_compat.h +++ b/include/linux/math64_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h index 21a1ef2c0..cb1bef9a4 100644 --- a/include/linux/mm_compat.h +++ b/include/linux/mm_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/module_compat.h b/include/linux/module_compat.h index 0261f6958..02f42a924 100644 --- a/include/linux/module_compat.h +++ b/include/linux/module_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/mutex_compat.h b/include/linux/mutex_compat.h index 39eb68c34..5955fc9a4 100644 --- a/include/linux/mutex_compat.h +++ b/include/linux/mutex_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/proc_compat.h b/include/linux/proc_compat.h index 3d8eda108..434ffa3f1 100644 --- a/include/linux/proc_compat.h +++ b/include/linux/proc_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/rwsem_compat.h b/include/linux/rwsem_compat.h index 757bb42af..80f348e4c 100644 --- a/include/linux/rwsem_compat.h +++ b/include/linux/rwsem_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/smp_compat.h b/include/linux/smp_compat.h index 31d42f909..8c2b54091 100644 --- a/include/linux/smp_compat.h +++ b/include/linux/smp_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/sysctl_compat.h b/include/linux/sysctl_compat.h index 93210e829..bc226537d 100644 --- a/include/linux/sysctl_compat.h +++ b/include/linux/sysctl_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/time_compat.h b/include/linux/time_compat.h index fa996d346..efa023299 100644 --- a/include/linux/time_compat.h +++ b/include/linux/time_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/uaccess_compat.h b/include/linux/uaccess_compat.h index c00669a57..c84e61d30 100644 --- a/include/linux/uaccess_compat.h +++ b/include/linux/uaccess_compat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/linux/zlib_compat.h b/include/linux/zlib_compat.h index 410dc485e..ba853c395 100644 --- a/include/linux/zlib_compat.h +++ b/include/linux/zlib_compat.h @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/rpc/types.h b/include/rpc/types.h index 137a381dc..b57b4bd73 100644 --- a/include/rpc/types.h +++ b/include/rpc/types.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index c828a38e3..d0f06b55f 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -3,7 +3,7 @@ * Written by Ricardo Correia * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sharefs/share.h b/include/sharefs/share.h index b3ad6993f..fc248a233 100644 --- a/include/sharefs/share.h +++ b/include/sharefs/share.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/spl-ctl.h b/include/spl-ctl.h index 9db139073..bb24490d9 100644 --- a/include/spl-ctl.h +++ b/include/spl-ctl.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/spl-debug.h b/include/spl-debug.h index 42da3e4e8..c91b864c2 100644 --- a/include/spl-debug.h +++ b/include/spl-debug.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/spl-device.h b/include/spl-device.h index 6c3789cd7..b237cf1b0 100644 --- a/include/spl-device.h +++ b/include/spl-device.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/spl-trace.h b/include/spl-trace.h index 709b1326e..8ef173e76 100644 --- a/include/spl-trace.h +++ b/include/spl-trace.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/splat-ctl.h b/include/splat-ctl.h index b800887b8..ccf3644bd 100644 --- a/include/splat-ctl.h +++ b/include/splat-ctl.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/strings.h b/include/strings.h index 65ee3e7c3..dc0f31466 100644 --- a/include/strings.h +++ b/include/strings.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/acl.h b/include/sys/acl.h index 39a1cc29c..f4a3de599 100644 --- a/include/sys/acl.h +++ b/include/sys/acl.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/acl_impl.h b/include/sys/acl_impl.h index 9bc45ff96..67af71371 100644 --- a/include/sys/acl_impl.h +++ b/include/sys/acl_impl.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/atomic.h b/include/sys/atomic.h index 1d1173894..31d35eb14 100644 --- a/include/sys/atomic.h +++ b/include/sys/atomic.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/attr.h b/include/sys/attr.h index 42f21cfeb..5fb609c93 100644 --- a/include/sys/attr.h +++ b/include/sys/attr.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/bitmap.h b/include/sys/bitmap.h index 85dcb2e3b..e4acb0b7d 100644 --- a/include/sys/bitmap.h +++ b/include/sys/bitmap.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/bootconf.h b/include/sys/bootconf.h index b9d40527c..4e032ad2f 100644 --- a/include/sys/bootconf.h +++ b/include/sys/bootconf.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/bootprops.h b/include/sys/bootprops.h index e4b355032..a562ec9f9 100644 --- a/include/sys/bootprops.h +++ b/include/sys/bootprops.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/buf.h b/include/sys/buf.h index b1ffa479c..8596c835c 100644 --- a/include/sys/buf.h +++ b/include/sys/buf.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/byteorder.h b/include/sys/byteorder.h index d09f5bf3e..5350a0b33 100644 --- a/include/sys/byteorder.h +++ b/include/sys/byteorder.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/callb.h b/include/sys/callb.h index 9db823650..fbe4128f8 100644 --- a/include/sys/callb.h +++ b/include/sys/callb.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/cmn_err.h b/include/sys/cmn_err.h index 9359c1a3b..1291510ec 100644 --- a/include/sys/cmn_err.h +++ b/include/sys/cmn_err.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/compress.h b/include/sys/compress.h index 8095cff9c..55822f0e5 100644 --- a/include/sys/compress.h +++ b/include/sys/compress.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/condvar.h b/include/sys/condvar.h index 62210357d..c825bd2e4 100644 --- a/include/sys/condvar.h +++ b/include/sys/condvar.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/conf.h b/include/sys/conf.h index bca0ebf05..eece0c798 100644 --- a/include/sys/conf.h +++ b/include/sys/conf.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/console.h b/include/sys/console.h index 31d419923..76ef61838 100644 --- a/include/sys/console.h +++ b/include/sys/console.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/cpupart.h b/include/sys/cpupart.h index 8416c99b6..fddeed6d0 100644 --- a/include/sys/cpupart.h +++ b/include/sys/cpupart.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/cpuvar.h b/include/sys/cpuvar.h index ca5a8b0a0..1284f940f 100644 --- a/include/sys/cpuvar.h +++ b/include/sys/cpuvar.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/crc32.h b/include/sys/crc32.h index 000a1dca5..1981f3579 100644 --- a/include/sys/crc32.h +++ b/include/sys/crc32.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/cred.h b/include/sys/cred.h index 778d05255..6c905884b 100644 --- a/include/sys/cred.h +++ b/include/sys/cred.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/ctype.h b/include/sys/ctype.h index 7ec2bc7fa..52037f9a1 100644 --- a/include/sys/ctype.h +++ b/include/sys/ctype.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/ddi.h b/include/sys/ddi.h index 903b1dd13..2fa1388fd 100644 --- a/include/sys/ddi.h +++ b/include/sys/ddi.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/debug.h b/include/sys/debug.h index 271dbc210..25ff88e3a 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/dirent.h b/include/sys/dirent.h index b99542e85..68f75da57 100644 --- a/include/sys/dirent.h +++ b/include/sys/dirent.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/disp.h b/include/sys/disp.h index 2a4b4ded8..9614a47c4 100644 --- a/include/sys/disp.h +++ b/include/sys/disp.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/dkio.h b/include/sys/dkio.h index 591fbf51d..d8c700718 100644 --- a/include/sys/dkio.h +++ b/include/sys/dkio.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/dklabel.h b/include/sys/dklabel.h index bd42622d1..74c0d506f 100644 --- a/include/sys/dklabel.h +++ b/include/sys/dklabel.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/dnlc.h b/include/sys/dnlc.h index b63c94fef..6834e067d 100644 --- a/include/sys/dnlc.h +++ b/include/sys/dnlc.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/dumphdr.h b/include/sys/dumphdr.h index 07396e2e6..1b45058ad 100644 --- a/include/sys/dumphdr.h +++ b/include/sys/dumphdr.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/efi_partition.h b/include/sys/efi_partition.h index 75df64f92..c39236423 100644 --- a/include/sys/efi_partition.h +++ b/include/sys/efi_partition.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/errno.h b/include/sys/errno.h index e6b446803..64d8482dc 100644 --- a/include/sys/errno.h +++ b/include/sys/errno.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/extdirent.h b/include/sys/extdirent.h index d9af31039..1a5c03145 100644 --- a/include/sys/extdirent.h +++ b/include/sys/extdirent.h @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/fcntl.h b/include/sys/fcntl.h index 4e260a4b8..88b7a6928 100644 --- a/include/sys/fcntl.h +++ b/include/sys/fcntl.h @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/file.h b/include/sys/file.h index fbeb8e258..67b301c6e 100644 --- a/include/sys/file.h +++ b/include/sys/file.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/fm/protocol.h b/include/sys/fm/protocol.h index 8c47f7c9b..e9ce6ff6c 100644 --- a/include/sys/fm/protocol.h +++ b/include/sys/fm/protocol.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/fm/util.h b/include/sys/fm/util.h index 40b8d47b2..7f2dbde9c 100644 --- a/include/sys/fm/util.h +++ b/include/sys/fm/util.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/fs/swapnode.h b/include/sys/fs/swapnode.h index 31be71620..a5df1298d 100644 --- a/include/sys/fs/swapnode.h +++ b/include/sys/fs/swapnode.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/idmap.h b/include/sys/idmap.h index b3c7c0f43..3618c655c 100644 --- a/include/sys/idmap.h +++ b/include/sys/idmap.h @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/int_limits.h b/include/sys/int_limits.h index ed4ad9d19..64f0a1102 100644 --- a/include/sys/int_limits.h +++ b/include/sys/int_limits.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/int_types.h b/include/sys/int_types.h index c97f47f6b..582fded20 100644 --- a/include/sys/int_types.h +++ b/include/sys/int_types.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/inttypes.h b/include/sys/inttypes.h index 6f7020134..82e555cdd 100644 --- a/include/sys/inttypes.h +++ b/include/sys/inttypes.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/isa_defs.h b/include/sys/isa_defs.h index 02136c596..35aee61c9 100644 --- a/include/sys/isa_defs.h +++ b/include/sys/isa_defs.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/kidmap.h b/include/sys/kidmap.h index ed87b9f7f..3d67b51a8 100644 --- a/include/sys/kidmap.h +++ b/include/sys/kidmap.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/kmem.h b/include/sys/kmem.h index d5d3061a5..516114fd7 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/kobj.h b/include/sys/kobj.h index b682e3f9d..f95fa8039 100644 --- a/include/sys/kobj.h +++ b/include/sys/kobj.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/kstat.h b/include/sys/kstat.h index 06379f827..9275c1ea4 100644 --- a/include/sys/kstat.h +++ b/include/sys/kstat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/list.h b/include/sys/list.h index 303b959de..563784ae4 100644 --- a/include/sys/list.h +++ b/include/sys/list.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/mkdev.h b/include/sys/mkdev.h index 89a9000d4..d765b7374 100644 --- a/include/sys/mkdev.h +++ b/include/sys/mkdev.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/mntent.h b/include/sys/mntent.h index 5f0565f4c..66fae87d4 100644 --- a/include/sys/mntent.h +++ b/include/sys/mntent.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/modctl.h b/include/sys/modctl.h index 52f679ad5..8d79e5312 100644 --- a/include/sys/modctl.h +++ b/include/sys/modctl.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/mode.h b/include/sys/mode.h index ddd504f9f..d09965e4a 100644 --- a/include/sys/mode.h +++ b/include/sys/mode.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/mount.h b/include/sys/mount.h index 5b33a6d3a..ca1796d7d 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/mutex.h b/include/sys/mutex.h index 905eed50e..ec3cfd529 100644 --- a/include/sys/mutex.h +++ b/include/sys/mutex.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/note.h b/include/sys/note.h index 6fcffc22e..511756272 100644 --- a/include/sys/note.h +++ b/include/sys/note.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/open.h b/include/sys/open.h index aafedd0a1..e3ebd8c84 100644 --- a/include/sys/open.h +++ b/include/sys/open.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/param.h b/include/sys/param.h index 5a1994960..5b5b5f550 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/pathname.h b/include/sys/pathname.h index d22c4f297..71ea441cb 100644 --- a/include/sys/pathname.h +++ b/include/sys/pathname.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/policy.h b/include/sys/policy.h index 950ec9554..45e724bc5 100644 --- a/include/sys/policy.h +++ b/include/sys/policy.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/pool.h b/include/sys/pool.h index 95aea6a09..bf6a0bb7d 100644 --- a/include/sys/pool.h +++ b/include/sys/pool.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/priv_impl.h b/include/sys/priv_impl.h index 28fa203a6..f1507a89e 100644 --- a/include/sys/priv_impl.h +++ b/include/sys/priv_impl.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/proc.h b/include/sys/proc.h index 1c02c676e..dbaf4162f 100644 --- a/include/sys/proc.h +++ b/include/sys/proc.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/processor.h b/include/sys/processor.h index 65438a4da..60b1a211b 100644 --- a/include/sys/processor.h +++ b/include/sys/processor.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/pset.h b/include/sys/pset.h index 9b0ebc4f8..2723d310b 100644 --- a/include/sys/pset.h +++ b/include/sys/pset.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/random.h b/include/sys/random.h index 8960240b1..2bf581f26 100644 --- a/include/sys/random.h +++ b/include/sys/random.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/refstr.h b/include/sys/refstr.h index a8d0edbfe..49a3417d1 100644 --- a/include/sys/refstr.h +++ b/include/sys/refstr.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/resource.h b/include/sys/resource.h index 68e3d2500..fe336555f 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index 9d29ad679..9dfbfe545 100644 --- a/include/sys/rwlock.h +++ b/include/sys/rwlock.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sdt.h b/include/sys/sdt.h index ed4680df9..6c8395f99 100644 --- a/include/sys/sdt.h +++ b/include/sys/sdt.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sid.h b/include/sys/sid.h index 17e32e25f..8ee5d0727 100644 --- a/include/sys/sid.h +++ b/include/sys/sid.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/signal.h b/include/sys/signal.h index 254bf0641..823fea329 100644 --- a/include/sys/signal.h +++ b/include/sys/signal.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/stat.h b/include/sys/stat.h index ccc01a025..cde7556a6 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/stropts.h b/include/sys/stropts.h index ae20c4d70..25c7ee18f 100644 --- a/include/sys/stropts.h +++ b/include/sys/stropts.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sunddi.h b/include/sys/sunddi.h index c3368083b..545803afd 100644 --- a/include/sys/sunddi.h +++ b/include/sys/sunddi.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sunldi.h b/include/sys/sunldi.h index a1a6a12c2..b4ff7391a 100644 --- a/include/sys/sunldi.h +++ b/include/sys/sunldi.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sysdc.h b/include/sys/sysdc.h index b1000013f..14ab48aa6 100644 --- a/include/sys/sysdc.h +++ b/include/sys/sysdc.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sysevent.h b/include/sys/sysevent.h index 723220f0f..5a7ca41ce 100644 --- a/include/sys/sysevent.h +++ b/include/sys/sysevent.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sysevent/eventdefs.h b/include/sys/sysevent/eventdefs.h index 2112e29ed..592c78a64 100644 --- a/include/sys/sysevent/eventdefs.h +++ b/include/sys/sysevent/eventdefs.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 04a62b196..7c4da67fc 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/systeminfo.h b/include/sys/systeminfo.h index a32f7142e..e22a08530 100644 --- a/include/sys/systeminfo.h +++ b/include/sys/systeminfo.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/systm.h b/include/sys/systm.h index f3e310a13..3336fb357 100644 --- a/include/sys/systm.h +++ b/include/sys/systm.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/t_lock.h b/include/sys/t_lock.h index 1055f7f6a..6c159f933 100644 --- a/include/sys/t_lock.h +++ b/include/sys/t_lock.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/taskq.h b/include/sys/taskq.h index 3839de288..7b44e8b8a 100644 --- a/include/sys/taskq.h +++ b/include/sys/taskq.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/thread.h b/include/sys/thread.h index 3a708236c..369b3061d 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/time.h b/include/sys/time.h index 341b531ef..f8d78d194 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/timer.h b/include/sys/timer.h index ea6043696..096eb1a4e 100644 --- a/include/sys/timer.h +++ b/include/sys/timer.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/tsd.h b/include/sys/tsd.h index a31f60605..ebc55b09b 100644 --- a/include/sys/tsd.h +++ b/include/sys/tsd.h @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/types.h b/include/sys/types.h index b867be111..decb6bba8 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/types32.h b/include/sys/types32.h index 25c4642dc..6ee580f4e 100644 --- a/include/sys/types32.h +++ b/include/sys/types32.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/u8_textprep.h b/include/sys/u8_textprep.h index 456077c6f..0a21c708c 100644 --- a/include/sys/u8_textprep.h +++ b/include/sys/u8_textprep.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/uio.h b/include/sys/uio.h index 87da72701..25c5f4a01 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/unistd.h b/include/sys/unistd.h index a2acfa705..e1d93c61e 100644 --- a/include/sys/unistd.h +++ b/include/sys/unistd.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/utsname.h b/include/sys/utsname.h index fa403ff52..3d979c13a 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/va_list.h b/include/sys/va_list.h index 644812881..9fa173b58 100644 --- a/include/sys/va_list.h +++ b/include/sys/va_list.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/varargs.h b/include/sys/varargs.h index b74570c21..bf360ff4d 100644 --- a/include/sys/varargs.h +++ b/include/sys/varargs.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/vfs.h b/include/sys/vfs.h index 88ca21d52..f01dc11cb 100644 --- a/include/sys/vfs.h +++ b/include/sys/vfs.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/vfs_opreg.h b/include/sys/vfs_opreg.h index 5dda4d36b..d3540c593 100644 --- a/include/sys/vfs_opreg.h +++ b/include/sys/vfs_opreg.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index b8191f3ac..9c52d2824 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/vnode.h b/include/sys/vnode.h index 99614d55b..35607e1ea 100644 --- a/include/sys/vnode.h +++ b/include/sys/vnode.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/zmod.h b/include/sys/zmod.h index a6519dec2..15b0bc8e7 100644 --- a/include/sys/zmod.h +++ b/include/sys/zmod.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/sys/zone.h b/include/sys/zone.h index 9c2652fd2..6b7a1c65f 100644 --- a/include/sys/zone.h +++ b/include/sys/zone.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/unistd.h b/include/unistd.h index a2acfa705..e1d93c61e 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/util/qsort.h b/include/util/qsort.h index 890674acd..e55c4f8cc 100644 --- a/include/util/qsort.h +++ b/include/util/qsort.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/util/sscanf.h b/include/util/sscanf.h index 4ea907148..23f0b5db0 100644 --- a/include/util/sscanf.h +++ b/include/util/sscanf.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/vm/anon.h b/include/vm/anon.h index 51e8512ba..9c9c23959 100644 --- a/include/vm/anon.h +++ b/include/vm/anon.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/vm/pvn.h b/include/vm/pvn.h index c206b1b77..f3b308137 100644 --- a/include/vm/pvn.h +++ b/include/vm/pvn.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/include/vm/seg_kmem.h b/include/vm/seg_kmem.h index b21f71a52..17df7b961 100644 --- a/include/vm/seg_kmem.h +++ b/include/vm/seg_kmem.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-atomic.c b/module/spl/spl-atomic.c index e37b96907..c46252c10 100644 --- a/module/spl/spl-atomic.c +++ b/module/spl/spl-atomic.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c index fefe98598..60cf726f9 100644 --- a/module/spl/spl-condvar.c +++ b/module/spl/spl-condvar.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-cred.c b/module/spl/spl-cred.c index ce3425d32..e669cbf5d 100644 --- a/module/spl/spl-cred.c +++ b/module/spl/spl-cred.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 3c3dab0c8..37599acdd 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index c837d1eaa..b6d15f019 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index 39357617c..3cef48946 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 413aa1245..e3538b5ff 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index 684d57226..f14f47f5d 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index ea2d67dd4..b7e4b9426 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-mutex.c b/module/spl/spl-mutex.c index d452681b1..f0e786da5 100644 --- a/module/spl/spl-mutex.c +++ b/module/spl/spl-mutex.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 2fb295439..cd4fa1b47 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-rwlock.c b/module/spl/spl-rwlock.c index c0f974f1b..462a6f0de 100644 --- a/module/spl/spl-rwlock.c +++ b/module/spl/spl-rwlock.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index c9ae0a50b..4feca0452 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index 71e5f331d..6b3bec509 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c index 6ef9b8fc8..8f43b54cd 100644 --- a/module/spl/spl-time.c +++ b/module/spl/spl-time.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-tsd.c b/module/spl/spl-tsd.c index c63a55274..d7749cf7b 100644 --- a/module/spl/spl-tsd.c +++ b/module/spl/spl-tsd.c @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index d8da9814b..4d571c6c4 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index eba470a4b..62efa31a5 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -3,7 +3,7 @@ * Written by Ricardo Correia * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c index 4f88cb4e0..807e743d5 100644 --- a/module/spl/spl-zlib.c +++ b/module/spl/spl-zlib.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-atomic.c b/module/splat/splat-atomic.c index efb01578a..df3b38f58 100644 --- a/module/splat/splat-atomic.c +++ b/module/splat/splat-atomic.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-condvar.c b/module/splat/splat-condvar.c index 1fe306cb2..1ddde39bb 100644 --- a/module/splat/splat-condvar.c +++ b/module/splat/splat-condvar.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-cred.c b/module/splat/splat-cred.c index 0efabd854..47dfa02f6 100644 --- a/module/splat/splat-cred.c +++ b/module/splat/splat-cred.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index c68281a84..54b2ff459 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-generic.c b/module/splat/splat-generic.c index 38df14d3b..ad03651d0 100644 --- a/module/splat/splat-generic.c +++ b/module/splat/splat-generic.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-internal.h b/module/splat/splat-internal.h index 14303a105..b138196f5 100644 --- a/module/splat/splat-internal.h +++ b/module/splat/splat-internal.h @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-kmem.c b/module/splat/splat-kmem.c index 789e75e56..0eab14217 100644 --- a/module/splat/splat-kmem.c +++ b/module/splat/splat-kmem.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-kobj.c b/module/splat/splat-kobj.c index c76795418..a0d4097d5 100644 --- a/module/splat/splat-kobj.c +++ b/module/splat/splat-kobj.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-linux.c b/module/splat/splat-linux.c index 0a1808f61..ce809e647 100644 --- a/module/splat/splat-linux.c +++ b/module/splat/splat-linux.c @@ -5,7 +5,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-list.c b/module/splat/splat-list.c index 34b570f39..f59394c14 100644 --- a/module/splat/splat-list.c +++ b/module/splat/splat-list.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-mutex.c b/module/splat/splat-mutex.c index 9e6b24708..cc1d36869 100644 --- a/module/splat/splat-mutex.c +++ b/module/splat/splat-mutex.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-random.c b/module/splat/splat-random.c index 63d96444f..33b799bad 100644 --- a/module/splat/splat-random.c +++ b/module/splat/splat-random.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-rwlock.c b/module/splat/splat-rwlock.c index f4a010969..a865fb310 100644 --- a/module/splat/splat-rwlock.c +++ b/module/splat/splat-rwlock.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-taskq.c b/module/splat/splat-taskq.c index 5a9681e21..e4793d457 100644 --- a/module/splat/splat-taskq.c +++ b/module/splat/splat-taskq.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-thread.c b/module/splat/splat-thread.c index c54cbcd8a..a1e70db47 100644 --- a/module/splat/splat-thread.c +++ b/module/splat/splat-thread.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-time.c b/module/splat/splat-time.c index e6f8dc682..ca60c45c6 100644 --- a/module/splat/splat-time.c +++ b/module/splat/splat-time.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-vnode.c b/module/splat/splat-vnode.c index a7034c115..f3f17ec92 100644 --- a/module/splat/splat-vnode.c +++ b/module/splat/splat-vnode.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/module/splat/splat-zlib.c b/module/splat/splat-zlib.c index 852cf818f..c614c5e6c 100644 --- a/module/splat/splat-zlib.c +++ b/module/splat/splat-zlib.c @@ -6,7 +6,7 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . + * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/scripts/check.sh b/scripts/check.sh index 4334ff3a5..fc97cec23 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -7,7 +7,7 @@ # UCRL-CODE-235197 # # This file is part of the SPL, Solaris Porting Layer. -# For details, see . +# For details, see . # # The SPL is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the -- cgit v1.2.3 From f6a869614e5bdf9a3819a845f7a90d8c9ede0fc3 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Wed, 18 Jun 2014 15:22:50 -0500 Subject: Safer debugging and assertion macros. Spl's debugging and assertion macros macro used the typical do/while(0) form for if/else friendliness, however, this limits their use in contexts where a do loop is not valid; such as within another multi-statement style macro. The following macros have been converted to not use do/while(0): PANIC, ASSERT, ASSERTF, VERIFY, VERIFY3_IMPL PANIC has been converted to a wrapper around the new spl_PANIC() function. The other macros have been converted to use the "&&" operator for the branch-predicition conditional and also to use spl_PANIC(). The __ASSERT() macro was not touched. It is only used by the debugging infrastructure and that code, including this macro, will be retired when the tracepoint patches are merged. Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #367 --- include/sys/debug.h | 56 +++++++++++++++++++++++----------------------------- module/spl/spl-err.c | 21 ++++++++++++++++++++ 2 files changed, 46 insertions(+), 31 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/include/sys/debug.h b/include/sys/debug.h index 9fa2653d4..3a4b1352f 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -54,28 +54,23 @@ #define SPL_DEBUG_STR "" #define PANIC(fmt, a...) \ -do { \ - printk(KERN_EMERG fmt, ## a); \ - spl_debug_bug(__FILE__, __FUNCTION__, __LINE__, 0); \ -} while (0) + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, fmt, ## a) #define __ASSERT(x) ((void)0) #define ASSERT(x) ((void)0) #define ASSERTF(x, y, z...) ((void)0) #define ASSERTV(x) #define VERIFY(cond) \ -do { \ - if (unlikely(!(cond))) \ - PANIC("VERIFY(" #cond ") failed\n"); \ -} while (0) + (void)(unlikely(!(cond)) && \ + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ + "%s", "VERIFY(" #cond ") failed\n")) #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ -do { \ - if (!((TYPE)(LEFT) OP (TYPE)(RIGHT))) \ - PANIC("VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ + (void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \ + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ + "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ "failed (" FMT " " #OP " " FMT ")\n", \ - CAST (LEFT), CAST (RIGHT)); \ -} while (0) + CAST (LEFT), CAST (RIGHT))) #define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) #define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ @@ -94,11 +89,7 @@ do { \ #define SPL_DEBUG_STR " (DEBUG mode)" #define PANIC(fmt, a...) \ -do { \ - spl_debug_msg(NULL, 0, 0, \ - __FILE__, __FUNCTION__, __LINE__, fmt, ## a); \ - spl_debug_bug(__FILE__, __FUNCTION__, __LINE__, 0); \ -} while (0) + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, fmt, ## a) /* ASSERTION that is safe to use within the debug system */ #define __ASSERT(cond) \ @@ -111,24 +102,21 @@ do { \ /* ASSERTION that will debug log used outside the debug sysytem */ #define ASSERT(cond) \ -do { \ - if (unlikely(!(cond))) \ - PANIC("ASSERTION(" #cond ") failed\n"); \ -} while (0) + (void)(unlikely(!(cond)) && \ + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ + "%s", "ASSERTION(" #cond ") failed\n")) #define ASSERTF(cond, fmt, a...) \ -do { \ - if (unlikely(!(cond))) \ - PANIC("ASSERTION(" #cond ") failed: " fmt, ## a); \ -} while (0) + (void)(unlikely(!(cond)) && \ + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ + "ASSERTION(" #cond ") failed: " fmt, ## a)) #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ -do { \ - if (!((TYPE)(LEFT) OP (TYPE)(RIGHT))) \ - PANIC("VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ + (void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \ + spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ + "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ "failed (" FMT " " #OP " " FMT ")\n", \ - CAST (LEFT), CAST (RIGHT)); \ -} while (0) + CAST (LEFT), CAST (RIGHT))) #define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) #define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ @@ -146,6 +134,12 @@ do { \ #endif /* NDEBUG */ +/* + * Helpers for the Solaris debug macros above + */ +extern int spl_PANIC(char *filename, const char *functionname, + int lineno, const char *fmt, ...); + /* * Compile-time assertion. The condition 'x' must be constant. */ diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index b6d15f019..2706f9bd1 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -39,6 +39,27 @@ static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" }; #endif +int +spl_PANIC(char *filename, const char *functionname, + int lineno, const char *fmt, ...) { + char msg[MAXMSGLEN]; + va_list ap; + + va_start(ap, fmt); + if (vsnprintf(msg, sizeof (msg), fmt, ap) == sizeof (msg)) + msg[sizeof (msg) - 1] = '\0'; + va_end(ap); +#ifdef NDEBUG + printk(KERN_EMERG "%s", msg); +#else + spl_debug_msg(NULL, 0, 0, + filename, functionname, lineno, "%s", msg); +#endif + spl_debug_bug(filename, functionname, lineno, 0); + return 1; +} +EXPORT_SYMBOL(spl_PANIC); + void vpanic(const char *fmt, va_list ap) { -- cgit v1.2.3 From 8d9a23e82cea5d897e9357d569ef364106703d5a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 5 Nov 2014 17:30:35 -0500 Subject: Retire legacy debugging infrastructure When the SPL was originally written Linux tracepoints were still in their infancy. Therefore, an entire debugging subsystem was added to facilite tracing which served us well for many years. Now that Linux tracepoints have matured they provide all the functionality of the previous tracing subsystem. Rather than maintain parallel functionality it makes sense to fully adopt tracepoints. Therefore, this patch retires the legacy debugging infrastructure. See zfsonlinux/zfs@bc9f413 for the tracepoint changes. Signed-off-by: Ned Bass Signed-off-by: Brian Behlendorf Closes #408 --- cmd/Makefile.am | 3 - cmd/spl.c | 243 -------- config/spl-build.m4 | 36 +- include/Makefile.am | 2 - include/spl-debug.h | 276 --------- include/spl-trace.h | 132 ----- include/sys/debug.h | 140 ++--- include/sys/kmem.h | 22 +- module/spl/Makefile.in | 1 - module/spl/spl-condvar.c | 30 +- module/spl/spl-debug.c | 1265 ----------------------------------------- module/spl/spl-err.c | 96 ++-- module/spl/spl-generic.c | 36 +- module/spl/spl-kmem.c | 302 ++++------ module/spl/spl-kobj.c | 24 +- module/spl/spl-kstat.c | 26 +- module/spl/spl-proc.c | 373 +----------- module/spl/spl-taskq.c | 106 ++-- module/spl/spl-thread.c | 22 +- module/spl/spl-tsd.c | 87 +-- module/spl/spl-vnode.c | 133 ++--- module/spl/spl-xdr.c | 13 +- module/spl/spl-zlib.c | 14 +- module/splat/splat-internal.h | 1 - module/splat/splat-kmem.c | 2 +- scripts/dkms.mkconf | 4 - 26 files changed, 389 insertions(+), 3000 deletions(-) delete mode 100644 cmd/spl.c delete mode 100644 include/spl-debug.h delete mode 100644 include/spl-trace.h delete mode 100644 module/spl/spl-debug.c (limited to 'module/spl/spl-err.c') diff --git a/cmd/Makefile.am b/cmd/Makefile.am index fed6feec2..01afdcf25 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -3,11 +3,8 @@ include $(top_srcdir)/config/Rules.am DEFAULT_INCLUDES += \ -I$(top_srcdir)/lib -noinst_PROGRAMS = spl sbin_PROGRAMS = splat -spl_SOURCES = spl.c - splat_SOURCES = splat.c splat_LDFLAGS = $(top_builddir)/lib/libcommon.la diff --git a/cmd/spl.c b/cmd/spl.c deleted file mode 100644 index 3028e3ab0..000000000 --- a/cmd/spl.c +++ /dev/null @@ -1,243 +0,0 @@ -/*****************************************************************************\ - * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. - * Copyright (C) 2007 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Brian Behlendorf . - * UCRL-CODE-235197 - * - * This file is part of the SPL, Solaris Porting Layer. - * For details, see . - * - * The SPL is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * The SPL is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with the SPL. If not, see . - ***************************************************************************** - * Solaris Porting Layer (SPL) User Space Interface. -\*****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "../include/spl-ctl.h" - -static int spl_debug_mask = ~0; -static int spl_debug_subsystem = ~0; - -/* all strings nul-terminated; only the struct and hdr need to be freed */ -struct dbg_line { - struct spl_debug_header *hdr; - char *file; - char *fn; - char *text; -}; - -static int -cmp_rec(const void *p1, const void *p2) -{ - struct dbg_line *d1 = *(struct dbg_line **)p1; - struct dbg_line *d2 = *(struct dbg_line **)p2; - - if (d1->hdr->ph_sec < d2->hdr->ph_sec) - return -1; - - if (d1->hdr->ph_sec == d2->hdr->ph_sec && - d1->hdr->ph_usec < d2->hdr->ph_usec) - return -1; - - if (d1->hdr->ph_sec == d2->hdr->ph_sec && - d1->hdr->ph_usec == d2->hdr->ph_usec) - return 0; - - return 1; -} - -static void -print_rec(struct dbg_line **linev, int used, FILE *out) -{ - int i; - - for (i = 0; i < used; i++) { - struct dbg_line *line = linev[i]; - struct spl_debug_header *hdr = line->hdr; - - fprintf(out, "%08x:%08x:%u:%u.%06llu:%u:%u:%u:(%s:%u:%s()) %s", - hdr->ph_subsys, hdr->ph_mask, hdr->ph_cpu_id, - hdr->ph_sec, (unsigned long long)hdr->ph_usec, - hdr->ph_stack, hdr->ph_pid, hdr->ph_stack, line->file, - hdr->ph_line_num, line->fn, line->text); - free(line->hdr); - free(line); - } - - free(linev); -} - -static int -add_rec(struct dbg_line *line, struct dbg_line ***linevp, int *lenp, int used) -{ - struct dbg_line **linev = *linevp; - - if (used == *lenp) { - int nlen = *lenp + 512; - int nsize = nlen * sizeof(struct dbg_line *); - - linev = *linevp ? realloc(*linevp, nsize) : malloc(nsize); - if (!linev) - return 0; - *linevp = linev; - *lenp = nlen; - } - linev[used] = line; - return 1; -} - -static int -parse_buffer(FILE *in, FILE *out) -{ - struct dbg_line *line; - struct spl_debug_header *hdr; - char buf[4097], *p; - unsigned long dropped = 0, kept = 0; - struct dbg_line **linev = NULL; - const int phl = sizeof(hdr->ph_len); - const int phf = sizeof(hdr->ph_flags); - int rc, linev_len = 0; - - while (1) { - rc = fread(buf, phl + phf, 1, in); - if (rc <= 0) - break; - - hdr = (void *)buf; - if (hdr->ph_len == 0) - break; - if (hdr->ph_len > 4094) { - fprintf(stderr, "unexpected large record: %d bytes. " - "aborting.\n", hdr->ph_len); - break; - } - - rc = fread(buf + phl + phf, 1, hdr->ph_len - phl - phf, in); - if (rc <= 0) - break; - - if (hdr->ph_mask && - (!(spl_debug_subsystem & hdr->ph_subsys) || - (!(spl_debug_mask & hdr->ph_mask)))) { - dropped++; - continue; - } - - line = malloc(sizeof(*line)); - if (line == NULL) { - fprintf(stderr, "malloc failed; printing accumulated " - "records and exiting.\n"); - break; - } - - line->hdr = malloc(hdr->ph_len + 1); - if (line->hdr == NULL) { - free(line); - fprintf(stderr, "malloc failed; printing accumulated " - "records and exiting.\n"); - break; - } - - p = (void *)line->hdr; - memcpy(line->hdr, buf, hdr->ph_len); - p[hdr->ph_len] = '\0'; - - p += sizeof(*hdr); - line->file = p; - p += strlen(line->file) + 1; - line->fn = p; - p += strlen(line->fn) + 1; - line->text = p; - - if (!add_rec(line, &linev, &linev_len, kept)) { - fprintf(stderr, "malloc failed; printing accumulated " - "records and exiting.\n"); - break; - } - kept++; - } - - if (linev) { - qsort(linev, kept, sizeof(struct dbg_line *), cmp_rec); - print_rec(linev, kept, out); - } - - printf("Debug log: %lu lines, %lu kept, %lu dropped.\n", - dropped + kept, kept, dropped); - return 0; -} - -int -main(int argc, char *argv[]) -{ - int fdin, fdout; - FILE *in, *out = stdout; - int rc, o_lf = 0; - - if (argc > 3 || argc < 2) { - fprintf(stderr, "usage: %s [output]\n", argv[0]); - return 0; - } - -#ifdef __USE_LARGEFILE64 - o_lf = O_LARGEFILE; -#endif - - fdin = open(argv[1], O_RDONLY | o_lf); - if (fdin == -1) { - fprintf(stderr, "open(%s) failed: %s\n", argv[1], - strerror(errno)); - return 1; - } - in = fdopen(fdin, "r"); - if (in == NULL) { - fprintf(stderr, "fopen(%s) failed: %s\n", argv[1], - strerror(errno)); - close(fdin); - return 1; - } - if (argc > 2) { - fdout = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY | o_lf, 0600); - if (fdout == -1) { - fprintf(stderr, "open(%s) failed: %s\n", argv[2], - strerror(errno)); - fclose(in); - return 1; - } - out = fdopen(fdout, "w"); - if (out == NULL) { - fprintf(stderr, "fopen(%s) failed: %s\n", argv[2], - strerror(errno)); - fclose(in); - close(fdout); - return 1; - } - } - - rc = parse_buffer(in, out); - - fclose(in); - if (out != stdout) - fclose(out); - - return rc; -} diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 5a33f5e8e..d2cb68b6b 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -18,7 +18,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ AC_SUBST(KERNELCPPFLAGS) SPL_AC_DEBUG - SPL_AC_DEBUG_LOG SPL_AC_DEBUG_KMEM SPL_AC_DEBUG_KMEM_TRACKING SPL_AC_TEST_MODULE @@ -219,7 +218,7 @@ AC_DEFUN([SPL_AC_RPM], [ AC_MSG_RESULT([$HAVE_RPMBUILD]) ]) - RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_LOG) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"' + RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"' RPM_DEFINE_UTIL= RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"' RPM_DEFINE_DKMS= @@ -452,39 +451,6 @@ AC_DEFUN([SPL_AC_DEBUG], [ AC_MSG_RESULT([$enable_debug]) ]) -dnl # -dnl # Enabled by default it provides a basic debug log infrastructure. -dnl # Each subsystem registers itself with a name and logs messages -dnl # using predefined types. If the debug mask it set to allow the -dnl # message type it will be written to the internal log. The log -dnl # can be dumped to a file by echoing 1 to the 'dump' proc entry, -dnl # after dumping the log it must be decoded using the spl utility. -dnl # -dnl # echo 1 >/proc/sys/kernel/spl/debug/dump -dnl # spl /tmp/spl-log.xxx.yyy /tmp/spl-log.xxx.yyy.txt -dnl # -AC_DEFUN([SPL_AC_DEBUG_LOG], [ - AC_ARG_ENABLE([debug-log], - [AS_HELP_STRING([--enable-debug-log], - [Enable basic debug logging @<:@default=yes@:>@])], - [], - [enable_debug_log=yes]) - - AS_IF([test "x$enable_debug_log" = xyes], - [ - KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_LOG" - DEBUG_LOG="_with_debug_log" - AC_DEFINE([DEBUG_LOG], [1], - [Define to 1 to enable basic debug logging]) - ], [ - DEBUG_LOG="_without_debug_log" - ]) - - AC_SUBST(DEBUG_LOG) - AC_MSG_CHECKING([whether basic debug logging is enabled]) - AC_MSG_RESULT([$enable_debug_log]) -]) - dnl # dnl # Enabled by default it provides a minimal level of memory tracking. dnl # A total count of bytes allocated is kept for each alloc and free. diff --git a/include/Makefile.am b/include/Makefile.am index f9b812de3..3200222db 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,8 +5,6 @@ COMMON_H = KERNEL_H = \ $(top_srcdir)/include/splat-ctl.h \ $(top_srcdir)/include/spl-ctl.h \ - $(top_srcdir)/include/spl-debug.h \ - $(top_srcdir)/include/spl-trace.h \ $(top_srcdir)/include/strings.h \ $(top_srcdir)/include/unistd.h diff --git a/include/spl-debug.h b/include/spl-debug.h deleted file mode 100644 index c91b864c2..000000000 --- a/include/spl-debug.h +++ /dev/null @@ -1,276 +0,0 @@ -/*****************************************************************************\ - * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. - * Copyright (C) 2007 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Brian Behlendorf . - * UCRL-CODE-235197 - * - * This file is part of the SPL, Solaris Porting Layer. - * For details, see . - * - * The SPL is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * The SPL is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with the SPL. If not, see . -\*****************************************************************************/ - -/* - * Available debug functions. These function should be used by any - * package which needs to integrate with the SPL log infrastructure. - * - * SDEBUG() - Log debug message with specified mask. - * SDEBUG_LIMIT() - Log just 1 debug message with specified mask. - * SWARN() - Log a warning message. - * SERROR() - Log an error message. - * SEMERG() - Log an emergency error message. - * SCONSOLE() - Log a generic message to the console. - * - * SENTRY - Log entry point to a function. - * SEXIT - Log exit point from a function. - * SRETURN(x) - Log return from a function. - * SGOTO(x, y) - Log goto within a function. - */ - -#ifndef _SPL_DEBUG_INTERNAL_H -#define _SPL_DEBUG_INTERNAL_H - -#include -#include - -#define SS_UNDEFINED 0x00000001 -#define SS_ATOMIC 0x00000002 -#define SS_KOBJ 0x00000004 -#define SS_VNODE 0x00000008 -#define SS_TIME 0x00000010 -#define SS_RWLOCK 0x00000020 -#define SS_THREAD 0x00000040 -#define SS_CONDVAR 0x00000080 -#define SS_MUTEX 0x00000100 -#define SS_RNG 0x00000200 -#define SS_TASKQ 0x00000400 -#define SS_KMEM 0x00000800 -#define SS_DEBUG 0x00001000 -#define SS_GENERIC 0x00002000 -#define SS_PROC 0x00004000 -#define SS_MODULE 0x00008000 -#define SS_CRED 0x00010000 -#define SS_KSTAT 0x00020000 -#define SS_XDR 0x00040000 -#define SS_TSD 0x00080000 -#define SS_ZLIB 0x00100000 -#define SS_USER1 0x01000000 -#define SS_USER2 0x02000000 -#define SS_USER3 0x04000000 -#define SS_USER4 0x08000000 -#define SS_USER5 0x10000000 -#define SS_USER6 0x20000000 -#define SS_USER7 0x40000000 -#define SS_USER8 0x80000000 -#define SS_DEBUG_SUBSYS SS_UNDEFINED - -#define SD_TRACE 0x00000001 -#define SD_INFO 0x00000002 -#define SD_WARNING 0x00000004 -#define SD_ERROR 0x00000008 -#define SD_EMERG 0x00000010 -#define SD_CONSOLE 0x00000020 -#define SD_IOCTL 0x00000040 -#define SD_DPRINTF 0x00000080 -#define SD_OTHER 0x00000100 -#define SD_CANTMASK (SD_ERROR | SD_EMERG | SD_WARNING | SD_CONSOLE) - -/* Debug log support enabled */ -#ifdef DEBUG_LOG - -#define __SDEBUG(cdls, subsys, mask, format, a...) \ -do { \ - if (((mask) & SD_CANTMASK) != 0 || \ - ((spl_debug_mask & (mask)) != 0 && \ - (spl_debug_subsys & (subsys)) != 0)) \ - spl_debug_msg(cdls, subsys, mask, __FILE__, \ - __FUNCTION__, __LINE__, format, ## a); \ -} while (0) - -#define SDEBUG(mask, format, a...) \ - __SDEBUG(NULL, SS_DEBUG_SUBSYS, mask, format, ## a) - -#define __SDEBUG_LIMIT(subsys, mask, format, a...) \ -do { \ - static spl_debug_limit_state_t cdls; \ - \ - __SDEBUG(&cdls, subsys, mask, format, ## a); \ -} while (0) - -#define SDEBUG_LIMIT(mask, format, a...) \ - __SDEBUG_LIMIT(SS_DEBUG_SUBSYS, mask, format, ## a) - -#define SWARN(fmt, a...) SDEBUG_LIMIT(SD_WARNING, fmt, ## a) -#define SERROR(fmt, a...) SDEBUG_LIMIT(SD_ERROR, fmt, ## a) -#define SEMERG(fmt, a...) SDEBUG_LIMIT(SD_EMERG, fmt, ## a) -#define SCONSOLE(mask, fmt, a...) SDEBUG(SD_CONSOLE | (mask), fmt, ## a) - -#define SENTRY SDEBUG(SD_TRACE, "Process entered\n") -#define SEXIT SDEBUG(SD_TRACE, "Process leaving\n") - -#define SRETURN(rc) \ -do { \ - typeof(rc) RETURN__ret = (rc); \ - SDEBUG(SD_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ - (long)RETURN__ret, (long)RETURN__ret, (long)RETURN__ret); \ - return RETURN__ret; \ -} while (0) - -#define SGOTO(label, rc) \ -do { \ - long GOTO__ret = (long)(rc); \ - SDEBUG(SD_TRACE,"Process leaving via %s (rc=%lu : %ld : %lx)\n",\ - #label, (unsigned long)GOTO__ret, (signed long)GOTO__ret, \ - (signed long)GOTO__ret); \ - goto label; \ -} while (0) - -typedef struct { - unsigned long cdls_next; - int cdls_count; - long cdls_delay; -} spl_debug_limit_state_t; - -/* Global debug variables */ -extern unsigned long spl_debug_subsys; -extern unsigned long spl_debug_mask; -extern unsigned long spl_debug_printk; -extern int spl_debug_mb; -extern unsigned int spl_debug_binary; -extern unsigned int spl_debug_catastrophe; -extern unsigned int spl_debug_panic_on_bug; -extern char spl_debug_file_path[PATH_MAX]; -extern unsigned int spl_console_ratelimit; -extern long spl_console_max_delay; -extern long spl_console_min_delay; -extern unsigned int spl_console_backoff; -extern unsigned int spl_debug_stack; - -/* Exported debug functions */ -extern int spl_debug_mask2str(char *str, int size, unsigned long mask, int ss); -extern int spl_debug_str2mask(unsigned long *mask, const char *str, int ss); -extern unsigned long spl_debug_set_mask(unsigned long mask); -extern unsigned long spl_debug_get_mask(void); -extern unsigned long spl_debug_set_subsys(unsigned long mask); -extern unsigned long spl_debug_get_subsys(void); -extern int spl_debug_set_mb(int mb); -extern int spl_debug_get_mb(void); -extern int spl_debug_dumplog(int flags); -extern void spl_debug_dumpstack(struct task_struct *tsk); -extern void spl_debug_bug(char *file, const char *fn, const int line, int fl); -extern int spl_debug_msg(void *arg, int subsys, int mask, const char *file, - const char *fn, const int line, const char *format, ...); -extern int spl_debug_clear_buffer(void); -extern int spl_debug_mark_buffer(char *text); - -int spl_debug_init(void); -void spl_debug_fini(void); - -/* Debug log support disabled */ -#else /* DEBUG_LOG */ - -#define __SDEBUG(x, y, mask, fmt, a...) ((void)0) -#define SDEBUG(mask, fmt, a...) ((void)0) -#define SDEBUG_LIMIT(x, y, fmt, a...) ((void)0) -#define SWARN(fmt, a...) ((void)0) -#define SERROR(fmt, a...) ((void)0) -#define SEMERG(fmt, a...) ((void)0) -#define SCONSOLE(mask, fmt, a...) ((void)0) - -#define SENTRY ((void)0) -#define SEXIT ((void)0) -#define SRETURN(x) return (x) -#define SGOTO(x, y) { ((void)(y)); goto x; } - -static inline unsigned long -spl_debug_set_mask(unsigned long mask) { - return (0); -} - -static inline unsigned long -spl_debug_get_mask(void) { - return (0); -} - -static inline unsigned long -spl_debug_set_subsys(unsigned long mask) { - return (0); -} - -static inline unsigned long -spl_debug_get_subsys(void) { - return (0); -} - -static inline int -spl_debug_set_mb(int mb) { - return (0); -} - -static inline int -spl_debug_get_mb(void) { - return (0); -} - -static inline int -spl_debug_dumplog(int flags) -{ - return (0); -} - -static inline void -spl_debug_dumpstack(struct task_struct *tsk) -{ - return; -} - -static inline void -spl_debug_bug(char *file, const char *fn, const int line, int fl) -{ - return; -} - -static inline int -spl_debug_msg(void *arg, int subsys, int mask, const char *file, - const char *fn, const int line, const char *format, ...) -{ - return (0); -} - -static inline int -spl_debug_clear_buffer(void) -{ - return (0); -} - -static inline int -spl_debug_mark_buffer(char *text) -{ - return (0); -} - -static inline int -spl_debug_init(void) { - return (0); -} - -static inline void -spl_debug_fini(void) { - return; -} - -#endif /* DEBUG_LOG */ - -#endif /* SPL_DEBUG_INTERNAL_H */ diff --git a/include/spl-trace.h b/include/spl-trace.h deleted file mode 100644 index 8ef173e76..000000000 --- a/include/spl-trace.h +++ /dev/null @@ -1,132 +0,0 @@ -/*****************************************************************************\ - * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. - * Copyright (C) 2007 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Brian Behlendorf . - * UCRL-CODE-235197 - * - * This file is part of the SPL, Solaris Porting Layer. - * For details, see . - * - * The SPL is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * The SPL is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with the SPL. If not, see . -\*****************************************************************************/ - -#ifndef _SPL_TRACE_H -#define _SPL_TRACE_H - -#define TCD_MAX_PAGES (5 << (20 - PAGE_SHIFT)) -#define TCD_STOCK_PAGES (TCD_MAX_PAGES) -#define TRACE_CONSOLE_BUFFER_SIZE 1024 - -#define SPL_DEFAULT_MAX_DELAY (600 * HZ) -#define SPL_DEFAULT_MIN_DELAY ((HZ + 1) / 2) -#define SPL_DEFAULT_BACKOFF 2 - -#define DL_NOTHREAD 0x0001 /* Do not create a new thread */ -#define DL_SINGLE_CPU 0x0002 /* Collect pages from this CPU*/ - -typedef struct dumplog_priv { - wait_queue_head_t dp_waitq; - pid_t dp_pid; - int dp_flags; - atomic_t dp_done; -} dumplog_priv_t; - -/* Three trace data types */ -typedef enum { - TCD_TYPE_PROC, - TCD_TYPE_SOFTIRQ, - TCD_TYPE_IRQ, - TCD_TYPE_MAX -} tcd_type_t; - -union trace_data_union { - struct trace_cpu_data { - /* pages with trace records not yet processed by tracefiled */ - struct list_head tcd_pages; - /* number of pages on ->tcd_pages */ - unsigned long tcd_cur_pages; - /* Max number of pages allowed on ->tcd_pages */ - unsigned long tcd_max_pages; - - /* - * preallocated pages to write trace records into. Pages from - * ->tcd_stock_pages are moved to ->tcd_pages by spl_debug_msg(). - * - * This list is necessary, because on some platforms it's - * impossible to perform efficient atomic page allocation in a - * non-blockable context. - * - * Such platforms fill ->tcd_stock_pages "on occasion", when - * tracing code is entered in blockable context. - * - * trace_get_tage_try() tries to get a page from - * ->tcd_stock_pages first and resorts to atomic page - * allocation only if this queue is empty. ->tcd_stock_pages - * is replenished when tracing code is entered in blocking - * context (darwin-tracefile.c:trace_get_tcd()). We try to - * maintain TCD_STOCK_PAGES (40 by default) pages in this - * queue. Atomic allocation is only required if more than - * TCD_STOCK_PAGES pagesful are consumed by trace records all - * emitted in non-blocking contexts. Which is quite unlikely. - */ - struct list_head tcd_stock_pages; - /* number of pages on ->tcd_stock_pages */ - unsigned long tcd_cur_stock_pages; - - unsigned short tcd_shutting_down; - unsigned short tcd_cpu; - unsigned short tcd_type; - /* The factors to share debug memory. */ - unsigned short tcd_pages_factor; - - /* - * This spinlock is needed to workaround the problem of - * set_cpus_allowed() being GPL-only. Since we cannot - * schedule a thread on a specific CPU when dumping the - * pages, we must use the spinlock for mutual exclusion. - */ - spinlock_t tcd_lock; - unsigned long tcd_lock_flags; - } tcd; - char __pad[L1_CACHE_ALIGN(sizeof(struct trace_cpu_data))]; -}; - -extern union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS]; - -#define tcd_for_each(tcd, i, j) \ - for (i = 0; i < TCD_TYPE_MAX && trace_data[i]; i++) \ - for (j = 0, ((tcd) = &(*trace_data[i])[j].tcd); \ - j < num_possible_cpus(); j++, (tcd) = &(*trace_data[i])[j].tcd) - -#define tcd_for_each_type_lock(tcd, i, cpu) \ - for (i = 0; i < TCD_TYPE_MAX && trace_data[i] && \ - (tcd = &(*trace_data[i])[cpu].tcd) && \ - trace_lock_tcd(tcd); trace_unlock_tcd(tcd), i++) - -struct trace_page { - struct page *page; /* page itself */ - struct list_head linkage; /* Used by trace_data_union */ - unsigned int used; /* number of bytes used within this page */ - unsigned short cpu; /* cpu that owns this page */ - unsigned short type; /* type(context) of this page */ -}; - -struct page_collection { - struct list_head pc_pages; - spinlock_t pc_lock; - int pc_want_daemon_pages; -}; - -#endif /* SPL_TRACE_H */ diff --git a/include/sys/debug.h b/include/sys/debug.h index 3a4b1352f..cae2d49e4 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -30,7 +30,6 @@ * * PANIC() - Panic the node and print message. * ASSERT() - Assert X is true, if not panic. - * ASSERTF() - Assert X is true, if not panic and print message. * ASSERTV() - Wraps a variable declaration which is only used by ASSERT(). * ASSERT3S() - Assert signed X OP Y is true, if not panic. * ASSERT3U() - Assert unsigned X OP Y is true, if not panic. @@ -44,110 +43,69 @@ */ #ifndef _SPL_DEBUG_H -#define _SPL_DEBUG_H +#define _SPL_DEBUG_H -#include - -#ifdef NDEBUG /* Debugging Disabled */ - -/* Define SPL_DEBUG_STR to make clear which ASSERT definitions are used */ -#define SPL_DEBUG_STR "" - -#define PANIC(fmt, a...) \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, fmt, ## a) - -#define __ASSERT(x) ((void)0) -#define ASSERT(x) ((void)0) -#define ASSERTF(x, y, z...) ((void)0) -#define ASSERTV(x) -#define VERIFY(cond) \ - (void)(unlikely(!(cond)) && \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ - "%s", "VERIFY(" #cond ") failed\n")) - -#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ - (void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ - "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ - "failed (" FMT " " #OP " " FMT ")\n", \ - CAST (LEFT), CAST (RIGHT))) - -#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) -#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ - (unsigned long long)) -#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) -#define VERIFY0(x) VERIFY3_IMPL(0, ==, x, int64_t, "%lld", (long long)) - -#define ASSERT3S(x,y,z) ((void)0) -#define ASSERT3U(x,y,z) ((void)0) -#define ASSERT3P(x,y,z) ((void)0) -#define ASSERT0(x) ((void)0) - -#else /* Debugging Enabled */ - -/* Define SPL_DEBUG_STR to make clear which ASSERT definitions are used */ -#define SPL_DEBUG_STR " (DEBUG mode)" - -#define PANIC(fmt, a...) \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, fmt, ## a) - -/* ASSERTION that is safe to use within the debug system */ -#define __ASSERT(cond) \ -do { \ - if (unlikely(!(cond))) { \ - printk(KERN_EMERG "ASSERTION(" #cond ") failed\n"); \ - BUG(); \ - } \ -} while (0) +/* + * Common DEBUG functionality. + */ +int spl_panic(const char *file, const char *func, int line, + const char *fmt, ...); +void spl_dumpstack(void); -/* ASSERTION that will debug log used outside the debug sysytem */ -#define ASSERT(cond) \ - (void)(unlikely(!(cond)) && \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ - "%s", "ASSERTION(" #cond ") failed\n")) +#define PANIC(fmt, a...) \ + spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a) -#define ASSERTF(cond, fmt, a...) \ +#define VERIFY(cond) \ (void)(unlikely(!(cond)) && \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ - "ASSERTION(" #cond ") failed: " fmt, ## a)) + spl_panic(__FILE__, __FUNCTION__, __LINE__, \ + "%s", "VERIFY(" #cond ") failed\n")) -#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ +#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ (void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \ - spl_PANIC(__FILE__, __FUNCTION__, __LINE__, \ - "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ - "failed (" FMT " " #OP " " FMT ")\n", \ - CAST (LEFT), CAST (RIGHT))) + spl_panic(__FILE__, __FUNCTION__, __LINE__, \ + "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ + "failed (" FMT " " #OP " " FMT ")\n", \ + CAST (LEFT), CAST (RIGHT))) -#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) -#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ +#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long)) +#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ (unsigned long long)) -#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) -#define VERIFY0(x) VERIFY3_IMPL(0, ==, x, int64_t, "%lld", (long long)) - -#define ASSERT3S(x,y,z) VERIFY3S(x, y, z) -#define ASSERT3U(x,y,z) VERIFY3U(x, y, z) -#define ASSERT3P(x,y,z) VERIFY3P(x, y, z) -#define ASSERT0(x) VERIFY0(x) +#define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) +#define VERIFY0(x) VERIFY3_IMPL(0, ==, x, int64_t, "%lld", (long long)) -#define ASSERTV(x) x -#define VERIFY(x) ASSERT(x) - -#endif /* NDEBUG */ +#define CTASSERT_GLOBAL(x) _CTASSERT(x, __LINE__) +#define CTASSERT(x) { _CTASSERT(x, __LINE__); } +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) \ + typedef char __attribute__ ((unused)) \ + __compile_time_assertion__ ## y[(x) ? 1 : -1] /* - * Helpers for the Solaris debug macros above + * Debugging disabled (--disable-debug) */ -extern int spl_PANIC(char *filename, const char *functionname, - int lineno, const char *fmt, ...); +#ifdef NDEBUG + +#define SPL_DEBUG_STR "" +#define ASSERT(x) ((void)0) +#define ASSERTV(x) +#define ASSERT3S(x,y,z) ((void)0) +#define ASSERT3U(x,y,z) ((void)0) +#define ASSERT3P(x,y,z) ((void)0) +#define ASSERT0(x) ((void)0) /* - * Compile-time assertion. The condition 'x' must be constant. + * Debugging enabled (--enable-debug) */ -#define CTASSERT_GLOBAL(x) _CTASSERT(x, __LINE__) -#define CTASSERT(x) { _CTASSERT(x, __LINE__); } -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) \ - typedef char __attribute__ ((unused)) \ - __compile_time_assertion__ ## y[(x) ? 1 : -1] +#else + +#define SPL_DEBUG_STR " (DEBUG mode)" +#define ASSERT(cond) VERIFY(cond) +#define ASSERTV(x) x +#define ASSERT3S(x,y,z) VERIFY3S(x, y, z) +#define ASSERT3U(x,y,z) VERIFY3U(x, y, z) +#define ASSERT3P(x,y,z) VERIFY3P(x, y, z) +#define ASSERT0(x) VERIFY0(x) + +#endif /* NDEBUG */ #endif /* SPL_DEBUG_H */ diff --git a/include/sys/kmem.h b/include/sys/kmem.h index 5875dfff6..936e49d6d 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -74,27 +74,27 @@ * ship a kernel with CONFIG_RT_MUTEX_TESTER disabled. */ #if !defined(CONFIG_RT_MUTEX_TESTER) && defined(PF_MUTEX_TESTER) -# define PF_NOFS PF_MUTEX_TESTER +#define PF_NOFS PF_MUTEX_TESTER static inline void sanitize_flags(struct task_struct *p, gfp_t *flags) { if (unlikely((p->flags & PF_NOFS) && (*flags & (__GFP_IO|__GFP_FS)))) { -# ifdef NDEBUG - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "Fixing allocation for " - "task %s (%d) which used GFP flags 0x%x with PF_NOFS set\n", - p->comm, p->pid, flags); - spl_debug_dumpstack(p); +#ifdef NDEBUG + printk(KERN_WARNING "Fixing allocation for task %s (%d) " + "which used GFP flags 0x%x with PF_NOFS set\n", + p->comm, p->pid, *flags); + spl_dumpstack(); *flags &= ~(__GFP_IO|__GFP_FS); -# else +#else PANIC("FATAL allocation for task %s (%d) which used GFP " - "flags 0x%x with PF_NOFS set\n", p->comm, p->pid, flags); -# endif /* NDEBUG */ + "flags 0x%x with PF_NOFS set\n", p->comm, p->pid, *flags); +#endif /* NDEBUG */ } } #else -# define PF_NOFS 0x00000000 -# define sanitize_flags(p, fl) ((void)0) +#define PF_NOFS 0x00000000 +#define sanitize_flags(p, fl) ((void)0) #endif /* !defined(CONFIG_RT_MUTEX_TESTER) && defined(PF_MUTEX_TESTER) */ /* diff --git a/module/spl/Makefile.in b/module/spl/Makefile.in index 30620349f..9f67ed646 100644 --- a/module/spl/Makefile.in +++ b/module/spl/Makefile.in @@ -6,7 +6,6 @@ EXTRA_CFLAGS = $(SPL_MODULE_CFLAGS) @KERNELCPPFLAGS@ # Solaris porting layer module obj-$(CONFIG_SPL) := $(MODULE).o -$(MODULE)-objs += @top_srcdir@/module/spl/spl-debug.o $(MODULE)-objs += @top_srcdir@/module/spl/spl-proc.o $(MODULE)-objs += @top_srcdir@/module/spl/spl-kmem.o $(MODULE)-objs += @top_srcdir@/module/spl/spl-thread.o diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c index 8236412dd..2a0052f56 100644 --- a/module/spl/spl-condvar.c +++ b/module/spl/spl-condvar.c @@ -25,18 +25,10 @@ \*****************************************************************************/ #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_CONDVAR void __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg) { - SENTRY; ASSERT(cvp); ASSERT(name == NULL); ASSERT(type == CV_DEFAULT); @@ -48,8 +40,6 @@ __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg) atomic_set(&cvp->cv_waiters, 0); atomic_set(&cvp->cv_refs, 1); cvp->cv_mutex = NULL; - - SEXIT; } EXPORT_SYMBOL(__cv_init); @@ -68,7 +58,6 @@ cv_destroy_wakeup(kcondvar_t *cvp) void __cv_destroy(kcondvar_t *cvp) { - SENTRY; ASSERT(cvp); ASSERT(cvp->cv_magic == CV_MAGIC); @@ -83,8 +72,6 @@ __cv_destroy(kcondvar_t *cvp) ASSERT3S(atomic_read(&cvp->cv_refs), ==, 0); ASSERT3S(atomic_read(&cvp->cv_waiters), ==, 0); ASSERT3S(waitqueue_active(&cvp->cv_event), ==, 0); - - SEXIT; } EXPORT_SYMBOL(__cv_destroy); @@ -92,7 +79,6 @@ static void cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state, int io) { DEFINE_WAIT(wait); - SENTRY; ASSERT(cvp); ASSERT(mp); @@ -127,8 +113,6 @@ cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state, int io) finish_wait(&cvp->cv_event, &wait); atomic_dec(&cvp->cv_refs); - - SEXIT; } void @@ -161,7 +145,6 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, { DEFINE_WAIT(wait); clock_t time_left; - SENTRY; ASSERT(cvp); ASSERT(mp); @@ -179,7 +162,7 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, time_left = expire_time - jiffies; if (time_left <= 0) { atomic_dec(&cvp->cv_refs); - SRETURN(-1); + return (-1); } prepare_to_wait_exclusive(&cvp->cv_event, &wait, state); @@ -201,7 +184,7 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, finish_wait(&cvp->cv_event, &wait); atomic_dec(&cvp->cv_refs); - SRETURN(time_left > 0 ? time_left : -1); + return (time_left > 0 ? time_left : -1); } clock_t @@ -229,7 +212,6 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, DEFINE_WAIT(wait); hrtime_t time_left, now; unsigned long time_left_us; - SENTRY; ASSERT(cvp); ASSERT(mp); @@ -247,7 +229,7 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, time_left = expire_time - now; if (time_left <= 0) { atomic_dec(&cvp->cv_refs); - SRETURN(-1); + return (-1); } time_left_us = time_left / NSEC_PER_USEC; @@ -273,7 +255,7 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, atomic_dec(&cvp->cv_refs); time_left = expire_time - gethrtime(); - SRETURN(time_left > 0 ? time_left : -1); + return (time_left > 0 ? time_left : -1); } /* @@ -302,7 +284,6 @@ EXPORT_SYMBOL(cv_timedwait_hires); void __cv_signal(kcondvar_t *cvp) { - SENTRY; ASSERT(cvp); ASSERT(cvp->cv_magic == CV_MAGIC); atomic_inc(&cvp->cv_refs); @@ -315,14 +296,12 @@ __cv_signal(kcondvar_t *cvp) wake_up(&cvp->cv_event); atomic_dec(&cvp->cv_refs); - SEXIT; } EXPORT_SYMBOL(__cv_signal); void __cv_broadcast(kcondvar_t *cvp) { - SENTRY; ASSERT(cvp); ASSERT(cvp->cv_magic == CV_MAGIC); atomic_inc(&cvp->cv_refs); @@ -333,6 +312,5 @@ __cv_broadcast(kcondvar_t *cvp) wake_up_all(&cvp->cv_event); atomic_dec(&cvp->cv_refs); - SEXIT; } EXPORT_SYMBOL(__cv_broadcast); diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c deleted file mode 100644 index 6c4e043f0..000000000 --- a/module/spl/spl-debug.c +++ /dev/null @@ -1,1265 +0,0 @@ -/*****************************************************************************\ - * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. - * Copyright (C) 2007 The Regents of the University of California. - * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Brian Behlendorf . - * UCRL-CODE-235197 - * - * This file is part of the SPL, Solaris Porting Layer. - * For details, see . - * - * The SPL is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * The SPL is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with the SPL. If not, see . - ***************************************************************************** - * Solaris Porting Layer (SPL) Debug Implementation. -\*****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_DEBUG - -/* Debug log support enabled */ -#ifdef DEBUG_LOG - -unsigned long spl_debug_subsys = ~0; -EXPORT_SYMBOL(spl_debug_subsys); -module_param(spl_debug_subsys, ulong, 0644); -MODULE_PARM_DESC(spl_debug_subsys, "Subsystem debugging level mask."); - -unsigned long spl_debug_mask = SD_CANTMASK; -EXPORT_SYMBOL(spl_debug_mask); -module_param(spl_debug_mask, ulong, 0644); -MODULE_PARM_DESC(spl_debug_mask, "Debugging level mask."); - -unsigned long spl_debug_printk = SD_CANTMASK; -EXPORT_SYMBOL(spl_debug_printk); -module_param(spl_debug_printk, ulong, 0644); -MODULE_PARM_DESC(spl_debug_printk, "Console printk level mask."); - -int spl_debug_mb = -1; -EXPORT_SYMBOL(spl_debug_mb); -module_param(spl_debug_mb, int, 0644); -MODULE_PARM_DESC(spl_debug_mb, "Total debug buffer size."); - -unsigned int spl_debug_binary = 1; -EXPORT_SYMBOL(spl_debug_binary); - -unsigned int spl_debug_catastrophe; -EXPORT_SYMBOL(spl_debug_catastrophe); - -unsigned int spl_debug_panic_on_bug = 0; -EXPORT_SYMBOL(spl_debug_panic_on_bug); -module_param(spl_debug_panic_on_bug, uint, 0644); -MODULE_PARM_DESC(spl_debug_panic_on_bug, "Panic on BUG"); - -static char spl_debug_file_name[PATH_MAX]; -char spl_debug_file_path[PATH_MAX] = "/tmp/spl-log"; - -unsigned int spl_console_ratelimit = 1; -EXPORT_SYMBOL(spl_console_ratelimit); - -long spl_console_max_delay; -EXPORT_SYMBOL(spl_console_max_delay); - -long spl_console_min_delay; -EXPORT_SYMBOL(spl_console_min_delay); - -unsigned int spl_console_backoff = SPL_DEFAULT_BACKOFF; -EXPORT_SYMBOL(spl_console_backoff); - -unsigned int spl_debug_stack; -EXPORT_SYMBOL(spl_debug_stack); - -static int spl_panic_in_progress; - -union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS] __cacheline_aligned; -char *trace_console_buffers[NR_CPUS][3]; -struct rw_semaphore trace_sem; -atomic_t trace_tage_allocated = ATOMIC_INIT(0); - -static int spl_debug_dump_all_pages(dumplog_priv_t *dp, char *); -static void trace_fini(void); - - -/* Memory percentage breakdown by type */ -static unsigned int pages_factor[TCD_TYPE_MAX] = { - 80, /* 80% pages for TCD_TYPE_PROC */ - 10, /* 10% pages for TCD_TYPE_SOFTIRQ */ - 10 /* 10% pages for TCD_TYPE_IRQ */ -}; - -const char * -spl_debug_subsys2str(int subsys) -{ - switch (subsys) { - default: - return NULL; - case SS_UNDEFINED: - return "undefined"; - case SS_ATOMIC: - return "atomic"; - case SS_KOBJ: - return "kobj"; - case SS_VNODE: - return "vnode"; - case SS_TIME: - return "time"; - case SS_RWLOCK: - return "rwlock"; - case SS_THREAD: - return "thread"; - case SS_CONDVAR: - return "condvar"; - case SS_MUTEX: - return "mutex"; - case SS_RNG: - return "rng"; - case SS_TASKQ: - return "taskq"; - case SS_KMEM: - return "kmem"; - case SS_DEBUG: - return "debug"; - case SS_GENERIC: - return "generic"; - case SS_PROC: - return "proc"; - case SS_MODULE: - return "module"; - case SS_CRED: - return "cred"; - case SS_KSTAT: - return "kstat"; - case SS_XDR: - return "xdr"; - case SS_TSD: - return "tsd"; - case SS_ZLIB: - return "zlib"; - case SS_USER1: - return "user1"; - case SS_USER2: - return "user2"; - case SS_USER3: - return "user3"; - case SS_USER4: - return "user4"; - case SS_USER5: - return "user5"; - case SS_USER6: - return "user6"; - case SS_USER7: - return "user7"; - case SS_USER8: - return "user8"; - } -} - -const char * -spl_debug_dbg2str(int debug) -{ - switch (debug) { - default: - return NULL; - case SD_TRACE: - return "trace"; - case SD_INFO: - return "info"; - case SD_WARNING: - return "warning"; - case SD_ERROR: - return "error"; - case SD_EMERG: - return "emerg"; - case SD_CONSOLE: - return "console"; - case SD_IOCTL: - return "ioctl"; - case SD_DPRINTF: - return "dprintf"; - case SD_OTHER: - return "other"; - } -} - -int -spl_debug_mask2str(char *str, int size, unsigned long mask, int is_subsys) -{ - const char *(*fn)(int bit) = is_subsys ? spl_debug_subsys2str : - spl_debug_dbg2str; - const char *token; - int i, bit, len = 0; - - if (mask == 0) { /* "0" */ - if (size > 0) - str[0] = '0'; - len = 1; - } else { /* space-separated tokens */ - for (i = 0; i < 32; i++) { - bit = 1 << i; - - if ((mask & bit) == 0) - continue; - - token = fn(bit); - if (token == NULL) /* unused bit */ - continue; - - if (len > 0) { /* separator? */ - if (len < size) - str[len] = ' '; - len++; - } - - while (*token != 0) { - if (len < size) - str[len] = *token; - token++; - len++; - } - } - } - - /* terminate 'str' */ - if (len < size) - str[len] = 0; - else - str[size - 1] = 0; - - return len; -} - -static int -spl_debug_token2mask(int *mask, const char *str, int len, int is_subsys) -{ - const char *(*fn)(int bit) = is_subsys ? spl_debug_subsys2str : - spl_debug_dbg2str; - const char *token; - int i, j, bit; - - /* match against known tokens */ - for (i = 0; i < 32; i++) { - bit = 1 << i; - - token = fn(bit); - if (token == NULL) /* unused? */ - continue; - - /* strcasecmp */ - for (j = 0; ; j++) { - if (j == len) { /* end of token */ - if (token[j] == 0) { - *mask = bit; - return 0; - } - break; - } - - if (token[j] == 0) - break; - - if (str[j] == token[j]) - continue; - - if (str[j] < 'A' || 'Z' < str[j]) - break; - - if (str[j] - 'A' + 'a' != token[j]) - break; - } - } - - return -EINVAL; /* no match */ -} - -int -spl_debug_str2mask(unsigned long *mask, const char *str, int is_subsys) -{ - char op = 0; - int m = 0, matched, n, t; - - /* Allow a number for backwards compatibility */ - for (n = strlen(str); n > 0; n--) - if (!isspace(str[n-1])) - break; - matched = n; - - if ((t = sscanf(str, "%i%n", &m, &matched)) >= 1 && matched == n) { - *mask = m; - return 0; - } - - /* must be a list of debug tokens or numbers separated by - * whitespace and optionally an operator ('+' or '-'). If an operator - * appears first in , '*mask' is used as the starting point - * (relative), otherwise 0 is used (absolute). An operator applies to - * all following tokens up to the next operator. */ - matched = 0; - while (*str != 0) { - while (isspace(*str)) /* skip whitespace */ - str++; - - if (*str == 0) - break; - - if (*str == '+' || *str == '-') { - op = *str++; - - /* op on first token == relative */ - if (!matched) - m = *mask; - - while (isspace(*str)) /* skip whitespace */ - str++; - - if (*str == 0) /* trailing op */ - return -EINVAL; - } - - /* find token length */ - for (n = 0; str[n] != 0 && !isspace(str[n]); n++); - - /* match token */ - if (spl_debug_token2mask(&t, str, n, is_subsys) != 0) - return -EINVAL; - - matched = 1; - if (op == '-') - m &= ~t; - else - m |= t; - - str += n; - } - - if (!matched) - return -EINVAL; - - *mask = m; - return 0; -} - -static void -spl_debug_dumplog_internal(dumplog_priv_t *dp) -{ - void *journal_info; - - journal_info = current->journal_info; - current->journal_info = NULL; - - snprintf(spl_debug_file_name, sizeof(spl_debug_file_path) - 1, - "%s.%ld.%ld", spl_debug_file_path, - get_seconds(), (long)dp->dp_pid); - printk("SPL: Dumping log to %s\n", spl_debug_file_name); - spl_debug_dump_all_pages(dp, spl_debug_file_name); - - current->journal_info = journal_info; -} - -static int -spl_debug_dumplog_thread(void *arg) -{ - dumplog_priv_t *dp = (dumplog_priv_t *)arg; - - spl_debug_dumplog_internal(dp); - atomic_set(&dp->dp_done, 1); - wake_up(&dp->dp_waitq); - complete_and_exit(NULL, 0); - - return 0; /* Unreachable */ -} - -/* When flag is set do not use a new thread for the debug dump */ -int -spl_debug_dumplog(int flags) -{ - struct task_struct *tsk; - dumplog_priv_t dp; - - init_waitqueue_head(&dp.dp_waitq); - dp.dp_pid = current->pid; - dp.dp_flags = flags; - atomic_set(&dp.dp_done, 0); - - if (dp.dp_flags & DL_NOTHREAD) { - spl_debug_dumplog_internal(&dp); - } else { - - tsk = spl_kthread_create(spl_debug_dumplog_thread,(void *)&dp,"spl_debug"); - if (tsk == NULL) - return -ENOMEM; - - wake_up_process(tsk); - wait_event(dp.dp_waitq, atomic_read(&dp.dp_done)); - } - - return 0; -} -EXPORT_SYMBOL(spl_debug_dumplog); - -static char * -trace_get_console_buffer(void) -{ - int cpu = get_cpu(); - int idx; - - if (in_irq()) { - idx = 0; - } else if (in_softirq()) { - idx = 1; - } else { - idx = 2; - } - - return trace_console_buffers[cpu][idx]; -} - -static void -trace_put_console_buffer(char *buffer) -{ - put_cpu(); -} - -static int -trace_lock_tcd(struct trace_cpu_data *tcd) -{ - __ASSERT(tcd->tcd_type < TCD_TYPE_MAX); - - spin_lock_irqsave(&tcd->tcd_lock, tcd->tcd_lock_flags); - - return 1; -} - -static void -trace_unlock_tcd(struct trace_cpu_data *tcd) -{ - __ASSERT(tcd->tcd_type < TCD_TYPE_MAX); - - spin_unlock_irqrestore(&tcd->tcd_lock, tcd->tcd_lock_flags); -} - -static struct trace_cpu_data * -trace_get_tcd(void) -{ - int cpu; - struct trace_cpu_data *tcd; - - cpu = get_cpu(); - if (in_irq()) - tcd = &(*trace_data[TCD_TYPE_IRQ])[cpu].tcd; - else if (in_softirq()) - tcd = &(*trace_data[TCD_TYPE_SOFTIRQ])[cpu].tcd; - else - tcd = &(*trace_data[TCD_TYPE_PROC])[cpu].tcd; - - trace_lock_tcd(tcd); - - return tcd; -} - -static void -trace_put_tcd (struct trace_cpu_data *tcd) -{ - trace_unlock_tcd(tcd); - - put_cpu(); -} - -static void -trace_set_debug_header(struct spl_debug_header *header, int subsys, - int mask, const int line, unsigned long stack) -{ - struct timeval tv; - - do_gettimeofday(&tv); - - header->ph_subsys = subsys; - header->ph_mask = mask; - header->ph_cpu_id = smp_processor_id(); - header->ph_sec = (__u32)tv.tv_sec; - header->ph_usec = tv.tv_usec; - header->ph_stack = stack; - header->ph_pid = current->pid; - header->ph_line_num = line; - - return; -} - -static void -trace_print_to_console(struct spl_debug_header *hdr, int mask, const char *buf, - int len, const char *file, const char *fn) -{ - char *prefix = "SPL", *ptype = NULL; - - if ((mask & SD_EMERG) != 0) { - prefix = "SPLError"; - ptype = KERN_EMERG; - } else if ((mask & SD_ERROR) != 0) { - prefix = "SPLError"; - ptype = KERN_ERR; - } else if ((mask & SD_WARNING) != 0) { - prefix = "SPL"; - ptype = KERN_WARNING; - } else if ((mask & (SD_CONSOLE | spl_debug_printk)) != 0) { - prefix = "SPL"; - ptype = KERN_INFO; - } - - if ((mask & SD_CONSOLE) != 0) { - printk("%s%s: %.*s", ptype, prefix, len, buf); - } else { - printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix, - hdr->ph_pid, hdr->ph_stack, file, - hdr->ph_line_num, fn, len, buf); - } - - return; -} - -static int -trace_max_debug_mb(void) -{ - return MAX(512, ((totalram_pages >> (20 - PAGE_SHIFT)) * 80) / 100); -} - -static struct trace_page * -tage_alloc(int gfp) -{ - struct page *page; - struct trace_page *tage; - - page = alloc_pages(gfp | __GFP_NOWARN, 0); - if (page == NULL) - return NULL; - - tage = kmalloc(sizeof(*tage), gfp); - if (tage == NULL) { - __free_pages(page, 0); - return NULL; - } - - tage->page = page; - atomic_inc(&trace_tage_allocated); - - return tage; -} - -static void -tage_free(struct trace_page *tage) -{ - __ASSERT(tage != NULL); - __ASSERT(tage->page != NULL); - - __free_pages(tage->page, 0); - kfree(tage); - atomic_dec(&trace_tage_allocated); -} - -static struct trace_page * -tage_from_list(struct list_head *list) -{ - return list_entry(list, struct trace_page, linkage); -} - -static void -tage_to_tail(struct trace_page *tage, struct list_head *queue) -{ - __ASSERT(tage != NULL); - __ASSERT(queue != NULL); - - list_move_tail(&tage->linkage, queue); -} - -/* try to return a page that has 'len' bytes left at the end */ -static struct trace_page * -trace_get_tage_try(struct trace_cpu_data *tcd, unsigned long len) -{ - struct trace_page *tage; - - if (tcd->tcd_cur_pages > 0) { - __ASSERT(!list_empty(&tcd->tcd_pages)); - tage = tage_from_list(tcd->tcd_pages.prev); - if (tage->used + len <= PAGE_SIZE) - return tage; - } - - if (tcd->tcd_cur_pages < tcd->tcd_max_pages) { - if (tcd->tcd_cur_stock_pages > 0) { - tage = tage_from_list(tcd->tcd_stock_pages.prev); - tcd->tcd_cur_stock_pages--; - list_del_init(&tage->linkage); - } else { - tage = tage_alloc(GFP_ATOMIC); - if (tage == NULL) { - printk(KERN_WARNING - "failure to allocate a tage (%ld)\n", - tcd->tcd_cur_pages); - return NULL; - } - } - - tage->used = 0; - tage->cpu = smp_processor_id(); - tage->type = tcd->tcd_type; - list_add_tail(&tage->linkage, &tcd->tcd_pages); - tcd->tcd_cur_pages++; - - return tage; - } - - return NULL; -} - -/* return a page that has 'len' bytes left at the end */ -static struct trace_page * -trace_get_tage(struct trace_cpu_data *tcd, unsigned long len) -{ - struct trace_page *tage; - - __ASSERT(len <= PAGE_SIZE); - - tage = trace_get_tage_try(tcd, len); - if (tage) - return tage; - - if (tcd->tcd_cur_pages > 0) { - tage = tage_from_list(tcd->tcd_pages.next); - tage->used = 0; - tage_to_tail(tage, &tcd->tcd_pages); - } - - return tage; -} - -int -spl_debug_msg(void *arg, int subsys, int mask, const char *file, - const char *fn, const int line, const char *format, ...) -{ - spl_debug_limit_state_t *cdls = arg; - struct trace_cpu_data *tcd = NULL; - struct spl_debug_header header = { 0, }; - struct trace_page *tage; - /* string_buf is used only if tcd != NULL, and is always set then */ - char *string_buf = NULL; - char *debug_buf; - int known_size; - int needed = 85; /* average message length */ - int max_nob; - va_list ap; - int i; - - if (subsys == 0) - subsys = SS_DEBUG_SUBSYS; - - if (mask == 0) - mask = SD_EMERG; - - if (strchr(file, '/')) - file = strrchr(file, '/') + 1; - - tcd = trace_get_tcd(); - trace_set_debug_header(&header, subsys, mask, line, 0); - if (tcd == NULL) - goto console; - - if (tcd->tcd_shutting_down) { - trace_put_tcd(tcd); - tcd = NULL; - goto console; - } - - known_size = strlen(file) + 1; - if (fn) - known_size += strlen(fn) + 1; - - if (spl_debug_binary) - known_size += sizeof(header); - - /* '2' used because vsnprintf returns real size required for output - * _without_ terminating NULL. */ - for (i = 0; i < 2; i++) { - tage = trace_get_tage(tcd, needed + known_size + 1); - if (tage == NULL) { - if (needed + known_size > PAGE_SIZE) - mask |= SD_ERROR; - - trace_put_tcd(tcd); - tcd = NULL; - goto console; - } - - string_buf = (char *)page_address(tage->page) + - tage->used + known_size; - - max_nob = PAGE_SIZE - tage->used - known_size; - if (max_nob <= 0) { - printk(KERN_EMERG "negative max_nob: %i\n", max_nob); - mask |= SD_ERROR; - trace_put_tcd(tcd); - tcd = NULL; - goto console; - } - - needed = 0; - if (format) { - va_start(ap, format); - needed += vsnprintf(string_buf, max_nob, format, ap); - va_end(ap); - } - - if (needed < max_nob) - break; - } - - header.ph_len = known_size + needed; - debug_buf = (char *)page_address(tage->page) + tage->used; - - if (spl_debug_binary) { - memcpy(debug_buf, &header, sizeof(header)); - tage->used += sizeof(header); - debug_buf += sizeof(header); - } - - strcpy(debug_buf, file); - tage->used += strlen(file) + 1; - debug_buf += strlen(file) + 1; - - if (fn) { - strcpy(debug_buf, fn); - tage->used += strlen(fn) + 1; - debug_buf += strlen(fn) + 1; - } - - __ASSERT(debug_buf == string_buf); - - tage->used += needed; - __ASSERT (tage->used <= PAGE_SIZE); - -console: - if ((mask & spl_debug_printk) == 0) { - /* no console output requested */ - if (tcd != NULL) - trace_put_tcd(tcd); - return 1; - } - - if (cdls != NULL) { - if (spl_console_ratelimit && cdls->cdls_next != 0 && - !time_before(cdls->cdls_next, jiffies)) { - /* skipping a console message */ - cdls->cdls_count++; - if (tcd != NULL) - trace_put_tcd(tcd); - return 1; - } - - if (time_before(cdls->cdls_next + spl_console_max_delay + - (10 * HZ), jiffies)) { - /* last timeout was a long time ago */ - cdls->cdls_delay /= spl_console_backoff * 4; - } else { - cdls->cdls_delay *= spl_console_backoff; - - if (cdls->cdls_delay < spl_console_min_delay) - cdls->cdls_delay = spl_console_min_delay; - else if (cdls->cdls_delay > spl_console_max_delay) - cdls->cdls_delay = spl_console_max_delay; - } - - /* ensure cdls_next is never zero after it's been seen */ - cdls->cdls_next = (jiffies + cdls->cdls_delay) | 1; - } - - if (tcd != NULL) { - trace_print_to_console(&header, mask, string_buf, needed, file, fn); - trace_put_tcd(tcd); - } else { - string_buf = trace_get_console_buffer(); - - needed = 0; - if (format != NULL) { - va_start(ap, format); - needed += vsnprintf(string_buf, - TRACE_CONSOLE_BUFFER_SIZE, format, ap); - va_end(ap); - } - trace_print_to_console(&header, mask, - string_buf, needed, file, fn); - - trace_put_console_buffer(string_buf); - } - - if (cdls != NULL && cdls->cdls_count != 0) { - string_buf = trace_get_console_buffer(); - - needed = snprintf(string_buf, TRACE_CONSOLE_BUFFER_SIZE, - "Skipped %d previous similar message%s\n", - cdls->cdls_count, (cdls->cdls_count > 1) ? "s" : ""); - - trace_print_to_console(&header, mask, - string_buf, needed, file, fn); - - trace_put_console_buffer(string_buf); - cdls->cdls_count = 0; - } - - return 0; -} -EXPORT_SYMBOL(spl_debug_msg); - -/* Do the collect_pages job on a single CPU: assumes that all other - * CPUs have been stopped during a panic. If this isn't true for - * some arch, this will have to be implemented separately in each arch. - */ -static void -collect_pages_from_single_cpu(struct page_collection *pc) -{ - struct trace_cpu_data *tcd; - int i, j; - - tcd_for_each(tcd, i, j) { - list_splice_init(&tcd->tcd_pages, &pc->pc_pages); - tcd->tcd_cur_pages = 0; - } -} - -static void -collect_pages_on_all_cpus(struct page_collection *pc) -{ - struct trace_cpu_data *tcd; - int i, cpu; - - spin_lock(&pc->pc_lock); - for_each_possible_cpu(cpu) { - tcd_for_each_type_lock(tcd, i, cpu) { - list_splice_init(&tcd->tcd_pages, &pc->pc_pages); - tcd->tcd_cur_pages = 0; - } - } - spin_unlock(&pc->pc_lock); -} - -static void -collect_pages(dumplog_priv_t *dp, struct page_collection *pc) -{ - INIT_LIST_HEAD(&pc->pc_pages); - - if (spl_panic_in_progress || dp->dp_flags & DL_SINGLE_CPU) - collect_pages_from_single_cpu(pc); - else - collect_pages_on_all_cpus(pc); -} - -static void -put_pages_back_on_all_cpus(struct page_collection *pc) -{ - struct trace_cpu_data *tcd; - struct list_head *cur_head; - struct trace_page *tage; - struct trace_page *tmp; - int i, cpu; - - spin_lock(&pc->pc_lock); - - for_each_possible_cpu(cpu) { - tcd_for_each_type_lock(tcd, i, cpu) { - cur_head = tcd->tcd_pages.next; - - list_for_each_entry_safe(tage, tmp, &pc->pc_pages, - linkage) { - if (tage->cpu != cpu || tage->type != i) - continue; - - tage_to_tail(tage, cur_head); - tcd->tcd_cur_pages++; - } - } - } - - spin_unlock(&pc->pc_lock); -} - -static void -put_pages_back(struct page_collection *pc) -{ - if (!spl_panic_in_progress) - put_pages_back_on_all_cpus(pc); -} - -static int -spl_debug_dump_all_pages(dumplog_priv_t *dp, char *filename) -{ - struct page_collection pc; - struct file *filp; - struct trace_page *tage; - struct trace_page *tmp; - mm_segment_t oldfs; - int rc = 0; - - down_write(&trace_sem); - - filp = spl_filp_open(filename, O_CREAT|O_EXCL|O_WRONLY|O_LARGEFILE, - 0600, &rc); - if (filp == NULL) { - if (rc != -EEXIST) - printk(KERN_ERR "SPL: Can't open %s for dump: %d\n", - filename, rc); - goto out; - } - - spin_lock_init(&pc.pc_lock); - collect_pages(dp, &pc); - if (list_empty(&pc.pc_pages)) { - rc = 0; - goto close; - } - - oldfs = get_fs(); - set_fs(get_ds()); - - list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) { - rc = spl_filp_write(filp, page_address(tage->page), - tage->used, spl_filp_poff(filp)); - if (rc != (int)tage->used) { - printk(KERN_WARNING "SPL: Wanted to write %u " - "but wrote %d\n", tage->used, rc); - put_pages_back(&pc); - __ASSERT(list_empty(&pc.pc_pages)); - break; - } - list_del(&tage->linkage); - tage_free(tage); - } - - set_fs(oldfs); - - rc = spl_filp_fsync(filp, 1); - if (rc) - printk(KERN_ERR "SPL: Unable to sync: %d\n", rc); - close: - spl_filp_close(filp); - out: - up_write(&trace_sem); - - return rc; -} - -static void -spl_debug_flush_pages(void) -{ - dumplog_priv_t dp; - struct page_collection pc; - struct trace_page *tage; - struct trace_page *tmp; - - spin_lock_init(&pc.pc_lock); - init_waitqueue_head(&dp.dp_waitq); - dp.dp_pid = current->pid; - dp.dp_flags = 0; - atomic_set(&dp.dp_done, 0); - - collect_pages(&dp, &pc); - list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) { - list_del(&tage->linkage); - tage_free(tage); - } -} - -unsigned long -spl_debug_set_mask(unsigned long mask) { - spl_debug_mask = mask; - return 0; -} -EXPORT_SYMBOL(spl_debug_set_mask); - -unsigned long -spl_debug_get_mask(void) { - return spl_debug_mask; -} -EXPORT_SYMBOL(spl_debug_get_mask); - -unsigned long -spl_debug_set_subsys(unsigned long subsys) { - spl_debug_subsys = subsys; - return 0; -} -EXPORT_SYMBOL(spl_debug_set_subsys); - -unsigned long -spl_debug_get_subsys(void) { - return spl_debug_subsys; -} -EXPORT_SYMBOL(spl_debug_get_subsys); - -int -spl_debug_set_mb(int mb) -{ - int i, j, pages; - int limit = trace_max_debug_mb(); - struct trace_cpu_data *tcd; - - if (mb < num_possible_cpus()) { - printk(KERN_ERR "SPL: Refusing to set debug buffer size to " - "%dMB - lower limit is %d\n", mb, num_possible_cpus()); - return -EINVAL; - } - - if (mb > limit) { - printk(KERN_ERR "SPL: Refusing to set debug buffer size to " - "%dMB - upper limit is %d\n", mb, limit); - return -EINVAL; - } - - mb /= num_possible_cpus(); - pages = mb << (20 - PAGE_SHIFT); - - down_write(&trace_sem); - - tcd_for_each(tcd, i, j) - tcd->tcd_max_pages = (pages * tcd->tcd_pages_factor) / 100; - - up_write(&trace_sem); - - return 0; -} -EXPORT_SYMBOL(spl_debug_set_mb); - -int -spl_debug_get_mb(void) -{ - int i, j; - struct trace_cpu_data *tcd; - int total_pages = 0; - - down_read(&trace_sem); - - tcd_for_each(tcd, i, j) - total_pages += tcd->tcd_max_pages; - - up_read(&trace_sem); - - return (total_pages >> (20 - PAGE_SHIFT)) + 1; -} -EXPORT_SYMBOL(spl_debug_get_mb); - -/* - * Limit the number of stack traces dumped to not more than 5 every - * 60 seconds to prevent denial-of-service attacks from debug code. - */ -DEFINE_RATELIMIT_STATE(dumpstack_ratelimit_state, 60 * HZ, 5); - -void -spl_debug_dumpstack(struct task_struct *tsk) -{ - if (__ratelimit(&dumpstack_ratelimit_state)) { - if (tsk == NULL) - tsk = current; - - printk("SPL: Showing stack for process %d\n", tsk->pid); - dump_stack(); - } -} -EXPORT_SYMBOL(spl_debug_dumpstack); - -void spl_debug_bug(char *file, const char *func, const int line, int flags) -{ - spl_debug_catastrophe = 1; - spl_debug_msg(NULL, 0, SD_EMERG, file, func, line, "SPL PANIC\n"); - - if (in_interrupt()) - panic("SPL PANIC in interrupt.\n"); - - if (in_atomic() || irqs_disabled()) - flags |= DL_NOTHREAD; - - /* Ensure all debug pages and dumped by current cpu */ - if (spl_debug_panic_on_bug) - spl_panic_in_progress = 1; - - spl_debug_dumpstack(NULL); - - if (spl_debug_panic_on_bug) { - spl_debug_dumplog(flags); - panic("SPL PANIC"); - } - - set_task_state(current, TASK_UNINTERRUPTIBLE); - while (1) - schedule(); -} -EXPORT_SYMBOL(spl_debug_bug); - -int -spl_debug_clear_buffer(void) -{ - spl_debug_flush_pages(); - return 0; -} -EXPORT_SYMBOL(spl_debug_clear_buffer); - -int -spl_debug_mark_buffer(char *text) -{ - SDEBUG(SD_WARNING, "*************************************\n"); - SDEBUG(SD_WARNING, "DEBUG MARKER: %s\n", text); - SDEBUG(SD_WARNING, "*************************************\n"); - - return 0; -} -EXPORT_SYMBOL(spl_debug_mark_buffer); - -static int -trace_init(int max_pages) -{ - struct trace_cpu_data *tcd; - int i, j; - - init_rwsem(&trace_sem); - - /* initialize trace_data */ - memset(trace_data, 0, sizeof(trace_data)); - for (i = 0; i < TCD_TYPE_MAX; i++) { - trace_data[i] = kmalloc(sizeof(union trace_data_union) * - NR_CPUS, GFP_KERNEL); - if (trace_data[i] == NULL) - goto out; - } - - tcd_for_each(tcd, i, j) { - spin_lock_init(&tcd->tcd_lock); - tcd->tcd_pages_factor = pages_factor[i]; - tcd->tcd_type = i; - tcd->tcd_cpu = j; - INIT_LIST_HEAD(&tcd->tcd_pages); - INIT_LIST_HEAD(&tcd->tcd_stock_pages); - tcd->tcd_cur_pages = 0; - tcd->tcd_cur_stock_pages = 0; - tcd->tcd_max_pages = (max_pages * pages_factor[i]) / 100; - tcd->tcd_shutting_down = 0; - } - - for (i = 0; i < num_possible_cpus(); i++) { - for (j = 0; j < 3; j++) { - trace_console_buffers[i][j] = - kmalloc(TRACE_CONSOLE_BUFFER_SIZE, - GFP_KERNEL); - - if (trace_console_buffers[i][j] == NULL) - goto out; - } - } - - return 0; -out: - trace_fini(); - printk(KERN_ERR "SPL: Insufficient memory for debug logs\n"); - return -ENOMEM; -} - -int -spl_debug_init(void) -{ - int rc, max = spl_debug_mb; - - spl_console_max_delay = SPL_DEFAULT_MAX_DELAY; - spl_console_min_delay = SPL_DEFAULT_MIN_DELAY; - - /* If spl_debug_mb is set to an invalid value or uninitialized - * then just make the total buffers smp_num_cpus TCD_MAX_PAGES */ - if (max > (totalram_pages >> (20 - 2 - PAGE_SHIFT)) / 5 || - max >= 512 || max < 0) { - max = TCD_MAX_PAGES; - } else { - max = (max / num_online_cpus()) << (20 - PAGE_SHIFT); - } - - rc = trace_init(max); - if (rc) - return rc; - - return rc; -} - -static void -trace_cleanup_on_all_cpus(void) -{ - struct trace_cpu_data *tcd; - struct trace_page *tage; - struct trace_page *tmp; - int i, cpu; - - for_each_possible_cpu(cpu) { - tcd_for_each_type_lock(tcd, i, cpu) { - tcd->tcd_shutting_down = 1; - - list_for_each_entry_safe(tage, tmp, &tcd->tcd_pages, - linkage) { - list_del(&tage->linkage); - tage_free(tage); - } - tcd->tcd_cur_pages = 0; - } - } -} - -static void -trace_fini(void) -{ - int i, j; - - trace_cleanup_on_all_cpus(); - - for (i = 0; i < num_possible_cpus(); i++) { - for (j = 0; j < 3; j++) { - if (trace_console_buffers[i][j] != NULL) { - kfree(trace_console_buffers[i][j]); - trace_console_buffers[i][j] = NULL; - } - } - } - - for (i = 0; i < TCD_TYPE_MAX && trace_data[i] != NULL; i++) { - kfree(trace_data[i]); - trace_data[i] = NULL; - } -} - -void -spl_debug_fini(void) -{ - trace_fini(); -} - -#endif /* DEBUG_LOG */ diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 2706f9bd1..14ff8a337 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -26,66 +26,81 @@ #include #include -#include +#include -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif +/* + * Limit the number of stack traces dumped to not more than 5 every + * 60 seconds to prevent denial-of-service attacks from debug code. + */ +DEFINE_RATELIMIT_STATE(dumpstack_ratelimit_state, 60 * HZ, 5); -#define SS_DEBUG_SUBSYS SS_GENERIC - -#ifdef DEBUG_LOG -static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" }; -static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" }; -#endif +void +spl_dumpstack(void) +{ + if (__ratelimit(&dumpstack_ratelimit_state)) { + printk("Showing stack for process %d\n", current->pid); + dump_stack(); + } +} +EXPORT_SYMBOL(spl_dumpstack); int -spl_PANIC(char *filename, const char *functionname, - int lineno, const char *fmt, ...) { +spl_panic(const char *file, const char *func, int line, const char *fmt, ...) { + const char *newfile; char msg[MAXMSGLEN]; va_list ap; + newfile = strrchr(file, '/'); + if (newfile != NULL) + newfile = newfile + 1; + else + newfile = file; + va_start(ap, fmt); - if (vsnprintf(msg, sizeof (msg), fmt, ap) == sizeof (msg)) - msg[sizeof (msg) - 1] = '\0'; + (void) vsnprintf(msg, sizeof (msg), fmt, ap); va_end(ap); -#ifdef NDEBUG + printk(KERN_EMERG "%s", msg); -#else - spl_debug_msg(NULL, 0, 0, - filename, functionname, lineno, "%s", msg); -#endif - spl_debug_bug(filename, functionname, lineno, 0); - return 1; -} -EXPORT_SYMBOL(spl_PANIC); + printk(KERN_EMERG "PANIC at %s:%d:%s()\n", newfile, line, func); + spl_dumpstack(); -void -vpanic(const char *fmt, va_list ap) -{ - char msg[MAXMSGLEN]; + /* Halt the thread to facilitate further debugging */ + set_task_state(current, TASK_UNINTERRUPTIBLE); + while (1) + schedule(); - vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); - PANIC("%s", msg); -} /* vpanic() */ -EXPORT_SYMBOL(vpanic); + /* Unreachable */ + return (1); +} +EXPORT_SYMBOL(spl_panic); void vcmn_err(int ce, const char *fmt, va_list ap) { char msg[MAXMSGLEN]; - if (ce == CE_PANIC) - vpanic(fmt, ap); + vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); - if (ce != CE_NOTE) { - vsnprintf(msg, MAXMSGLEN - 1, fmt, ap); + switch (ce) { + case CE_IGNORE: + break; + case CE_CONT: + printk("%s", msg); + break; + case CE_NOTE: + printk(KERN_NOTICE "NOTICE: %s\n", msg); + break; + case CE_WARN: + printk(KERN_WARNING "WARNING: %s\n", msg); + break; + case CE_PANIC: + printk(KERN_EMERG "PANIC: %s\n", msg); + spl_dumpstack(); - if (fmt[0] == '!') - SDEBUG(SD_INFO, "%s%s%s", - ce_prefix[ce], msg, ce_suffix[ce]); - else - SERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]); + /* Halt the thread to facilitate further debugging */ + set_task_state(current, TASK_UNINTERRUPTIBLE); + while (1) + schedule(); } } /* vcmn_err() */ EXPORT_SYMBOL(vcmn_err); @@ -100,4 +115,3 @@ cmn_err(int ce, const char *fmt, ...) va_end(ap); } /* cmn_err() */ EXPORT_SYMBOL(cmn_err); - diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index fd68789bc..ecfb663de 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -40,13 +40,6 @@ #include #include #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_GENERIC char spl_version[32] = "SPL v" SPL_META_VERSION "-" SPL_META_RELEASE; EXPORT_SYMBOL(spl_version); @@ -490,39 +483,36 @@ __init spl_init(void) { int rc = 0; - if ((rc = spl_debug_init())) - return rc; - if ((rc = spl_kmem_init())) - SGOTO(out1, rc); + goto out1; if ((rc = spl_mutex_init())) - SGOTO(out2, rc); + goto out2; if ((rc = spl_rw_init())) - SGOTO(out3, rc); + goto out3; if ((rc = spl_taskq_init())) - SGOTO(out4, rc); + goto out4; if ((rc = spl_vn_init())) - SGOTO(out5, rc); + goto out5; if ((rc = spl_proc_init())) - SGOTO(out6, rc); + goto out6; if ((rc = spl_kstat_init())) - SGOTO(out7, rc); + goto out7; if ((rc = spl_tsd_init())) - SGOTO(out8, rc); + goto out8; if ((rc = spl_zlib_init())) - SGOTO(out9, rc); + goto out9; printk(KERN_NOTICE "SPL: Loaded module v%s-%s%s\n", SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR); - SRETURN(rc); + return (rc); out9: spl_tsd_fini(); @@ -541,19 +531,16 @@ out3: out2: spl_kmem_fini(); out1: - spl_debug_fini(); - printk(KERN_NOTICE "SPL: Failed to Load Solaris Porting Layer " "v%s-%s%s, rc = %d\n", SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR, rc); + return rc; } static void spl_fini(void) { - SENTRY; - printk(KERN_NOTICE "SPL: Unloaded module v%s-%s%s\n", SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR); spl_zlib_fini(); @@ -565,7 +552,6 @@ spl_fini(void) spl_rw_fini(); spl_mutex_fini(); spl_kmem_fini(); - spl_debug_fini(); } /* Called when a dependent module is loaded */ diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 65aa27739..37849f504 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -25,13 +25,6 @@ \*****************************************************************************/ #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_KMEM /* * Within the scope of spl-kmem.c file the kmem_cache_* definitions @@ -265,7 +258,6 @@ kmem_del_init(spinlock_t *lock, struct hlist_head *table, int bits, const void * struct hlist_node *node; struct kmem_debug *p; unsigned long flags; - SENTRY; spin_lock_irqsave(lock, flags); @@ -282,7 +274,7 @@ kmem_del_init(spinlock_t *lock, struct hlist_head *table, int bits, const void * spin_unlock_irqrestore(lock, flags); - SRETURN(NULL); + return (NULL); } void * @@ -292,28 +284,26 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, void *ptr = NULL; kmem_debug_t *dptr; unsigned long irq_flags; - SENTRY; /* Function may be called with KM_NOSLEEP so failure is possible */ dptr = (kmem_debug_t *) kmalloc_nofail(sizeof(kmem_debug_t), flags & ~__GFP_ZERO); if (unlikely(dptr == NULL)) { - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "debug " - "kmem_alloc(%ld, 0x%x) at %s:%d failed (%lld/%llu)\n", - sizeof(kmem_debug_t), flags, func, line, - kmem_alloc_used_read(), kmem_alloc_max); + printk(KERN_WARNING "debug kmem_alloc(%ld, 0x%x) at %s:%d " + "failed (%lld/%llu)\n", sizeof(kmem_debug_t), flags, + func, line, kmem_alloc_used_read(), kmem_alloc_max); } else { /* * Marked unlikely because we should never be doing this, * we tolerate to up 2 pages but a single page is best. */ if (unlikely((size > PAGE_SIZE*2) && !(flags & KM_NODEBUG))) { - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "large " - "kmem_alloc(%llu, 0x%x) at %s:%d (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, + printk(KERN_WARNING "large kmem_alloc(%llu, 0x%x) " + "at %s:%d failed (%lld/%llu)\n", + (unsigned long long)size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); - spl_debug_dumpstack(NULL); + spl_dumpstack(); } /* @@ -325,9 +315,9 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, dptr->kd_func = __strdup(func, flags & ~__GFP_ZERO); if (unlikely(dptr->kd_func == NULL)) { kfree(dptr); - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, - "debug __strdup() at %s:%d failed (%lld/%llu)\n", - func, line, kmem_alloc_used_read(), kmem_alloc_max); + printk(KERN_WARNING "debug __strdup() at %s:%d " + "failed (%lld/%llu)\n", func, line, + kmem_alloc_used_read(), kmem_alloc_max); goto out; } @@ -344,8 +334,8 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, if (unlikely(ptr == NULL)) { kfree(dptr->kd_func); kfree(dptr); - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "kmem_alloc" - "(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", + printk(KERN_WARNING "kmem_alloc(%llu, 0x%x) " + "at %s:%d failed (%lld/%llu)\n", (unsigned long long) size, flags, func, line, kmem_alloc_used_read(), kmem_alloc_max); goto out; @@ -367,14 +357,9 @@ kmem_alloc_track(size_t size, int flags, const char *func, int line, &kmem_table[hash_ptr(ptr, KMEM_HASH_BITS)]); list_add_tail(&dptr->kd_list, &kmem_list); spin_unlock_irqrestore(&kmem_lock, irq_flags); - - SDEBUG_LIMIT(SD_INFO, - "kmem_alloc(%llu, 0x%x) at %s:%d = %p (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, ptr, - kmem_alloc_used_read(), kmem_alloc_max); } out: - SRETURN(ptr); + return (ptr); } EXPORT_SYMBOL(kmem_alloc_track); @@ -382,14 +367,12 @@ void kmem_free_track(const void *ptr, size_t size) { kmem_debug_t *dptr; - SENTRY; ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, (unsigned long long) size); - dptr = kmem_del_init(&kmem_lock, kmem_table, KMEM_HASH_BITS, ptr); - /* Must exist in hash due to kmem_alloc() */ + dptr = kmem_del_init(&kmem_lock, kmem_table, KMEM_HASH_BITS, ptr); ASSERT(dptr); /* Size must match */ @@ -398,10 +381,6 @@ kmem_free_track(const void *ptr, size_t size) (unsigned long long) size, dptr->kd_func, dptr->kd_line); kmem_alloc_used_sub(size); - SDEBUG_LIMIT(SD_INFO, "kmem_free(%p, %llu) (%lld/%llu)\n", ptr, - (unsigned long long) size, kmem_alloc_used_read(), - kmem_alloc_max); - kfree(dptr->kd_func); memset((void *)dptr, 0x5a, sizeof(kmem_debug_t)); @@ -409,8 +388,6 @@ kmem_free_track(const void *ptr, size_t size) memset((void *)ptr, 0x5a, size); kfree(ptr); - - SEXIT; } EXPORT_SYMBOL(kmem_free_track); @@ -420,7 +397,6 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) void *ptr = NULL; kmem_debug_t *dptr; unsigned long irq_flags; - SENTRY; ASSERT(flags & KM_SLEEP); @@ -428,8 +404,8 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) dptr = (kmem_debug_t *) kmalloc_nofail(sizeof(kmem_debug_t), flags & ~__GFP_ZERO); if (unlikely(dptr == NULL)) { - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "debug " - "vmem_alloc(%ld, 0x%x) at %s:%d failed (%lld/%llu)\n", + printk(KERN_WARNING "debug vmem_alloc(%ld, 0x%x) " + "at %s:%d failed (%lld/%llu)\n", sizeof(kmem_debug_t), flags, func, line, vmem_alloc_used_read(), vmem_alloc_max); } else { @@ -443,9 +419,9 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) dptr->kd_func = __strdup(func, flags & ~__GFP_ZERO); if (unlikely(dptr->kd_func == NULL)) { kfree(dptr); - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, - "debug __strdup() at %s:%d failed (%lld/%llu)\n", - func, line, vmem_alloc_used_read(), vmem_alloc_max); + printk(KERN_WARNING "debug __strdup() at %s:%d " + "failed (%lld/%llu)\n", func, line, + vmem_alloc_used_read(), vmem_alloc_max); goto out; } @@ -459,8 +435,8 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) if (unlikely(ptr == NULL)) { kfree(dptr->kd_func); kfree(dptr); - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, "vmem_alloc" - "(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", + printk(KERN_WARNING "vmem_alloc (%llu, 0x%x) " + "at %s:%d failed (%lld/%llu)\n", (unsigned long long) size, flags, func, line, vmem_alloc_used_read(), vmem_alloc_max); goto out; @@ -482,14 +458,9 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) &vmem_table[hash_ptr(ptr, VMEM_HASH_BITS)]); list_add_tail(&dptr->kd_list, &vmem_list); spin_unlock_irqrestore(&vmem_lock, irq_flags); - - SDEBUG_LIMIT(SD_INFO, - "vmem_alloc(%llu, 0x%x) at %s:%d = %p (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, - ptr, vmem_alloc_used_read(), vmem_alloc_max); } out: - SRETURN(ptr); + return (ptr); } EXPORT_SYMBOL(vmem_alloc_track); @@ -497,14 +468,12 @@ void vmem_free_track(const void *ptr, size_t size) { kmem_debug_t *dptr; - SENTRY; ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, (unsigned long long) size); - dptr = kmem_del_init(&vmem_lock, vmem_table, VMEM_HASH_BITS, ptr); - /* Must exist in hash due to vmem_alloc() */ + dptr = kmem_del_init(&vmem_lock, vmem_table, VMEM_HASH_BITS, ptr); ASSERT(dptr); /* Size must match */ @@ -513,10 +482,6 @@ vmem_free_track(const void *ptr, size_t size) (unsigned long long) size, dptr->kd_func, dptr->kd_line); vmem_alloc_used_sub(size); - SDEBUG_LIMIT(SD_INFO, "vmem_free(%p, %llu) (%lld/%llu)\n", ptr, - (unsigned long long) size, vmem_alloc_used_read(), - vmem_alloc_max); - kfree(dptr->kd_func); memset((void *)dptr, 0x5a, sizeof(kmem_debug_t)); @@ -524,8 +489,6 @@ vmem_free_track(const void *ptr, size_t size) memset((void *)ptr, 0x5a, size); vfree(ptr); - - SEXIT; } EXPORT_SYMBOL(vmem_free_track); @@ -536,18 +499,17 @@ kmem_alloc_debug(size_t size, int flags, const char *func, int line, int node_alloc, int node) { void *ptr; - SENTRY; /* * Marked unlikely because we should never be doing this, * we tolerate to up 2 pages but a single page is best. */ if (unlikely((size > PAGE_SIZE * 2) && !(flags & KM_NODEBUG))) { - SDEBUG(SD_CONSOLE | SD_WARNING, + printk(KERN_WARNING "large kmem_alloc(%llu, 0x%x) at %s:%d (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, - kmem_alloc_used_read(), kmem_alloc_max); - spl_debug_dumpstack(NULL); + (unsigned long long)size, flags, func, line, + (unsigned long long)kmem_alloc_used_read(), kmem_alloc_max); + spl_dumpstack(); } /* Use the correct allocator */ @@ -561,40 +523,26 @@ kmem_alloc_debug(size_t size, int flags, const char *func, int line, } if (unlikely(ptr == NULL)) { - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, + printk(KERN_WARNING "kmem_alloc(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, - kmem_alloc_used_read(), kmem_alloc_max); + (unsigned long long)size, flags, func, line, + (unsigned long long)kmem_alloc_used_read(), kmem_alloc_max); } else { kmem_alloc_used_add(size); if (unlikely(kmem_alloc_used_read() > kmem_alloc_max)) kmem_alloc_max = kmem_alloc_used_read(); - - SDEBUG_LIMIT(SD_INFO, - "kmem_alloc(%llu, 0x%x) at %s:%d = %p (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, ptr, - kmem_alloc_used_read(), kmem_alloc_max); } - SRETURN(ptr); + return (ptr); } EXPORT_SYMBOL(kmem_alloc_debug); void kmem_free_debug(const void *ptr, size_t size) { - SENTRY; - - ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, - (unsigned long long) size); - + ASSERT(ptr || size > 0); kmem_alloc_used_sub(size); - SDEBUG_LIMIT(SD_INFO, "kmem_free(%p, %llu) (%lld/%llu)\n", ptr, - (unsigned long long) size, kmem_alloc_used_read(), - kmem_alloc_max); kfree(ptr); - - SEXIT; } EXPORT_SYMBOL(kmem_free_debug); @@ -602,7 +550,6 @@ void * vmem_alloc_debug(size_t size, int flags, const char *func, int line) { void *ptr; - SENTRY; ASSERT(flags & KM_SLEEP); @@ -614,39 +561,26 @@ vmem_alloc_debug(size_t size, int flags, const char *func, int line) } if (unlikely(ptr == NULL)) { - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, + printk(KERN_WARNING "vmem_alloc(%llu, 0x%x) at %s:%d failed (%lld/%llu)\n", - (unsigned long long) size, flags, func, line, - vmem_alloc_used_read(), vmem_alloc_max); + (unsigned long long)size, flags, func, line, + (unsigned long long)vmem_alloc_used_read(), vmem_alloc_max); } else { vmem_alloc_used_add(size); if (unlikely(vmem_alloc_used_read() > vmem_alloc_max)) vmem_alloc_max = vmem_alloc_used_read(); - - SDEBUG_LIMIT(SD_INFO, "vmem_alloc(%llu, 0x%x) = %p " - "(%lld/%llu)\n", (unsigned long long) size, flags, ptr, - vmem_alloc_used_read(), vmem_alloc_max); } - SRETURN(ptr); + return (ptr); } EXPORT_SYMBOL(vmem_alloc_debug); void vmem_free_debug(const void *ptr, size_t size) { - SENTRY; - - ASSERTF(ptr || size > 0, "ptr: %p, size: %llu", ptr, - (unsigned long long) size); - + ASSERT(ptr || size > 0); vmem_alloc_used_sub(size); - SDEBUG_LIMIT(SD_INFO, "vmem_free(%p, %llu) (%lld/%llu)\n", ptr, - (unsigned long long) size, vmem_alloc_used_read(), - vmem_alloc_max); vfree(ptr); - - SEXIT; } EXPORT_SYMBOL(vmem_free_debug); @@ -833,7 +767,7 @@ spl_slab_alloc(spl_kmem_cache_t *skc, int flags) base = kv_alloc(skc, skc->skc_slab_size, flags); if (base == NULL) - SRETURN(NULL); + return (NULL); sks = (spl_kmem_slab_t *)base; sks->sks_magic = SKS_MAGIC; @@ -851,8 +785,10 @@ spl_slab_alloc(spl_kmem_cache_t *skc, int flags) for (i = 0; i < sks->sks_objs; i++) { if (skc->skc_flags & KMC_OFFSLAB) { obj = kv_alloc(skc, offslab_size, flags); - if (!obj) - SGOTO(out, rc = -ENOMEM); + if (!obj) { + rc = -ENOMEM; + goto out; + } } else { obj = base + spl_sks_size(skc) + (i * obj_size); } @@ -877,7 +813,7 @@ out: sks = NULL; } - SRETURN(sks); + return (sks); } /* @@ -890,7 +826,6 @@ spl_slab_free(spl_kmem_slab_t *sks, struct list_head *sks_list, struct list_head *sko_list) { spl_kmem_cache_t *skc; - SENTRY; ASSERT(sks->sks_magic == SKS_MAGIC); ASSERT(sks->sks_ref == 0); @@ -910,8 +845,6 @@ spl_slab_free(spl_kmem_slab_t *sks, list_del(&sks->sks_list); list_add(&sks->sks_list, sks_list); list_splice_init(&sks->sks_free_list, sko_list); - - SEXIT; } /* @@ -931,7 +864,6 @@ spl_slab_reclaim(spl_kmem_cache_t *skc, int count, int flag) LIST_HEAD(sko_list); uint32_t size = 0; int i = 0; - SENTRY; /* * Move empty slabs and objects which have not been touched in @@ -979,8 +911,6 @@ spl_slab_reclaim(spl_kmem_cache_t *skc, int count, int flag) ASSERT(sks->sks_magic == SKS_MAGIC); kv_free(skc, sks, skc->skc_slab_size); } - - SEXIT; } static spl_kmem_emergency_t * @@ -1037,23 +967,22 @@ spl_emergency_alloc(spl_kmem_cache_t *skc, int flags, void **obj) { spl_kmem_emergency_t *ske; int empty; - SENTRY; /* Last chance use a partial slab if one now exists */ spin_lock(&skc->skc_lock); empty = list_empty(&skc->skc_partial_list); spin_unlock(&skc->skc_lock); if (!empty) - SRETURN(-EEXIST); + return (-EEXIST); ske = kmalloc(sizeof(*ske), flags); if (ske == NULL) - SRETURN(-ENOMEM); + return (-ENOMEM); ske->ske_obj = kmalloc(skc->skc_obj_size, flags); if (ske->ske_obj == NULL) { kfree(ske); - SRETURN(-ENOMEM); + return (-ENOMEM); } spin_lock(&skc->skc_lock); @@ -1069,12 +998,12 @@ spl_emergency_alloc(spl_kmem_cache_t *skc, int flags, void **obj) if (unlikely(!empty)) { kfree(ske->ske_obj); kfree(ske); - SRETURN(-EINVAL); + return (-EINVAL); } *obj = ske->ske_obj; - SRETURN(0); + return (0); } /* @@ -1084,7 +1013,6 @@ static int spl_emergency_free(spl_kmem_cache_t *skc, void *obj) { spl_kmem_emergency_t *ske; - SENTRY; spin_lock(&skc->skc_lock); ske = spl_emergency_search(&skc->skc_emergency_tree, obj); @@ -1096,12 +1024,12 @@ spl_emergency_free(spl_kmem_cache_t *skc, void *obj) spin_unlock(&skc->skc_lock); if (unlikely(ske == NULL)) - SRETURN(-ENOENT); + return (-ENOENT); kfree(ske->ske_obj); kfree(ske); - SRETURN(0); + return (0); } /* @@ -1112,7 +1040,6 @@ static void __spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) { int i, count = MIN(flush, skm->skm_avail); - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(skm->skm_magic == SKM_MAGIC); @@ -1124,8 +1051,6 @@ __spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) skm->skm_avail -= count; memmove(skm->skm_objs, &(skm->skm_objs[count]), sizeof(void *) * skm->skm_avail); - - SEXIT; } static void @@ -1227,7 +1152,7 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size) if (skc->skc_flags & KMC_OFFSLAB) { *objs = spl_kmem_cache_obj_per_slab; *size = P2ROUNDUP(sizeof(spl_kmem_slab_t), PAGE_SIZE); - SRETURN(0); + return (0); } else { sks_size = spl_sks_size(skc); obj_size = spl_obj_size(skc); @@ -1241,7 +1166,7 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size) for (*size = PAGE_SIZE; *size <= max_size; *size *= 2) { *objs = (*size - sks_size) / obj_size; if (*objs >= spl_kmem_cache_obj_per_slab) - SRETURN(0); + return (0); } /* @@ -1252,10 +1177,10 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size) *size = max_size; *objs = (*size - sks_size) / obj_size; if (*objs >= (spl_kmem_cache_obj_per_slab_min)) - SRETURN(0); + return (0); } - SRETURN(-ENOSPC); + return (-ENOSPC); } /* @@ -1268,7 +1193,6 @@ spl_magazine_size(spl_kmem_cache_t *skc) { uint32_t obj_size = spl_obj_size(skc); int size; - SENTRY; /* Per-magazine sizes below assume a 4Kib page size */ if (obj_size > (PAGE_SIZE * 256)) @@ -1282,7 +1206,7 @@ spl_magazine_size(spl_kmem_cache_t *skc) else size = 256; - SRETURN(size); + return (size); } /* @@ -1294,7 +1218,6 @@ spl_magazine_alloc(spl_kmem_cache_t *skc, int cpu) spl_kmem_magazine_t *skm; int size = sizeof(spl_kmem_magazine_t) + sizeof(void *) * skc->skc_mag_size; - SENTRY; skm = kmem_alloc_node(size, KM_SLEEP, cpu_to_node(cpu)); if (skm) { @@ -1307,7 +1230,7 @@ spl_magazine_alloc(spl_kmem_cache_t *skc, int cpu) skm->skm_cpu = cpu; } - SRETURN(skm); + return (skm); } /* @@ -1319,12 +1242,10 @@ spl_magazine_free(spl_kmem_magazine_t *skm) int size = sizeof(spl_kmem_magazine_t) + sizeof(void *) * skm->skm_size; - SENTRY; ASSERT(skm->skm_magic == SKM_MAGIC); ASSERT(skm->skm_avail == 0); kmem_free(skm, size); - SEXIT; } /* @@ -1334,10 +1255,9 @@ static int spl_magazine_create(spl_kmem_cache_t *skc) { int i; - SENTRY; if (skc->skc_flags & KMC_NOMAGAZINE) - SRETURN(0); + return (0); skc->skc_mag_size = spl_magazine_size(skc); skc->skc_mag_refill = (skc->skc_mag_size + 1) / 2; @@ -1348,11 +1268,11 @@ spl_magazine_create(spl_kmem_cache_t *skc) for (i--; i >= 0; i--) spl_magazine_free(skc->skc_mag[i]); - SRETURN(-ENOMEM); + return (-ENOMEM); } } - SRETURN(0); + return (0); } /* @@ -1363,20 +1283,15 @@ spl_magazine_destroy(spl_kmem_cache_t *skc) { spl_kmem_magazine_t *skm; int i; - SENTRY; - if (skc->skc_flags & KMC_NOMAGAZINE) { - SEXIT; + if (skc->skc_flags & KMC_NOMAGAZINE) return; - } for_each_online_cpu(i) { skm = skc->skc_mag[i]; spl_cache_flush(skc, skm, skm->skm_avail); spl_magazine_free(skm); } - - SEXIT; } /* @@ -1409,11 +1324,13 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, { spl_kmem_cache_t *skc; int rc; - SENTRY; - ASSERTF(!(flags & KMC_NOMAGAZINE), "Bad KMC_NOMAGAZINE (%x)\n", flags); - ASSERTF(!(flags & KMC_NOHASH), "Bad KMC_NOHASH (%x)\n", flags); - ASSERTF(!(flags & KMC_QCACHE), "Bad KMC_QCACHE (%x)\n", flags); + /* + * Unsupported flags + */ + ASSERT0(flags & KMC_NOMAGAZINE); + ASSERT0(flags & KMC_NOHASH); + ASSERT0(flags & KMC_QCACHE); ASSERT(vmp == NULL); might_sleep(); @@ -1427,14 +1344,14 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, */ skc = kmem_zalloc(sizeof(*skc), KM_SLEEP| KM_NODEBUG); if (skc == NULL) - SRETURN(NULL); + return (NULL); skc->skc_magic = SKC_MAGIC; skc->skc_name_size = strlen(name) + 1; skc->skc_name = (char *)kmem_alloc(skc->skc_name_size, KM_SLEEP); if (skc->skc_name == NULL) { kmem_free(skc, sizeof(*skc)); - SRETURN(NULL); + return (NULL); } strncpy(skc->skc_name, name, skc->skc_name_size); @@ -1519,16 +1436,18 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, rc = spl_slab_size(skc, &skc->skc_slab_objs, &skc->skc_slab_size); if (rc) - SGOTO(out, rc); + goto out; rc = spl_magazine_create(skc); if (rc) - SGOTO(out, rc); + goto out; } else { skc->skc_linux_cache = kmem_cache_create( skc->skc_name, size, align, 0, NULL); - if (skc->skc_linux_cache == NULL) - SGOTO(out, rc = ENOMEM); + if (skc->skc_linux_cache == NULL) { + rc = ENOMEM; + goto out; + } kmem_cache_set_allocflags(skc, __GFP_COMP); skc->skc_flags |= KMC_NOMAGAZINE; @@ -1543,11 +1462,11 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, list_add_tail(&skc->skc_list, &spl_kmem_cache_list); up_write(&spl_kmem_cache_sem); - SRETURN(skc); + return (skc); out: kmem_free(skc->skc_name, skc->skc_name_size); kmem_free(skc, sizeof(*skc)); - SRETURN(NULL); + return (NULL); } EXPORT_SYMBOL(spl_kmem_cache_create); @@ -1571,7 +1490,6 @@ spl_kmem_cache_destroy(spl_kmem_cache_t *skc) { DECLARE_WAIT_QUEUE_HEAD(wq); taskqid_t id; - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(skc->skc_flags & (KMC_KMEM | KMC_VMEM | KMC_SLAB)); @@ -1617,8 +1535,6 @@ spl_kmem_cache_destroy(spl_kmem_cache_t *skc) spin_unlock(&skc->skc_lock); kmem_free(skc, sizeof(*skc)); - - SEXIT; } EXPORT_SYMBOL(spl_kmem_cache_destroy); @@ -1708,7 +1624,6 @@ static int spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj) { int remaining, rc; - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT((skc->skc_flags & KMC_SLAB) == 0); @@ -1722,7 +1637,7 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj) if (test_bit(KMC_BIT_REAPING, &skc->skc_flags)) { rc = spl_wait_on_bit(&skc->skc_flags, KMC_BIT_REAPING, TASK_UNINTERRUPTIBLE); - SRETURN(rc ? rc : -EAGAIN); + return (rc ? rc : -EAGAIN); } /* @@ -1738,7 +1653,7 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj) if (ska == NULL) { clear_bit(KMC_BIT_GROWING, &skc->skc_flags); wake_up_all(&skc->skc_waitq); - SRETURN(-ENOMEM); + return (-ENOMEM); } atomic_inc(&skc->skc_ref); @@ -1776,7 +1691,7 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj) rc = -ENOMEM; } - SRETURN(rc); + return (rc); } /* @@ -1792,7 +1707,6 @@ spl_cache_refill(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flags) spl_kmem_slab_t *sks; int count = 0, rc, refill; void *obj = NULL; - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(skm->skm_magic == SKM_MAGIC); @@ -1811,14 +1725,14 @@ spl_cache_refill(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flags) /* Emergency object for immediate use by caller */ if (rc == 0 && obj != NULL) - SRETURN(obj); + return (obj); if (rc) - SGOTO(out, rc); + goto out; /* Rescheduled to different CPU skm is not local */ if (skm != skc->skc_mag[smp_processor_id()]) - SGOTO(out, rc); + goto out; /* Potentially rescheduled to the same CPU but * allocations may have occurred from this CPU while @@ -1853,7 +1767,7 @@ spl_cache_refill(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flags) spin_unlock(&skc->skc_lock); out: - SRETURN(NULL); + return (NULL); } /* @@ -1864,7 +1778,6 @@ spl_cache_shrink(spl_kmem_cache_t *skc, void *obj) { spl_kmem_slab_t *sks = NULL; spl_kmem_obj_t *sko = NULL; - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(spin_is_locked(&skc->skc_lock)); @@ -1895,8 +1808,6 @@ spl_cache_shrink(spl_kmem_cache_t *skc, void *obj) list_add_tail(&sks->sks_list, &skc->skc_partial_list); skc->skc_slab_alloc--; } - - SEXIT; } /* @@ -1908,7 +1819,6 @@ spl_kmem_cache_alloc(spl_kmem_cache_t *skc, int flags) { spl_kmem_magazine_t *skm; void *obj = NULL; - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(!test_bit(KMC_BIT_DESTROY, &skc->skc_flags)); @@ -1939,9 +1849,7 @@ restart: * the local magazine since this may have changed * when we need to grow the cache. */ skm = skc->skc_mag[smp_processor_id()]; - ASSERTF(skm->skm_magic == SKM_MAGIC, "%x != %x: %s/%p/%p %x/%x/%x\n", - skm->skm_magic, SKM_MAGIC, skc->skc_name, skc, skm, - skm->skm_size, skm->skm_refill, skm->skm_avail); + ASSERT(skm->skm_magic == SKM_MAGIC); if (likely(skm->skm_avail)) { /* Object available in CPU cache, use it */ @@ -1950,7 +1858,7 @@ restart: } else { obj = spl_cache_refill(skc, skm, flags); if (obj == NULL) - SGOTO(restart, obj = NULL); + goto restart; } local_irq_enable(); @@ -1968,7 +1876,7 @@ ret: atomic_dec(&skc->skc_ref); - SRETURN(obj); + return (obj); } EXPORT_SYMBOL(spl_kmem_cache_alloc); @@ -1984,7 +1892,6 @@ spl_kmem_cache_free(spl_kmem_cache_t *skc, void *obj) { spl_kmem_magazine_t *skm; unsigned long flags; - SENTRY; ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(!test_bit(KMC_BIT_DESTROY, &skc->skc_flags)); @@ -2009,8 +1916,10 @@ spl_kmem_cache_free(spl_kmem_cache_t *skc, void *obj) * are guaranteed to have physical addresses. They must be removed * from the tree of emergency objects and the freed. */ - if ((skc->skc_flags & KMC_VMEM) && !kmem_virt(obj)) - SGOTO(out, spl_emergency_free(skc, obj)); + if ((skc->skc_flags & KMC_VMEM) && !kmem_virt(obj)) { + spl_emergency_free(skc, obj); + goto out; + } local_irq_save(flags); @@ -2031,8 +1940,6 @@ spl_kmem_cache_free(spl_kmem_cache_t *skc, void *obj) local_irq_restore(flags); out: atomic_dec(&skc->skc_ref); - - SEXIT; } EXPORT_SYMBOL(spl_kmem_cache_free); @@ -2113,8 +2020,6 @@ SPL_SHRINKER_CALLBACK_WRAPPER(spl_kmem_cache_generic_shrinker); void spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count) { - SENTRY; - ASSERT(skc->skc_magic == SKC_MAGIC); ASSERT(!test_bit(KMC_BIT_DESTROY, &skc->skc_flags)); @@ -2131,14 +2036,14 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count) if (spl_kmem_cache_expire & KMC_EXPIRE_MEM) kmem_cache_shrink(skc->skc_linux_cache); - SGOTO(out, 0); + goto out; } /* * Prevent concurrent cache reaping when contended. */ if (test_and_set_bit(KMC_BIT_REAPING, &skc->skc_flags)) - SGOTO(out, 0); + goto out; /* * When a reclaim function is available it may be invoked repeatedly @@ -2190,8 +2095,6 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count) wake_up_bit(&skc->skc_flags, KMC_BIT_REAPING); out: atomic_dec(&skc->skc_ref); - - SEXIT; } EXPORT_SYMBOL(spl_kmem_cache_reap_now); @@ -2256,7 +2159,6 @@ static int spl_kmem_init_tracking(struct list_head *list, spinlock_t *lock, int size) { int i; - SENTRY; spin_lock_init(lock); INIT_LIST_HEAD(list); @@ -2264,7 +2166,7 @@ spl_kmem_init_tracking(struct list_head *list, spinlock_t *lock, int size) for (i = 0; i < size; i++) INIT_HLIST_HEAD(&kmem_table[i]); - SRETURN(0); + return (0); } static void @@ -2273,7 +2175,6 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock) unsigned long flags; kmem_debug_t *kd; char str[17]; - SENTRY; spin_lock_irqsave(lock, flags); if (!list_empty(list)) @@ -2286,7 +2187,6 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock) kd->kd_func, kd->kd_line); spin_unlock_irqrestore(lock, flags); - SEXIT; } #else /* DEBUG_KMEM && DEBUG_KMEM_TRACKING */ #define spl_kmem_init_tracking(list, lock, size) @@ -2297,7 +2197,6 @@ int spl_kmem_init(void) { int rc = 0; - SENTRY; #ifdef DEBUG_KMEM kmem_alloc_used_set(0); @@ -2314,14 +2213,12 @@ spl_kmem_init(void) spl_register_shrinker(&spl_kmem_cache_shrinker); - SRETURN(rc); + return (rc); } void spl_kmem_fini(void) { - SENTRY; - spl_unregister_shrinker(&spl_kmem_cache_shrinker); taskq_destroy(spl_kmem_cache_taskq); @@ -2331,19 +2228,14 @@ spl_kmem_fini(void) * at that address to aid in debugging. Performance is not * a serious concern here since it is module unload time. */ if (kmem_alloc_used_read() != 0) - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, - "kmem leaked %ld/%ld bytes\n", + printk(KERN_WARNING "kmem leaked %ld/%llu bytes\n", kmem_alloc_used_read(), kmem_alloc_max); - if (vmem_alloc_used_read() != 0) - SDEBUG_LIMIT(SD_CONSOLE | SD_WARNING, - "vmem leaked %ld/%ld bytes\n", + printk(KERN_WARNING "vmem leaked %ld/%llu bytes\n", vmem_alloc_used_read(), vmem_alloc_max); spl_kmem_fini_tracking(&kmem_list, &kmem_lock); spl_kmem_fini_tracking(&vmem_list, &vmem_lock); #endif /* DEBUG_KMEM */ - - SEXIT; } diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index f14f47f5d..5b29fdb58 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -25,13 +25,6 @@ \*****************************************************************************/ #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_KOBJ struct _buf * kobj_open_file(const char *name) @@ -39,38 +32,34 @@ kobj_open_file(const char *name) struct _buf *file; vnode_t *vp; int rc; - SENTRY; file = kmalloc(sizeof(_buf_t), GFP_KERNEL); if (file == NULL) - SRETURN((_buf_t *)-1UL); + return ((_buf_t *)-1UL); if ((rc = vn_open(name, UIO_SYSSPACE, FREAD, 0644, &vp, 0, 0))) { kfree(file); - SRETURN((_buf_t *)-1UL); + return ((_buf_t *)-1UL); } file->vp = vp; - SRETURN(file); + return (file); } /* kobj_open_file() */ EXPORT_SYMBOL(kobj_open_file); void kobj_close_file(struct _buf *file) { - SENTRY; VOP_CLOSE(file->vp, 0, 0, 0, 0, 0); kfree(file); - SEXIT; } /* kobj_close_file() */ EXPORT_SYMBOL(kobj_close_file); int kobj_read_file(struct _buf *file, char *buf, ssize_t size, offset_t off) { - SENTRY; - SRETURN(vn_rdwr(UIO_READ, file->vp, buf, size, off, + return (vn_rdwr(UIO_READ, file->vp, buf, size, off, UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL)); } /* kobj_read_file() */ EXPORT_SYMBOL(kobj_read_file); @@ -80,14 +69,13 @@ kobj_get_filesize(struct _buf *file, uint64_t *size) { vattr_t vap; int rc; - SENTRY; rc = VOP_GETATTR(file->vp, &vap, 0, 0, NULL); if (rc) - SRETURN(rc); + return (rc); *size = vap.va_size; - SRETURN(rc); + return (rc); } /* kobj_get_filesize() */ EXPORT_SYMBOL(kobj_get_filesize); diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index c604a32f2..cb27ed3d3 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -26,13 +26,7 @@ #include #include -#include -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_KSTAT #ifndef HAVE_PDE_DATA #define PDE_DATA(x) (PDE(x)->data) #endif @@ -344,7 +338,6 @@ static void * kstat_seq_data_addr(kstat_t *ksp, loff_t n) { void *rc = NULL; - SENTRY; switch (ksp->ks_type) { case KSTAT_TYPE_RAW: @@ -369,7 +362,7 @@ kstat_seq_data_addr(kstat_t *ksp, loff_t n) PANIC("Undefined kstat type %d\n", ksp->ks_type); } - SRETURN(rc); + return (rc); } static void * @@ -378,7 +371,6 @@ kstat_seq_start(struct seq_file *f, loff_t *pos) loff_t n = *pos; kstat_t *ksp = (kstat_t *)f->private; ASSERT(ksp->ks_magic == KS_MAGIC); - SENTRY; mutex_enter(ksp->ks_lock); @@ -393,12 +385,12 @@ kstat_seq_start(struct seq_file *f, loff_t *pos) ksp->ks_snaptime = gethrtime(); if (!n && kstat_seq_show_headers(f)) - SRETURN(NULL); + return (NULL); if (n >= ksp->ks_ndata) - SRETURN(NULL); + return (NULL); - SRETURN(kstat_seq_data_addr(ksp, n)); + return (kstat_seq_data_addr(ksp, n)); } static void * @@ -406,13 +398,12 @@ kstat_seq_next(struct seq_file *f, void *p, loff_t *pos) { kstat_t *ksp = (kstat_t *)f->private; ASSERT(ksp->ks_magic == KS_MAGIC); - SENTRY; ++*pos; if (*pos >= ksp->ks_ndata) - SRETURN(NULL); + return (NULL); - SRETURN(kstat_seq_data_addr(ksp, *pos)); + return (kstat_seq_data_addr(ksp, *pos)); } static void @@ -689,19 +680,16 @@ EXPORT_SYMBOL(__kstat_delete); int spl_kstat_init(void) { - SENTRY; mutex_init(&kstat_module_lock, NULL, MUTEX_DEFAULT, NULL); INIT_LIST_HEAD(&kstat_module_list); kstat_id = 0; - SRETURN(0); + return (0); } void spl_kstat_fini(void) { - SENTRY; ASSERT(list_empty(&kstat_module_list)); mutex_destroy(&kstat_module_lock); - SEXIT; } diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 6ecc0c31c..137af7188 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -30,13 +30,6 @@ #include #include #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_PROC #if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) typedef struct ctl_table __no_const spl_ctl_table; @@ -110,209 +103,6 @@ proc_copyout_string(char *ubuffer, int ubuffer_size, return size; } -#ifdef DEBUG_LOG -static int -proc_dobitmasks(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - unsigned long *mask = table->data; - int is_subsys = (mask == &spl_debug_subsys) ? 1 : 0; - int is_printk = (mask == &spl_debug_printk) ? 1 : 0; - int size = 512, rc; - char *str; - SENTRY; - - str = kmem_alloc(size, KM_SLEEP); - if (str == NULL) - SRETURN(-ENOMEM); - - if (write) { - rc = proc_copyin_string(str, size, buffer, *lenp); - if (rc < 0) - SRETURN(rc); - - rc = spl_debug_str2mask(mask, str, is_subsys); - /* Always print BUG/ASSERT to console, so keep this mask */ - if (is_printk) - *mask |= SD_EMERG; - - *ppos += *lenp; - } else { - rc = spl_debug_mask2str(str, size, *mask, is_subsys); - if (*ppos >= rc) - rc = 0; - else - rc = proc_copyout_string(buffer, *lenp, - str + *ppos, "\n"); - if (rc >= 0) { - *lenp = rc; - *ppos += rc; - } - } - - kmem_free(str, size); - SRETURN(rc); -} - -static int -proc_debug_mb(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - char str[32]; - int rc, len; - SENTRY; - - if (write) { - rc = proc_copyin_string(str, sizeof(str), buffer, *lenp); - if (rc < 0) - SRETURN(rc); - - rc = spl_debug_set_mb(simple_strtoul(str, NULL, 0)); - *ppos += *lenp; - } else { - len = snprintf(str, sizeof(str), "%d", spl_debug_get_mb()); - if (*ppos >= len) - rc = 0; - else - rc = proc_copyout_string(buffer,*lenp,str+*ppos,"\n"); - - if (rc >= 0) { - *lenp = rc; - *ppos += rc; - } - } - - SRETURN(rc); -} - -static int -proc_dump_kernel(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - SENTRY; - - if (write) { - spl_debug_dumplog(0); - *ppos += *lenp; - } else { - *lenp = 0; - } - - SRETURN(0); -} - -static int -proc_force_bug(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - SENTRY; - - if (write) - PANIC("Crashing due to forced panic\n"); - else - *lenp = 0; - - SRETURN(0); -} - -static int -proc_console_max_delay_cs(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int rc, max_delay_cs; - spl_ctl_table dummy = *table; - long d; - SENTRY; - - dummy.data = &max_delay_cs; - dummy.proc_handler = &proc_dointvec; - - if (write) { - max_delay_cs = 0; - rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); - if (rc < 0) - SRETURN(rc); - - if (max_delay_cs <= 0) - SRETURN(-EINVAL); - - d = (max_delay_cs * HZ) / 100; - if (d == 0 || d < spl_console_min_delay) - SRETURN(-EINVAL); - - spl_console_max_delay = d; - } else { - max_delay_cs = (spl_console_max_delay * 100) / HZ; - rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); - } - - SRETURN(rc); -} - -static int -proc_console_min_delay_cs(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int rc, min_delay_cs; - spl_ctl_table dummy = *table; - long d; - SENTRY; - - dummy.data = &min_delay_cs; - dummy.proc_handler = &proc_dointvec; - - if (write) { - min_delay_cs = 0; - rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); - if (rc < 0) - SRETURN(rc); - - if (min_delay_cs <= 0) - SRETURN(-EINVAL); - - d = (min_delay_cs * HZ) / 100; - if (d == 0 || d > spl_console_max_delay) - SRETURN(-EINVAL); - - spl_console_min_delay = d; - } else { - min_delay_cs = (spl_console_min_delay * 100) / HZ; - rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); - } - - SRETURN(rc); -} - -static int -proc_console_backoff(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int rc, backoff; - spl_ctl_table dummy = *table; - SENTRY; - - dummy.data = &backoff; - dummy.proc_handler = &proc_dointvec; - - if (write) { - backoff = 0; - rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); - if (rc < 0) - SRETURN(rc); - - if (backoff <= 0) - SRETURN(-EINVAL); - - spl_console_backoff = backoff; - } else { - backoff = spl_console_backoff; - rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); - } - - SRETURN(rc); -} -#endif /* DEBUG_LOG */ - #ifdef DEBUG_KMEM static int proc_domemused(struct ctl_table *table, int write, @@ -321,7 +111,6 @@ proc_domemused(struct ctl_table *table, int write, int rc = 0; unsigned long min = 0, max = ~0, val; spl_ctl_table dummy = *table; - SENTRY; dummy.data = &val; dummy.proc_handler = &proc_dointvec; @@ -339,7 +128,7 @@ proc_domemused(struct ctl_table *table, int write, rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos); } - SRETURN(rc); + return (rc); } static int @@ -350,7 +139,6 @@ proc_doslab(struct ctl_table *table, int write, unsigned long min = 0, max = ~0, val = 0, mask; spl_ctl_table dummy = *table; spl_kmem_cache_t *skc; - SENTRY; dummy.data = &val; dummy.proc_handler = &proc_dointvec; @@ -387,7 +175,7 @@ proc_doslab(struct ctl_table *table, int write, rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos); } - SRETURN(rc); + return (rc); } #endif /* DEBUG_KMEM */ @@ -397,7 +185,6 @@ proc_dohostid(struct ctl_table *table, int write, { int len, rc = 0; char *end, str[32]; - SENTRY; if (write) { /* We can't use proc_doulongvec_minmax() in the write @@ -405,11 +192,11 @@ proc_dohostid(struct ctl_table *table, int write, * leading 0x which confuses the helper function. */ rc = proc_copyin_string(str, sizeof(str), buffer, *lenp); if (rc < 0) - SRETURN(rc); + return (rc); spl_hostid = simple_strtoul(str, &end, 16); if (str == end) - SRETURN(-EINVAL); + return (-EINVAL); } else { len = snprintf(str, sizeof(str), "%lx", spl_hostid); @@ -424,7 +211,7 @@ proc_dohostid(struct ctl_table *table, int write, } } - SRETURN(rc); + return (rc); } #ifdef DEBUG_KMEM @@ -487,7 +274,6 @@ slab_seq_start(struct seq_file *f, loff_t *pos) { struct list_head *p; loff_t n = *pos; - SENTRY; down_read(&spl_kmem_cache_sem); if (!n) @@ -497,20 +283,19 @@ slab_seq_start(struct seq_file *f, loff_t *pos) while (n--) { p = p->next; if (p == &spl_kmem_cache_list) - SRETURN(NULL); + return (NULL); } - SRETURN(list_entry(p, spl_kmem_cache_t, skc_list)); + return (list_entry(p, spl_kmem_cache_t, skc_list)); } static void * slab_seq_next(struct seq_file *f, void *p, loff_t *pos) { spl_kmem_cache_t *skc = p; - SENTRY; ++*pos; - SRETURN((skc->skc_list.next == &spl_kmem_cache_list) ? + return ((skc->skc_list.next == &spl_kmem_cache_list) ? NULL : list_entry(skc->skc_list.next,spl_kmem_cache_t,skc_list)); } @@ -541,108 +326,6 @@ static struct file_operations proc_slab_operations = { }; #endif /* DEBUG_KMEM */ -#ifdef DEBUG_LOG -static struct ctl_table spl_debug_table[] = { - { - .procname = "subsystem", - .data = &spl_debug_subsys, - .maxlen = sizeof(unsigned long), - .mode = 0644, - .proc_handler = &proc_dobitmasks - }, - { - .procname = "mask", - .data = &spl_debug_mask, - .maxlen = sizeof(unsigned long), - .mode = 0644, - .proc_handler = &proc_dobitmasks - }, - { - .procname = "printk", - .data = &spl_debug_printk, - .maxlen = sizeof(unsigned long), - .mode = 0644, - .proc_handler = &proc_dobitmasks - }, - { - .procname = "mb", - .mode = 0644, - .proc_handler = &proc_debug_mb, - }, - { - .procname = "binary", - .data = &spl_debug_binary, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_dointvec, - }, - { - .procname = "catastrophe", - .data = &spl_debug_catastrophe, - .maxlen = sizeof(int), - .mode = 0444, - .proc_handler = &proc_dointvec, - }, - { - .procname = "panic_on_bug", - .data = &spl_debug_panic_on_bug, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_dointvec - }, - { - .procname = "path", - .data = spl_debug_file_path, - .maxlen = sizeof(spl_debug_file_path), - .mode = 0644, - .proc_handler = &proc_dostring, - }, - { - .procname = "dump", - .mode = 0200, - .proc_handler = &proc_dump_kernel, - }, - { - .procname = "force_bug", - .mode = 0200, - .proc_handler = &proc_force_bug, - }, - { - .procname = "console_ratelimit", - .data = &spl_console_ratelimit, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_dointvec, - }, - { - .procname = "console_max_delay_centisecs", - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_console_max_delay_cs, - }, - { - .procname = "console_min_delay_centisecs", - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_console_min_delay_cs, - }, - { - .procname = "console_backoff", - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_console_backoff, - }, - { - .procname = "stack_max", - .data = &spl_debug_stack, - .maxlen = sizeof(int), - .mode = 0444, - .proc_handler = &proc_dointvec, - }, - {0}, -}; -#endif /* DEBUG_LOG */ - #ifdef DEBUG_KMEM static struct ctl_table spl_kmem_table[] = { { @@ -765,13 +448,6 @@ static struct ctl_table spl_table[] = { .mode = 0644, .proc_handler = &proc_dohostid, }, -#ifdef DEBUG_LOG - { - .procname = "debug", - .mode = 0555, - .child = spl_debug_table, - }, -#endif #ifdef DEBUG_KMEM { .procname = "kmem", @@ -812,31 +488,38 @@ int spl_proc_init(void) { int rc = 0; - SENTRY; spl_header = register_sysctl_table(spl_root); if (spl_header == NULL) - SRETURN(-EUNATCH); + return (-EUNATCH); proc_spl = proc_mkdir("spl", NULL); - if (proc_spl == NULL) - SGOTO(out, rc = -EUNATCH); + if (proc_spl == NULL) { + rc = -EUNATCH; + goto out; + } #ifdef DEBUG_KMEM proc_spl_kmem = proc_mkdir("kmem", proc_spl); - if (proc_spl_kmem == NULL) - SGOTO(out, rc = -EUNATCH); + if (proc_spl_kmem == NULL) { + rc = -EUNATCH; + goto out; + } proc_spl_kmem_slab = proc_create_data("slab", 0444, proc_spl_kmem, &proc_slab_operations, NULL); - if (proc_spl_kmem_slab == NULL) - SGOTO(out, rc = -EUNATCH); + if (proc_spl_kmem_slab == NULL) { + rc = -EUNATCH; + goto out; + } #endif /* DEBUG_KMEM */ proc_spl_kstat = proc_mkdir("kstat", proc_spl); - if (proc_spl_kstat == NULL) - SGOTO(out, rc = -EUNATCH); + if (proc_spl_kstat == NULL) { + rc = -EUNATCH; + goto out; + } out: if (rc) { remove_proc_entry("kstat", proc_spl); @@ -848,14 +531,12 @@ out: unregister_sysctl_table(spl_header); } - SRETURN(rc); + return (rc); } void spl_proc_fini(void) { - SENTRY; - remove_proc_entry("kstat", proc_spl); #ifdef DEBUG_KMEM remove_proc_entry("slab", proc_spl_kmem); @@ -865,6 +546,4 @@ spl_proc_fini(void) ASSERT(spl_header != NULL); unregister_sysctl_table(spl_header); - - SEXIT; } diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 0cb2ceeaf..951298d9f 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -26,13 +26,6 @@ #include #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_TASKQ int spl_taskq_thread_bind = 0; module_param(spl_taskq_thread_bind, int, 0644); @@ -63,7 +56,6 @@ task_alloc(taskq_t *tq, uint_t flags) { taskq_ent_t *t; int count = 0; - SENTRY; ASSERT(tq); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -77,17 +69,17 @@ retry: ASSERT(!timer_pending(&t->tqent_timer)); list_del_init(&t->tqent_list); - SRETURN(t); + return (t); } /* Free list is empty and memory allocations are prohibited */ if (flags & TQ_NOALLOC) - SRETURN(NULL); + return (NULL); /* Hit maximum taskq_ent_t pool size */ if (tq->tq_nalloc >= tq->tq_maxalloc) { if (flags & TQ_NOSLEEP) - SRETURN(NULL); + return (NULL); /* * Sleep periodically polling the free list for an available @@ -103,8 +95,10 @@ retry: spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); schedule_timeout(HZ / 100); spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); - if (count < 100) - SGOTO(retry, count++); + if (count < 100) { + count++; + goto retry; + } } spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); @@ -116,7 +110,7 @@ retry: tq->tq_nalloc++; } - SRETURN(t); + return (t); } /* @@ -126,8 +120,6 @@ retry: static void task_free(taskq_t *tq, taskq_ent_t *t) { - SENTRY; - ASSERT(tq); ASSERT(t); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -136,8 +128,6 @@ task_free(taskq_t *tq, taskq_ent_t *t) kmem_free(t, sizeof(taskq_ent_t)); tq->tq_nalloc--; - - SEXIT; } /* @@ -147,7 +137,6 @@ task_free(taskq_t *tq, taskq_ent_t *t) static void task_done(taskq_t *tq, taskq_ent_t *t) { - SENTRY; ASSERT(tq); ASSERT(t); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -167,8 +156,6 @@ task_done(taskq_t *tq, taskq_ent_t *t) } else { task_free(tq, t); } - - SEXIT; } /* @@ -222,7 +209,6 @@ taskq_lowest_id(taskq_t *tq) taskqid_t lowest_id = tq->tq_next_id; taskq_ent_t *t; taskq_thread_t *tqt; - SENTRY; ASSERT(tq); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -249,7 +235,7 @@ taskq_lowest_id(taskq_t *tq) lowest_id = MIN(lowest_id, tqt->tqt_id); } - SRETURN(lowest_id); + return (lowest_id); } /* @@ -261,7 +247,6 @@ taskq_insert_in_order(taskq_t *tq, taskq_thread_t *tqt) taskq_thread_t *w; struct list_head *l; - SENTRY; ASSERT(tq); ASSERT(tqt); ASSERT(spin_is_locked(&tq->tq_lock)); @@ -275,8 +260,6 @@ taskq_insert_in_order(taskq_t *tq, taskq_thread_t *tqt) } if (l == &tq->tq_active_list) list_add(&tqt->tqt_active_list, &tq->tq_active_list); - - SEXIT; } /* @@ -288,7 +271,6 @@ taskq_find_list(taskq_t *tq, struct list_head *lh, taskqid_t id) { struct list_head *l; taskq_ent_t *t; - SENTRY; ASSERT(spin_is_locked(&tq->tq_lock)); @@ -296,13 +278,13 @@ taskq_find_list(taskq_t *tq, struct list_head *lh, taskqid_t id) t = list_entry(l, taskq_ent_t, tqent_list); if (t->tqent_id == id) - SRETURN(t); + return (t); if (t->tqent_id > id) break; } - SRETURN(NULL); + return (NULL); } /* @@ -317,33 +299,32 @@ taskq_find(taskq_t *tq, taskqid_t id, int *active) taskq_thread_t *tqt; struct list_head *l; taskq_ent_t *t; - SENTRY; ASSERT(spin_is_locked(&tq->tq_lock)); *active = 0; t = taskq_find_list(tq, &tq->tq_delay_list, id); if (t) - SRETURN(t); + return (t); t = taskq_find_list(tq, &tq->tq_prio_list, id); if (t) - SRETURN(t); + return (t); t = taskq_find_list(tq, &tq->tq_pend_list, id); if (t) - SRETURN(t); + return (t); list_for_each(l, &tq->tq_active_list) { tqt = list_entry(l, taskq_thread_t, tqt_active_list); if (tqt->tqt_id == id) { t = tqt->tqt_task; *active = 1; - SRETURN(t); + return (t); } } - SRETURN(NULL); + return (NULL); } static int @@ -405,7 +386,7 @@ taskq_wait_check(taskq_t *tq, taskqid_t id) rc = (id < tq->tq_lowest_id); spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - SRETURN(rc); + return (rc); } void @@ -419,7 +400,7 @@ void taskq_wait(taskq_t *tq) { taskqid_t id; - SENTRY; + ASSERT(tq); /* Wait for the largest outstanding taskqid */ @@ -428,9 +409,6 @@ taskq_wait(taskq_t *tq) spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); taskq_wait_all(tq, id); - - SEXIT; - } EXPORT_SYMBOL(taskq_wait); @@ -439,7 +417,6 @@ taskq_member(taskq_t *tq, void *t) { struct list_head *l; taskq_thread_t *tqt; - SENTRY; ASSERT(tq); ASSERT(t); @@ -447,10 +424,10 @@ taskq_member(taskq_t *tq, void *t) list_for_each(l, &tq->tq_thread_list) { tqt = list_entry(l, taskq_thread_t, tqt_thread_list); if (tqt->tqt_thread == (struct task_struct *)t) - SRETURN(1); + return (1); } - SRETURN(0); + return (0); } EXPORT_SYMBOL(taskq_member); @@ -466,7 +443,6 @@ taskq_cancel_id(taskq_t *tq, taskqid_t id) taskq_ent_t *t; int active = 0; int rc = ENOENT; - SENTRY; ASSERT(tq); @@ -507,7 +483,7 @@ taskq_cancel_id(taskq_t *tq, taskqid_t id) rc = EBUSY; } - SRETURN(rc); + return (rc); } EXPORT_SYMBOL(taskq_cancel_id); @@ -516,7 +492,6 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) { taskq_ent_t *t; taskqid_t rc = 0; - SENTRY; ASSERT(tq); ASSERT(func); @@ -525,15 +500,15 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) /* Taskq being destroyed and all tasks drained */ if (!(tq->tq_flags & TQ_ACTIVE)) - SGOTO(out, rc = 0); + goto out; /* Do not queue the task unless there is idle thread for it */ ASSERT(tq->tq_nactive <= tq->tq_nthreads); if ((flags & TQ_NOQUEUE) && (tq->tq_nactive == tq->tq_nthreads)) - SGOTO(out, rc = 0); + goto out; if ((t = task_alloc(tq, flags)) == NULL) - SGOTO(out, rc = 0); + goto out; spin_lock(&t->tqent_lock); @@ -559,7 +534,7 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) wake_up(&tq->tq_work_waitq); out: spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - SRETURN(rc); + return (rc); } EXPORT_SYMBOL(taskq_dispatch); @@ -567,9 +542,8 @@ taskqid_t taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg, uint_t flags, clock_t expire_time) { - taskq_ent_t *t; taskqid_t rc = 0; - SENTRY; + taskq_ent_t *t; ASSERT(tq); ASSERT(func); @@ -578,10 +552,10 @@ taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg, /* Taskq being destroyed and all tasks drained */ if (!(tq->tq_flags & TQ_ACTIVE)) - SGOTO(out, rc = 0); + goto out; if ((t = task_alloc(tq, flags)) == NULL) - SGOTO(out, rc = 0); + goto out; spin_lock(&t->tqent_lock); @@ -603,7 +577,7 @@ taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg, spin_unlock(&t->tqent_lock); out: spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - SRETURN(rc); + return (rc); } EXPORT_SYMBOL(taskq_dispatch_delay); @@ -611,8 +585,6 @@ void taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags, taskq_ent_t *t) { - SENTRY; - ASSERT(tq); ASSERT(func); ASSERT(!(tq->tq_flags & TASKQ_DYNAMIC)); @@ -650,7 +622,6 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags, wake_up(&tq->tq_work_waitq); out: spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - SEXIT; } EXPORT_SYMBOL(taskq_dispatch_ent); @@ -685,7 +656,6 @@ taskq_thread(void *args) taskq_t *tq; taskq_ent_t *t; struct list_head *pend_list; - SENTRY; ASSERT(tqt); tq = tqt->tqt_tq; @@ -778,7 +748,7 @@ taskq_thread(void *args) spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - SRETURN(0); + return (0); } taskq_t * @@ -789,7 +759,6 @@ taskq_create(const char *name, int nthreads, pri_t pri, taskq_t *tq; taskq_thread_t *tqt; int rc = 0, i, j = 0; - SENTRY; ASSERT(name != NULL); ASSERT(pri <= maxclsyspri); @@ -808,7 +777,7 @@ taskq_create(const char *name, int nthreads, pri_t pri, tq = kmem_alloc(sizeof(*tq), KM_PUSHPAGE); if (tq == NULL) - SRETURN(NULL); + return (NULL); spin_lock_init(&tq->tq_lock); spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); @@ -869,7 +838,7 @@ taskq_create(const char *name, int nthreads, pri_t pri, tq = NULL; } - SRETURN(tq); + return (tq); } EXPORT_SYMBOL(taskq_create); @@ -879,7 +848,6 @@ taskq_destroy(taskq_t *tq) struct task_struct *thread; taskq_thread_t *tqt; taskq_ent_t *t; - SENTRY; ASSERT(tq); spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); @@ -929,30 +897,24 @@ taskq_destroy(taskq_t *tq) spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); kmem_free(tq, sizeof(taskq_t)); - - SEXIT; } EXPORT_SYMBOL(taskq_destroy); int spl_taskq_init(void) { - SENTRY; - /* Solaris creates a dynamic taskq of up to 64 threads, however in * a Linux environment 1 thread per-core is usually about right */ system_taskq = taskq_create("spl_system_taskq", num_online_cpus(), minclsyspri, 4, 512, TASKQ_PREPOPULATE); if (system_taskq == NULL) - SRETURN(1); + return (1); - SRETURN(0); + return (0); } void spl_taskq_fini(void) { - SENTRY; taskq_destroy(system_taskq); - SEXIT; } diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index 5c8514051..b0f4d5715 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -27,13 +27,6 @@ #include #include #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_THREAD /* * Thread interfaces @@ -73,8 +66,6 @@ thread_generic_wrapper(void *arg) void __thread_exit(void) { - SENTRY; - SEXIT; tsd_exit(); complete_and_exit(NULL, 0); /* Unreachable */ @@ -92,7 +83,6 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, thread_priv_t *tp; struct task_struct *tsk; char *p; - SENTRY; /* Option pp is simply ignored */ /* Variable stack size unsupported */ @@ -100,7 +90,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tp = kmem_alloc(sizeof(thread_priv_t), KM_PUSHPAGE); if (tp == NULL) - SRETURN(NULL); + return (NULL); tp->tp_magic = TP_MAGIC; tp->tp_name_size = strlen(name) + 1; @@ -108,7 +98,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tp->tp_name = kmem_alloc(tp->tp_name_size, KM_PUSHPAGE); if (tp->tp_name == NULL) { kmem_free(tp, sizeof(thread_priv_t)); - SRETURN(NULL); + return (NULL); } strncpy(tp->tp_name, name, tp->tp_name_size); @@ -128,13 +118,11 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tsk = spl_kthread_create(thread_generic_wrapper, (void *)tp, "%s", tp->tp_name); - if (IS_ERR(tsk)) { - SERROR("Failed to create thread: %ld\n", PTR_ERR(tsk)); - SRETURN(NULL); - } + if (IS_ERR(tsk)) + return (NULL); wake_up_process(tsk); - SRETURN((kthread_t *)tsk); + return ((kthread_t *)tsk); } EXPORT_SYMBOL(__thread_create); diff --git a/module/spl/spl-tsd.c b/module/spl/spl-tsd.c index 6e5605b9d..c9d532f4e 100644 --- a/module/spl/spl-tsd.c +++ b/module/spl/spl-tsd.c @@ -61,14 +61,6 @@ #include #include #include -#include - -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM -#endif - -#define DEBUG_SUBSYSTEM SS_TSD -#define DEBUG_SUBSYSTEM SS_TSD typedef struct tsd_hash_bin { spinlock_t hb_lock; @@ -108,7 +100,6 @@ tsd_hash_search(tsd_hash_table_t *table, uint_t key, pid_t pid) tsd_hash_entry_t *entry; tsd_hash_bin_t *bin; ulong_t hash; - SENTRY; hash = hash_long((ulong_t)key * (ulong_t)pid, table->ht_bits); bin = &table->ht_bins[hash]; @@ -117,12 +108,12 @@ tsd_hash_search(tsd_hash_table_t *table, uint_t key, pid_t pid) entry = list_entry(node, tsd_hash_entry_t, he_list); if ((entry->he_key == key) && (entry->he_pid == pid)) { spin_unlock(&bin->hb_lock); - SRETURN(entry); + return (entry); } } spin_unlock(&bin->hb_lock); - SRETURN(NULL); + return (NULL); } /* @@ -136,7 +127,6 @@ static void tsd_hash_dtor(struct hlist_head *work) { tsd_hash_entry_t *entry; - SENTRY; while (!hlist_empty(work)) { entry = hlist_entry(work->first, tsd_hash_entry_t, he_list); @@ -147,8 +137,6 @@ tsd_hash_dtor(struct hlist_head *work) kmem_free(entry, sizeof(tsd_hash_entry_t)); } - - SEXIT; } /* @@ -170,14 +158,13 @@ tsd_hash_add(tsd_hash_table_t *table, uint_t key, pid_t pid, void *value) tsd_hash_bin_t *bin; ulong_t hash; int rc = 0; - SENTRY; ASSERT3P(tsd_hash_search(table, key, pid), ==, NULL); /* New entry allocate structure, set value, and add to hash */ entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE); if (entry == NULL) - SRETURN(ENOMEM); + return (ENOMEM); entry->he_key = key; entry->he_pid = pid; @@ -209,7 +196,7 @@ tsd_hash_add(tsd_hash_table_t *table, uint_t key, pid_t pid, void *value) spin_unlock(&bin->hb_lock); spin_unlock(&table->ht_lock); - SRETURN(rc); + return (rc); } /* @@ -230,14 +217,13 @@ tsd_hash_add_key(tsd_hash_table_t *table, uint_t *keyp, dtor_func_t dtor) tsd_hash_bin_t *bin; ulong_t hash; int keys_checked = 0; - SENTRY; ASSERT3P(table, !=, NULL); /* Allocate entry to be used as a destructor for this key */ entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE); if (entry == NULL) - SRETURN(ENOMEM); + return (ENOMEM); /* Determine next available key value */ spin_lock(&table->ht_lock); @@ -249,7 +235,7 @@ tsd_hash_add_key(tsd_hash_table_t *table, uint_t *keyp, dtor_func_t dtor) /* Ensure failure when all TSD_KEYS_MAX keys are in use */ if (keys_checked++ >= TSD_KEYS_MAX) { spin_unlock(&table->ht_lock); - SRETURN(ENOENT); + return (ENOENT); } tmp_entry = tsd_hash_search(table, table->ht_key, DTOR_PID); @@ -273,7 +259,7 @@ tsd_hash_add_key(tsd_hash_table_t *table, uint_t *keyp, dtor_func_t dtor) spin_unlock(&bin->hb_lock); spin_unlock(&table->ht_lock); - SRETURN(0); + return (0); } /* @@ -291,12 +277,11 @@ tsd_hash_add_pid(tsd_hash_table_t *table, pid_t pid) tsd_hash_entry_t *entry; tsd_hash_bin_t *bin; ulong_t hash; - SENTRY; /* Allocate entry to be used as the process reference */ entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE); if (entry == NULL) - SRETURN(ENOMEM); + return (ENOMEM); spin_lock(&table->ht_lock); entry->he_key = PID_KEY; @@ -316,7 +301,7 @@ tsd_hash_add_pid(tsd_hash_table_t *table, pid_t pid) spin_unlock(&bin->hb_lock); spin_unlock(&table->ht_lock); - SRETURN(0); + return (0); } /* @@ -328,14 +313,10 @@ tsd_hash_add_pid(tsd_hash_table_t *table, pid_t pid) static void tsd_hash_del(tsd_hash_table_t *table, tsd_hash_entry_t *entry) { - SENTRY; - ASSERT(spin_is_locked(&table->ht_lock)); hlist_del(&entry->he_list); list_del_init(&entry->he_key_list); list_del_init(&entry->he_pid_list); - - SEXIT; } /* @@ -350,17 +331,16 @@ tsd_hash_table_init(uint_t bits) { tsd_hash_table_t *table; int hash, size = (1 << bits); - SENTRY; table = kmem_zalloc(sizeof(tsd_hash_table_t), KM_SLEEP); if (table == NULL) - SRETURN(NULL); + return (NULL); table->ht_bins = kmem_zalloc(sizeof(tsd_hash_bin_t) * size, KM_SLEEP | KM_NODEBUG); if (table->ht_bins == NULL) { kmem_free(table, sizeof(tsd_hash_table_t)); - SRETURN(NULL); + return (NULL); } for (hash = 0; hash < size; hash++) { @@ -372,7 +352,7 @@ tsd_hash_table_init(uint_t bits) table->ht_bits = bits; table->ht_key = 1; - SRETURN(table); + return (table); } /* @@ -390,7 +370,6 @@ tsd_hash_table_fini(tsd_hash_table_t *table) tsd_hash_bin_t *bin; tsd_hash_entry_t *entry; int size, i; - SENTRY; ASSERT3P(table, !=, NULL); spin_lock(&table->ht_lock); @@ -410,8 +389,6 @@ tsd_hash_table_fini(tsd_hash_table_t *table) tsd_hash_dtor(&work); kmem_free(table->ht_bins, sizeof(tsd_hash_bin_t)*(1<ht_bits)); kmem_free(table, sizeof(tsd_hash_table_t)); - - SEXIT; } /* @@ -432,20 +409,19 @@ tsd_set(uint_t key, void *value) tsd_hash_entry_t *entry; pid_t pid; int rc; - SENTRY; table = tsd_hash_table; pid = curthread->pid; ASSERT3P(table, !=, NULL); if ((key == 0) || (key > TSD_KEYS_MAX)) - SRETURN(EINVAL); + return (EINVAL); /* Entry already exists in hash table update value */ entry = tsd_hash_search(table, key, pid); if (entry) { entry->he_value = value; - SRETURN(0); + return (0); } /* Add a process entry to the hash if not yet exists */ @@ -453,11 +429,11 @@ tsd_set(uint_t key, void *value) if (entry == NULL) { rc = tsd_hash_add_pid(table, pid); if (rc) - SRETURN(rc); + return (rc); } rc = tsd_hash_add(table, key, pid, value); - SRETURN(rc); + return (rc); } EXPORT_SYMBOL(tsd_set); @@ -473,18 +449,17 @@ void * tsd_get(uint_t key) { tsd_hash_entry_t *entry; - SENTRY; ASSERT3P(tsd_hash_table, !=, NULL); if ((key == 0) || (key > TSD_KEYS_MAX)) - SRETURN(NULL); + return (NULL); entry = tsd_hash_search(tsd_hash_table, key, curthread->pid); if (entry == NULL) - SRETURN(NULL); + return (NULL); - SRETURN(entry->he_value); + return (entry->he_value); } EXPORT_SYMBOL(tsd_get); @@ -503,17 +478,11 @@ EXPORT_SYMBOL(tsd_get); void tsd_create(uint_t *keyp, dtor_func_t dtor) { - SENTRY; - ASSERT3P(keyp, !=, NULL); - if (*keyp) { - SEXIT; + if (*keyp) return; - } (void)tsd_hash_add_key(tsd_hash_table, keyp, dtor); - - SEXIT; } EXPORT_SYMBOL(tsd_create); @@ -534,7 +503,6 @@ tsd_destroy(uint_t *keyp) tsd_hash_entry_t *dtor_entry, *entry; tsd_hash_bin_t *dtor_entry_bin, *entry_bin; ulong_t hash; - SENTRY; table = tsd_hash_table; ASSERT3P(table, !=, NULL); @@ -543,7 +511,6 @@ tsd_destroy(uint_t *keyp) dtor_entry = tsd_hash_search(table, *keyp, DTOR_PID); if (dtor_entry == NULL) { spin_unlock(&table->ht_lock); - SEXIT; return; } @@ -580,8 +547,6 @@ tsd_destroy(uint_t *keyp) tsd_hash_dtor(&work); *keyp = 0; - - SEXIT; } EXPORT_SYMBOL(tsd_destroy); @@ -601,7 +566,6 @@ tsd_exit(void) tsd_hash_entry_t *pid_entry, *entry; tsd_hash_bin_t *pid_entry_bin, *entry_bin; ulong_t hash; - SENTRY; table = tsd_hash_table; ASSERT3P(table, !=, NULL); @@ -610,7 +574,6 @@ tsd_exit(void) pid_entry = tsd_hash_search(table, PID_KEY, curthread->pid); if (pid_entry == NULL) { spin_unlock(&table->ht_lock); - SEXIT; return; } @@ -646,28 +609,22 @@ tsd_exit(void) spin_unlock(&table->ht_lock); tsd_hash_dtor(&work); - - SEXIT; } EXPORT_SYMBOL(tsd_exit); int spl_tsd_init(void) { - SENTRY; - tsd_hash_table = tsd_hash_table_init(TSD_HASH_TABLE_BITS_DEFAULT); if (tsd_hash_table == NULL) - SRETURN(1); + return (1); - SRETURN(0); + return (0); } void spl_tsd_fini(void) { - SENTRY; tsd_hash_table_fini(tsd_hash_table); tsd_hash_table = NULL; - SEXIT; } diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index b9f9d7b1f..cac0aaf29 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -27,13 +27,6 @@ #include #include #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_VNODE vnode_t *rootdir = (vnode_t *)0xabcd1234; EXPORT_SYMBOL(rootdir); @@ -107,7 +100,6 @@ vnode_t * vn_alloc(int flag) { vnode_t *vp; - SENTRY; vp = kmem_cache_alloc(vn_cache, flag); if (vp != NULL) { @@ -115,16 +107,14 @@ vn_alloc(int flag) vp->v_type = 0; } - SRETURN(vp); + return (vp); } /* vn_alloc() */ EXPORT_SYMBOL(vn_alloc); void vn_free(vnode_t *vp) { - SENTRY; kmem_cache_free(vn_cache, vp); - SEXIT; } /* vn_free() */ EXPORT_SYMBOL(vn_free); @@ -137,7 +127,6 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, int rc, saved_umask = 0; gfp_t saved_gfp; vnode_t *vp; - SENTRY; ASSERT(flags & (FWRITE | FREAD)); ASSERT(seg == UIO_SYSSPACE); @@ -163,7 +152,7 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, (void)xchg(¤t->fs->umask, saved_umask); if (IS_ERR(fp)) - SRETURN(-PTR_ERR(fp)); + return (-PTR_ERR(fp)); #ifdef HAVE_2ARGS_VFS_GETATTR rc = vfs_getattr(&fp->f_path, &stat); @@ -172,13 +161,13 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, #endif if (rc) { filp_close(fp, 0); - SRETURN(-rc); + return (-rc); } vp = vn_alloc(KM_SLEEP); if (!vp) { filp_close(fp, 0); - SRETURN(ENOMEM); + return (ENOMEM); } saved_gfp = mapping_gfp_mask(fp->f_mapping); @@ -191,7 +180,7 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, *vpp = vp; mutex_exit(&vp->v_lock); - SRETURN(0); + return (0); } /* vn_open() */ EXPORT_SYMBOL(vn_open); @@ -201,20 +190,19 @@ vn_openat(const char *path, uio_seg_t seg, int flags, int mode, { char *realpath; int len, rc; - SENTRY; ASSERT(vp == rootdir); len = strlen(path) + 2; realpath = kmalloc(len, GFP_KERNEL); if (!realpath) - SRETURN(ENOMEM); + return (ENOMEM); (void)snprintf(realpath, len, "/%s", path); rc = vn_open(realpath, seg, flags, mode, vpp, x1, x2); kfree(realpath); - SRETURN(rc); + return (rc); } /* vn_openat() */ EXPORT_SYMBOL(vn_openat); @@ -226,7 +214,6 @@ vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off, mm_segment_t saved_fs; struct file *fp; int rc; - SENTRY; ASSERT(uio == UIO_WRITE || uio == UIO_READ); ASSERT(vp); @@ -256,16 +243,16 @@ vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off, fp->f_pos = offset; if (rc < 0) - SRETURN(-rc); + return (-rc); if (residp) { *residp = len - rc; } else { if (rc != len) - SRETURN(EIO); + return (EIO); } - SRETURN(0); + return (0); } /* vn_rdwr() */ EXPORT_SYMBOL(vn_rdwr); @@ -273,7 +260,6 @@ int vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4) { int rc; - SENTRY; ASSERT(vp); ASSERT(vp->v_file); @@ -282,7 +268,7 @@ vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4) rc = filp_close(vp->v_file, 0); vn_free(vp); - SRETURN(-rc); + return (-rc); } /* vn_close() */ EXPORT_SYMBOL(vn_close); @@ -386,7 +372,6 @@ vn_remove(const char *path, uio_seg_t seg, int flags) struct path parent; struct inode *inode = NULL; int rc = 0; - SENTRY; ASSERT(seg == UIO_SYSSPACE); ASSERT(flags == RMFILE); @@ -394,14 +379,18 @@ vn_remove(const char *path, uio_seg_t seg, int flags) dentry = spl_kern_path_locked(path, &parent); rc = PTR_ERR(dentry); if (!IS_ERR(dentry)) { - if (parent.dentry->d_name.name[parent.dentry->d_name.len]) - SGOTO(slashes, rc = 0); + if (parent.dentry->d_name.name[parent.dentry->d_name.len]) { + rc = 0; + goto slashes; + } inode = dentry->d_inode; - if (inode) + if (inode) { atomic_inc(&inode->i_count); - else - SGOTO(slashes, rc = 0); + } else { + rc = 0; + goto slashes; + } #ifdef HAVE_2ARGS_VFS_UNLINK rc = vfs_unlink(parent.dentry->d_inode, dentry); @@ -419,12 +408,12 @@ exit1: iput(inode); /* truncate the inode here */ path_put(&parent); - SRETURN(-rc); + return (-rc); slashes: rc = !dentry->d_inode ? -ENOENT : S_ISDIR(dentry->d_inode->i_mode) ? -EISDIR : -ENOTDIR; - SGOTO(exit1, rc); + goto exit1; } /* vn_remove() */ EXPORT_SYMBOL(vn_remove); @@ -437,23 +426,26 @@ vn_rename(const char *oldname, const char *newname, int x1) struct dentry *trap; struct path old_parent, new_parent; int rc = 0; - SENTRY; old_dentry = spl_kern_path_locked(oldname, &old_parent); - if (IS_ERR(old_dentry)) - SGOTO(exit, rc = PTR_ERR(old_dentry)); + if (IS_ERR(old_dentry)) { + rc = PTR_ERR(old_dentry); + goto exit; + } spl_inode_unlock(old_parent.dentry->d_inode); new_dentry = spl_kern_path_locked(newname, &new_parent); - if (IS_ERR(new_dentry)) - SGOTO(exit2, rc = PTR_ERR(new_dentry)); + if (IS_ERR(new_dentry)) { + rc = PTR_ERR(new_dentry); + goto exit2; + } spl_inode_unlock(new_parent.dentry->d_inode); rc = -EXDEV; if (old_parent.mnt != new_parent.mnt) - SGOTO(exit3, rc); + goto exit3; old_dir = old_parent.dentry; new_dir = new_parent.dentry; @@ -462,25 +454,25 @@ vn_rename(const char *oldname, const char *newname, int x1) /* source should not be ancestor of target */ rc = -EINVAL; if (old_dentry == trap) - SGOTO(exit4, rc); + goto exit4; /* target should not be an ancestor of source */ rc = -ENOTEMPTY; if (new_dentry == trap) - SGOTO(exit4, rc); + goto exit4; /* source must exist */ rc = -ENOENT; if (!old_dentry->d_inode) - SGOTO(exit4, rc); + goto exit4; /* unless the source is a directory trailing slashes give -ENOTDIR */ if (!S_ISDIR(old_dentry->d_inode->i_mode)) { rc = -ENOTDIR; if (old_dentry->d_name.name[old_dentry->d_name.len]) - SGOTO(exit4, rc); + goto exit4; if (new_dentry->d_name.name[new_dentry->d_name.len]) - SGOTO(exit4, rc); + goto exit4; } #if defined(HAVE_4ARGS_VFS_RENAME) @@ -502,7 +494,7 @@ exit2: dput(old_dentry); path_put(&old_parent); exit: - SRETURN(-rc); + return (-rc); } EXPORT_SYMBOL(vn_rename); @@ -512,7 +504,6 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) struct file *fp; struct kstat stat; int rc; - SENTRY; ASSERT(vp); ASSERT(vp->v_file); @@ -526,7 +517,7 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) rc = vfs_getattr(fp->f_path.mnt, fp->f_dentry, &stat); #endif if (rc) - SRETURN(-rc); + return (-rc); vap->va_type = vn_mode_to_vtype(stat.mode); vap->va_mode = stat.mode; @@ -543,14 +534,13 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) vap->va_rdev = stat.rdev; vap->va_nblocks = stat.blocks; - SRETURN(0); + return (0); } EXPORT_SYMBOL(vn_getattr); int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4) { int datasync = 0; - SENTRY; ASSERT(vp); ASSERT(vp->v_file); @@ -558,7 +548,7 @@ int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4) if (flags & FDSYNC) datasync = 1; - SRETURN(-spl_filp_fsync(vp->v_file, datasync)); + return (-spl_filp_fsync(vp->v_file, datasync)); } /* vn_fsync() */ EXPORT_SYMBOL(vn_fsync); @@ -566,10 +556,9 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag, offset_t offset, void *x6, void *x7) { int error = EOPNOTSUPP; - SENTRY; if (cmd != F_FREESP || bfp->l_whence != 0) - SRETURN(EOPNOTSUPP); + return (EOPNOTSUPP); ASSERT(vp); ASSERT(vp->v_file); @@ -584,7 +573,7 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, bfp->l_start, bfp->l_len); if (error == 0) - SRETURN(0); + return (0); #endif #ifdef HAVE_INODE_TRUNCATE_RANGE @@ -600,7 +589,7 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag, if (end % PAGE_SIZE != 0) { end &= ~(off_t)(PAGE_SIZE - 1); if (end <= bfp->l_start) - SRETURN(0); + return (0); } --end; @@ -608,11 +597,11 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag, vp->v_file->f_dentry->d_inode, bfp->l_start, end ); - SRETURN(0); + return (0); } #endif - SRETURN(error); + return (error); } EXPORT_SYMBOL(vn_space); @@ -642,7 +631,6 @@ vn_getf(int fd) file_t *fp; vnode_t *vp; int rc = 0; - SENTRY; /* Already open just take an extra reference */ spin_lock(&vn_file_lock); @@ -651,7 +639,7 @@ vn_getf(int fd) if (fp) { atomic_inc(&fp->f_ref); spin_unlock(&vn_file_lock); - SRETURN(fp); + return (fp); } spin_unlock(&vn_file_lock); @@ -659,7 +647,7 @@ vn_getf(int fd) /* File was not yet opened create the object and setup */ fp = kmem_cache_alloc(vn_file_cache, KM_SLEEP); if (fp == NULL) - SGOTO(out, rc); + goto out; mutex_enter(&fp->f_lock); @@ -670,11 +658,11 @@ vn_getf(int fd) lfp = fget(fd); if (lfp == NULL) - SGOTO(out_mutex, rc); + goto out_mutex; vp = vn_alloc(KM_SLEEP); if (vp == NULL) - SGOTO(out_fget, rc); + goto out_fget; #ifdef HAVE_2ARGS_VFS_GETATTR rc = vfs_getattr(&lfp->f_path, &stat); @@ -682,7 +670,7 @@ vn_getf(int fd) rc = vfs_getattr(lfp->f_path.mnt, lfp->f_dentry, &stat); #endif if (rc) - SGOTO(out_vnode, rc); + goto out_vnode; mutex_enter(&vp->v_lock); vp->v_type = vn_mode_to_vtype(stat.mode); @@ -698,7 +686,7 @@ vn_getf(int fd) spin_unlock(&vn_file_lock); mutex_exit(&fp->f_lock); - SRETURN(fp); + return (fp); out_vnode: vn_free(vp); @@ -708,7 +696,7 @@ out_mutex: mutex_exit(&fp->f_lock); kmem_cache_free(vn_file_cache, fp); out: - SRETURN(NULL); + return (NULL); } /* getf() */ EXPORT_SYMBOL(getf); @@ -728,7 +716,6 @@ void vn_releasef(int fd) { file_t *fp; - SENTRY; spin_lock(&vn_file_lock); fp = file_find(fd); @@ -736,7 +723,6 @@ vn_releasef(int fd) atomic_dec(&fp->f_ref); if (atomic_read(&fp->f_ref) > 0) { spin_unlock(&vn_file_lock); - SEXIT; return; } @@ -745,7 +731,6 @@ vn_releasef(int fd) } spin_unlock(&vn_file_lock); - SEXIT; return; } /* releasef() */ EXPORT_SYMBOL(releasef); @@ -783,7 +768,6 @@ vn_set_pwd(const char *filename) struct path path; mm_segment_t saved_fs; int rc; - SENTRY; /* * user_path_dir() and __user_walk() both expect 'filename' to be @@ -795,11 +779,11 @@ vn_set_pwd(const char *filename) rc = user_path_dir(filename, &path); if (rc) - SGOTO(out, rc); + goto out; rc = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); if (rc) - SGOTO(dput_and_out, rc); + goto dput_and_out; vn_set_fs_pwd(current->fs, &path); @@ -808,7 +792,7 @@ dput_and_out: out: set_fs(saved_fs); - SRETURN(-rc); + return (-rc); } /* vn_set_pwd() */ EXPORT_SYMBOL(vn_set_pwd); @@ -853,7 +837,6 @@ vn_file_cache_destructor(void *buf, void *cdrarg) int spl_vn_init(void) { - SENTRY; vn_cache = kmem_cache_create("spl_vn_cache", sizeof(struct vnode), 64, vn_cache_constructor, @@ -865,7 +848,7 @@ spl_vn_init(void) vn_file_cache_constructor, vn_file_cache_destructor, NULL, NULL, NULL, KMC_KMEM); - SRETURN(0); + return (0); } /* vn_init() */ void @@ -873,7 +856,6 @@ spl_vn_fini(void) { file_t *fp, *next_fp; int leaked = 0; - SENTRY; spin_lock(&vn_file_lock); @@ -886,11 +868,10 @@ spl_vn_fini(void) spin_unlock(&vn_file_lock); if (leaked > 0) - SWARN("Warning %d files leaked\n", leaked); + printk(KERN_WARNING "WARNING: %d vnode files leaked\n", leaked); kmem_cache_destroy(vn_file_cache); kmem_cache_destroy(vn_cache); - SEXIT; return; } /* vn_fini() */ diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index 62efa31a5..9405dc88d 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -27,13 +27,6 @@ #include #include #include -#include - -#ifdef SS_DEBUG_SUBSYS -#undef SS_DEBUG_SUBSYS -#endif - -#define SS_DEBUG_SUBSYS SS_XDR /* * SPL's XDR mem implementation. @@ -150,7 +143,6 @@ xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size, xdrs->x_ops = &xdrmem_decode_ops; break; default: - SWARN("Invalid op value: %d\n", op); xdrs->x_ops = NULL; /* Let the caller know we failed */ return; } @@ -160,7 +152,6 @@ xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size, xdrs->x_addr_end = addr + size; if (xdrs->x_addr_end < xdrs->x_addr) { - SWARN("Overflow while creating xdrmem: %p, %u\n", addr, size); xdrs->x_ops = NULL; } } @@ -171,10 +162,8 @@ xdrmem_control(XDR *xdrs, int req, void *info) { struct xdr_bytesrec *rec = (struct xdr_bytesrec *) info; - if (req != XDR_GET_BYTES_AVAIL) { - SWARN("Called with unknown request: %d\n", req); + if (req != XDR_GET_BYTES_AVAIL) return FALSE; - } rec->xc_is_last_record = TRUE; /* always TRUE in xdrmem streams */ rec->xc_num_avail = xdrs->x_addr_end - xdrs->x_addr; diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c index 807e743d5..2b8aab865 100644 --- a/module/spl/spl-zlib.c +++ b/module/spl/spl-zlib.c @@ -55,13 +55,6 @@ #include #include -#include - -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM -#endif - -#define DEBUG_SUBSYSTEM SS_ZLIB static spl_kmem_cache_t *zlib_workspace_cache; @@ -200,7 +193,6 @@ int spl_zlib_init(void) { int size; - SENTRY; size = MAX(spl_zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL), zlib_inflate_workspacesize()); @@ -210,16 +202,14 @@ spl_zlib_init(void) size, 0, NULL, NULL, NULL, NULL, NULL, KMC_VMEM | KMC_NOEMERGENCY); if (!zlib_workspace_cache) - SRETURN(1); + return (1); - SRETURN(0); + return (0); } void spl_zlib_fini(void) { - SENTRY; kmem_cache_destroy(zlib_workspace_cache); zlib_workspace_cache = NULL; - SEXIT; } diff --git a/module/splat/splat-internal.h b/module/splat/splat-internal.h index ea0a88f0c..eff8a9e74 100644 --- a/module/splat/splat-internal.h +++ b/module/splat/splat-internal.h @@ -25,7 +25,6 @@ #ifndef _SPLAT_INTERNAL_H #define _SPLAT_INTERNAL_H -#include "spl-debug.h" #include "splat-ctl.h" #include diff --git a/module/splat/splat-kmem.c b/module/splat/splat-kmem.c index db787ae92..cf47ce65a 100644 --- a/module/splat/splat-kmem.c +++ b/module/splat/splat-kmem.c @@ -313,7 +313,7 @@ splat_kmem_cache_test_kct_alloc(kmem_cache_priv_t *kcp, int id) { kmem_cache_thread_t *kct; - ASSERTF(id < SPLAT_KMEM_THREADS, "id=%d\n", id); + ASSERT3S(id, <, SPLAT_KMEM_THREADS); ASSERT(kcp->kcp_kct[id] == NULL); kct = kmem_zalloc(sizeof(kmem_cache_thread_t), KM_SLEEP); diff --git a/scripts/dkms.mkconf b/scripts/dkms.mkconf index 2fa3dd2b4..67b9dad58 100755 --- a/scripts/dkms.mkconf +++ b/scripts/dkms.mkconf @@ -37,10 +37,6 @@ PRE_BUILD="configure then echo --enable-debug fi - if [[ \${SPL_DKMS_ENABLE_DEBUG_LOG,,} == @(y|yes) ]] - then - echo --enable-debug-log - fi if [[ \${SPL_DKMS_ENABLE_DEBUG_KMEM,,} == @(y|yes) ]] then echo --enable-debug-kmem -- cgit v1.2.3 From 8d5feecacfdcca29336209bdccd6493a5fa53576 Mon Sep 17 00:00:00 2001 From: Olaf Faaland Date: Thu, 23 Feb 2017 09:52:08 -0800 Subject: Linux 4.11 compat: set_task_state() removed Replace uses of set_task_state(current, STATE) with set_current_state(STATE). In Linux 4.11, torvalds/linux@642fa44, set_task_state() is removed. All spl uses are of the form set_task_state(current, STATE). set_current_state(STATE) is equivalent and has been available since Linux 2.2.26. Furthermore, set_current_state(STATE) is already used in about 15 locations within spl. This change should have no impact other than removing an unnecessary dependency. Reviewed-by: Brian Behlendorf Signed-off-by: Olaf Faaland Closes #603 --- module/spl/spl-err.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 14ff8a337..cf9f096b1 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -65,7 +65,7 @@ spl_panic(const char *file, const char *func, int line, const char *fmt, ...) { spl_dumpstack(); /* Halt the thread to facilitate further debugging */ - set_task_state(current, TASK_UNINTERRUPTIBLE); + set_current_state(TASK_UNINTERRUPTIBLE); while (1) schedule(); @@ -98,7 +98,7 @@ vcmn_err(int ce, const char *fmt, va_list ap) spl_dumpstack(); /* Halt the thread to facilitate further debugging */ - set_task_state(current, TASK_UNINTERRUPTIBLE); + set_current_state(TASK_UNINTERRUPTIBLE); while (1) schedule(); } -- cgit v1.2.3 From 410f7ab5943684ef74be0e58ae17d3a0278ad0be Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Wed, 26 Jul 2017 02:03:12 -0400 Subject: Module parameter to enable spl_panic() to panic the kernel In unattended operations it's often more useful to have node panic and reboot when it encounters problems as opposed to sit there indefinitely waiting for somebody to discover it. This implements an spl_panic_crash module parameter, set it to nonzero to cause spl_panic() to call panic(). Reviewed-by: Brian Behlendorf Reviewed-by: Giuseppe Di Natale Signed-off-by: Oleg Drokin Closes #634 --- module/spl/spl-err.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index cf9f096b1..2f66b6e23 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -28,6 +28,17 @@ #include #include +/* + * It is often useful to actually have the panic crash the node so you + * can then get notified of the event, get the crashdump for later + * analysis and other such goodies. + * But we would still default to the current default of not to do that. + */ +unsigned int spl_panic_halt; +module_param(spl_panic_halt, uint, 0644); +MODULE_PARM_DESC(spl_panic_halt, + "Cause kernel panic on assertion failures"); + /* * Limit the number of stack traces dumped to not more than 5 every * 60 seconds to prevent denial-of-service attacks from debug code. @@ -62,6 +73,9 @@ spl_panic(const char *file, const char *func, int line, const char *fmt, ...) { printk(KERN_EMERG "%s", msg); printk(KERN_EMERG "PANIC at %s:%d:%s()\n", newfile, line, func); + if (spl_panic_halt) + panic("%s", msg); + spl_dumpstack(); /* Halt the thread to facilitate further debugging */ -- cgit v1.2.3 From 4b393c50ae0e74b351534030d8b87f1967832d09 Mon Sep 17 00:00:00 2001 From: Olaf Faaland Date: Wed, 4 Oct 2017 12:33:43 -0400 Subject: Make file headers conform to ZFS style standard No semantic changes. Change /************\ and \************/ to /* and */ Signed-off-by: Olaf Faaland --- cmd/splat/splat.c | 4 ++-- cmd/splat/splat.h | 4 ++-- include/fs/fs_subr.h | 4 ++-- include/linux/bitops_compat.h | 4 ++-- include/linux/compiler_compat.h | 4 ++-- include/linux/delay_compat.h | 4 ++-- include/linux/file_compat.h | 4 ++-- include/linux/list_compat.h | 4 ++-- include/linux/math64_compat.h | 4 ++-- include/linux/mm_compat.h | 4 ++-- include/linux/proc_compat.h | 4 ++-- include/linux/rwsem_compat.h | 4 ++-- include/linux/wait_compat.h | 4 ++-- include/linux/zlib_compat.h | 4 ++-- include/rpc/types.h | 4 ++-- include/rpc/xdr.h | 4 ++-- include/sharefs/share.h | 4 ++-- include/spl-ctl.h | 4 ++-- include/splat-ctl.h | 4 ++-- include/strings.h | 4 ++-- include/sys/acl.h | 4 ++-- include/sys/acl_impl.h | 4 ++-- include/sys/atomic.h | 4 ++-- include/sys/attr.h | 4 ++-- include/sys/bitmap.h | 4 ++-- include/sys/bootconf.h | 4 ++-- include/sys/bootprops.h | 4 ++-- include/sys/buf.h | 4 ++-- include/sys/byteorder.h | 4 ++-- include/sys/callb.h | 4 ++-- include/sys/callo.h | 4 ++-- include/sys/cmn_err.h | 4 ++-- include/sys/compress.h | 4 ++-- include/sys/conf.h | 4 ++-- include/sys/console.h | 4 ++-- include/sys/cpupart.h | 4 ++-- include/sys/cpuvar.h | 4 ++-- include/sys/crc32.h | 4 ++-- include/sys/cred.h | 4 ++-- include/sys/ctype.h | 4 ++-- include/sys/ddi.h | 4 ++-- include/sys/debug.h | 4 ++-- include/sys/dirent.h | 4 ++-- include/sys/disp.h | 4 ++-- include/sys/dkio.h | 4 ++-- include/sys/dkioc_free_util.h | 4 ++-- include/sys/dklabel.h | 4 ++-- include/sys/dnlc.h | 4 ++-- include/sys/dumphdr.h | 4 ++-- include/sys/efi_partition.h | 4 ++-- include/sys/errno.h | 4 ++-- include/sys/extdirent.h | 4 ++-- include/sys/fcntl.h | 4 ++-- include/sys/file.h | 4 ++-- include/sys/fm/protocol.h | 4 ++-- include/sys/fm/util.h | 4 ++-- include/sys/fs/swapnode.h | 4 ++-- include/sys/idmap.h | 4 ++-- include/sys/int_limits.h | 4 ++-- include/sys/int_types.h | 4 ++-- include/sys/inttypes.h | 4 ++-- include/sys/isa_defs.h | 4 ++-- include/sys/kidmap.h | 4 ++-- include/sys/kobj.h | 4 ++-- include/sys/kstat.h | 4 ++-- include/sys/list.h | 4 ++-- include/sys/mkdev.h | 4 ++-- include/sys/mntent.h | 4 ++-- include/sys/modctl.h | 4 ++-- include/sys/mode.h | 4 ++-- include/sys/mount.h | 4 ++-- include/sys/note.h | 4 ++-- include/sys/open.h | 4 ++-- include/sys/param.h | 4 ++-- include/sys/pathname.h | 4 ++-- include/sys/policy.h | 4 ++-- include/sys/pool.h | 4 ++-- include/sys/priv_impl.h | 4 ++-- include/sys/proc.h | 4 ++-- include/sys/processor.h | 4 ++-- include/sys/pset.h | 4 ++-- include/sys/random.h | 4 ++-- include/sys/refstr.h | 4 ++-- include/sys/resource.h | 4 ++-- include/sys/rwlock.h | 4 ++-- include/sys/sdt.h | 4 ++-- include/sys/sid.h | 4 ++-- include/sys/signal.h | 4 ++-- include/sys/stat.h | 4 ++-- include/sys/stropts.h | 4 ++-- include/sys/sunddi.h | 4 ++-- include/sys/sunldi.h | 4 ++-- include/sys/sysdc.h | 4 ++-- include/sys/sysevent.h | 4 ++-- include/sys/sysevent/eventdefs.h | 4 ++-- include/sys/sysmacros.h | 4 ++-- include/sys/systeminfo.h | 4 ++-- include/sys/systm.h | 4 ++-- include/sys/t_lock.h | 4 ++-- include/sys/thread.h | 4 ++-- include/sys/time.h | 4 ++-- include/sys/timer.h | 4 ++-- include/sys/tsd.h | 4 ++-- include/sys/types.h | 4 ++-- include/sys/types32.h | 4 ++-- include/sys/u8_textprep.h | 4 ++-- include/sys/uio.h | 4 ++-- include/sys/unistd.h | 4 ++-- include/sys/user.h | 4 ++-- include/sys/va_list.h | 4 ++-- include/sys/varargs.h | 4 ++-- include/sys/vfs.h | 4 ++-- include/sys/vfs_opreg.h | 4 ++-- include/sys/vmsystm.h | 4 ++-- include/sys/vnode.h | 4 ++-- include/sys/zmod.h | 4 ++-- include/sys/zone.h | 4 ++-- include/unistd.h | 4 ++-- include/util/qsort.h | 4 ++-- include/util/sscanf.h | 4 ++-- include/vm/anon.h | 4 ++-- include/vm/pvn.h | 4 ++-- include/vm/seg_kmem.h | 4 ++-- module/spl/spl-atomic.c | 4 ++-- module/spl/spl-cred.c | 4 ++-- module/spl/spl-err.c | 4 ++-- module/spl/spl-generic.c | 4 ++-- module/spl/spl-kobj.c | 4 ++-- module/spl/spl-kstat.c | 4 ++-- module/spl/spl-mutex.c | 4 ++-- module/spl/spl-proc.c | 4 ++-- module/spl/spl-rwlock.c | 4 ++-- module/spl/spl-thread.c | 4 ++-- module/spl/spl-vnode.c | 4 ++-- module/spl/spl-xdr.c | 4 ++-- module/spl/spl-zlib.c | 4 ++-- module/splat/splat-atomic.c | 4 ++-- module/splat/splat-condvar.c | 4 ++-- module/splat/splat-cred.c | 4 ++-- module/splat/splat-ctl.c | 4 ++-- module/splat/splat-generic.c | 4 ++-- module/splat/splat-internal.h | 4 ++-- module/splat/splat-kmem.c | 4 ++-- module/splat/splat-kobj.c | 4 ++-- module/splat/splat-linux.c | 4 ++-- module/splat/splat-list.c | 4 ++-- module/splat/splat-mutex.c | 4 ++-- module/splat/splat-random.c | 4 ++-- module/splat/splat-rwlock.c | 4 ++-- module/splat/splat-taskq.c | 4 ++-- module/splat/splat-thread.c | 4 ++-- module/splat/splat-time.c | 4 ++-- module/splat/splat-vnode.c | 4 ++-- module/splat/splat-zlib.c | 4 ++-- 154 files changed, 308 insertions(+), 308 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/cmd/splat/splat.c b/cmd/splat/splat.c index 92962393d..d11a64ce8 100644 --- a/cmd/splat/splat.c +++ b/cmd/splat/splat.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) User Space Interface. -\*****************************************************************************/ + */ #include #include diff --git a/cmd/splat/splat.h b/cmd/splat/splat.h index 5b838af3a..8fbc97cb6 100644 --- a/cmd/splat/splat.h +++ b/cmd/splat/splat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPLAT_H #define _SPLAT_H diff --git a/include/fs/fs_subr.h b/include/fs/fs_subr.h index 33ccc684e..802aa7336 100644 --- a/include/fs/fs_subr.h +++ b/include/fs/fs_subr.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_FS_FS_SUBR_H #define _SPL_FS_FS_SUBR_H diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h index 0a3ac16f4..dc7ed8600 100644 --- a/include/linux/bitops_compat.h +++ b/include/linux/bitops_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_BITOPS_COMPAT_H #define _SPL_BITOPS_COMPAT_H diff --git a/include/linux/compiler_compat.h b/include/linux/compiler_compat.h index 8dbbeee72..06268bf4c 100644 --- a/include/linux/compiler_compat.h +++ b/include/linux/compiler_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_COMPILER_COMPAT_H #define _SPL_COMPILER_COMPAT_H diff --git a/include/linux/delay_compat.h b/include/linux/delay_compat.h index fc9ff66f5..0c91a24d6 100644 --- a/include/linux/delay_compat.h +++ b/include/linux/delay_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DELAY_COMPAT_H #define _SPL_DELAY_COMPAT_H diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h index 916514566..26299965b 100644 --- a/include/linux/file_compat.h +++ b/include/linux/file_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_FILE_COMPAT_H #define _SPL_FILE_COMPAT_H diff --git a/include/linux/list_compat.h b/include/linux/list_compat.h index d1e0d9d96..63e455318 100644 --- a/include/linux/list_compat.h +++ b/include/linux/list_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_LIST_COMPAT_H #define _SPL_LIST_COMPAT_H diff --git a/include/linux/math64_compat.h b/include/linux/math64_compat.h index 2c911a64b..83046a05f 100644 --- a/include/linux/math64_compat.h +++ b/include/linux/math64_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MATH64_COMPAT_H #define _SPL_MATH64_COMPAT_H diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h index 7ae940a75..6c285bbbb 100644 --- a/include/linux/mm_compat.h +++ b/include/linux/mm_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MM_COMPAT_H #define _SPL_MM_COMPAT_H diff --git a/include/linux/proc_compat.h b/include/linux/proc_compat.h index 2c57f39d2..3ec66afbc 100644 --- a/include/linux/proc_compat.h +++ b/include/linux/proc_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PROC_COMPAT_H #define _SPL_PROC_COMPAT_H diff --git a/include/linux/rwsem_compat.h b/include/linux/rwsem_compat.h index de513debe..c2f22b060 100644 --- a/include/linux/rwsem_compat.h +++ b/include/linux/rwsem_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_RWSEM_COMPAT_H #define _SPL_RWSEM_COMPAT_H diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h index 445a73c68..dd0c9323b 100644 --- a/include/linux/wait_compat.h +++ b/include/linux/wait_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2014 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_WAIT_COMPAT_H #define _SPL_WAIT_COMPAT_H diff --git a/include/linux/zlib_compat.h b/include/linux/zlib_compat.h index ba853c395..d2fefd15a 100644 --- a/include/linux/zlib_compat.h +++ b/include/linux/zlib_compat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2011 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ZLIB_COMPAT_H #define _SPL_ZLIB_COMPAT_H diff --git a/include/rpc/types.h b/include/rpc/types.h index b57b4bd73..57afbc52a 100644 --- a/include/rpc/types.h +++ b/include/rpc/types.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_RPC_TYPES_H #define _SPL_RPC_TYPES_H diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index d0f06b55f..4f19f655b 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (c) 2008 Sun Microsystems, Inc. * Written by Ricardo Correia * @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_RPC_XDR_H #define _SPL_RPC_XDR_H diff --git a/include/sharefs/share.h b/include/sharefs/share.h index fc248a233..6c140d0b8 100644 --- a/include/sharefs/share.h +++ b/include/sharefs/share.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SHARE_H #define _SPL_SHARE_H diff --git a/include/spl-ctl.h b/include/spl-ctl.h index bb24490d9..21b1c1c05 100644 --- a/include/spl-ctl.h +++ b/include/spl-ctl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _DEBUG_CTL_H #define _DEBUG_CTL_H diff --git a/include/splat-ctl.h b/include/splat-ctl.h index 15fd01b54..dab3b299f 100644 --- a/include/splat-ctl.h +++ b/include/splat-ctl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPLAT_CTL_H #define _SPLAT_CTL_H diff --git a/include/strings.h b/include/strings.h index dc0f31466..c3b5741de 100644 --- a/include/strings.h +++ b/include/strings.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_STRINGS_H #define _SPL_STRINGS_H diff --git a/include/sys/acl.h b/include/sys/acl.h index f4a3de599..4c301b2a8 100644 --- a/include/sys/acl.h +++ b/include/sys/acl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ACL_H #define _SPL_ACL_H diff --git a/include/sys/acl_impl.h b/include/sys/acl_impl.h index 67af71371..45a4561dc 100644 --- a/include/sys/acl_impl.h +++ b/include/sys/acl_impl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ACL_IMPL_H #define _SPL_ACL_IMPL_H diff --git a/include/sys/atomic.h b/include/sys/atomic.h index 07b460ef7..d0229fb88 100644 --- a/include/sys/atomic.h +++ b/include/sys/atomic.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ATOMIC_H #define _SPL_ATOMIC_H diff --git a/include/sys/attr.h b/include/sys/attr.h index 5fb609c93..549807f25 100644 --- a/include/sys/attr.h +++ b/include/sys/attr.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ATTR_H #define _SPL_ATTR_H diff --git a/include/sys/bitmap.h b/include/sys/bitmap.h index e4acb0b7d..5bbf15f4b 100644 --- a/include/sys/bitmap.h +++ b/include/sys/bitmap.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_BITMAP_H #define _SPL_BITMAP_H diff --git a/include/sys/bootconf.h b/include/sys/bootconf.h index 4e032ad2f..883b9ec76 100644 --- a/include/sys/bootconf.h +++ b/include/sys/bootconf.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_BOOTCONF_H #define _SPL_BOOTCONF_H diff --git a/include/sys/bootprops.h b/include/sys/bootprops.h index a562ec9f9..bd1c3182b 100644 --- a/include/sys/bootprops.h +++ b/include/sys/bootprops.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_BOOTPROPS_H #define _SPL_BOOTPROPS_H diff --git a/include/sys/buf.h b/include/sys/buf.h index 8596c835c..60b1c621d 100644 --- a/include/sys/buf.h +++ b/include/sys/buf.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_BUF_H #define _SPL_BUF_H diff --git a/include/sys/byteorder.h b/include/sys/byteorder.h index 184b52d51..ffd7ec4c4 100644 --- a/include/sys/byteorder.h +++ b/include/sys/byteorder.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_BYTEORDER_H #define _SPL_BYTEORDER_H diff --git a/include/sys/callb.h b/include/sys/callb.h index fbe4128f8..0b33bc0f3 100644 --- a/include/sys/callb.h +++ b/include/sys/callb.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CALLB_H #define _SPL_CALLB_H diff --git a/include/sys/callo.h b/include/sys/callo.h index 0d9fbcbc4..1e1516392 100644 --- a/include/sys/callo.h +++ b/include/sys/callo.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CALLO_H #define _SPL_CALLO_H diff --git a/include/sys/cmn_err.h b/include/sys/cmn_err.h index 1291510ec..0e8e41841 100644 --- a/include/sys/cmn_err.h +++ b/include/sys/cmn_err.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CMN_ERR_H #define _SPL_CMN_ERR_H diff --git a/include/sys/compress.h b/include/sys/compress.h index 55822f0e5..719d87c4e 100644 --- a/include/sys/compress.h +++ b/include/sys/compress.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_COMPRESS_H #define _SPL_COMPRESS_H diff --git a/include/sys/conf.h b/include/sys/conf.h index eece0c798..eeaecb6f0 100644 --- a/include/sys/conf.h +++ b/include/sys/conf.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CONF_H #define _SPL_CONF_H diff --git a/include/sys/console.h b/include/sys/console.h index 76ef61838..2c327fb8f 100644 --- a/include/sys/console.h +++ b/include/sys/console.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CONSOLE_H #define _SPL_CONSOLE_H diff --git a/include/sys/cpupart.h b/include/sys/cpupart.h index fddeed6d0..1c3eb00f1 100644 --- a/include/sys/cpupart.h +++ b/include/sys/cpupart.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CPUPART_H #define _SPL_CPUPART_H diff --git a/include/sys/cpuvar.h b/include/sys/cpuvar.h index 1284f940f..d2e48063e 100644 --- a/include/sys/cpuvar.h +++ b/include/sys/cpuvar.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CPUVAR_H #define _SPL_CPUVAR_H diff --git a/include/sys/crc32.h b/include/sys/crc32.h index 1981f3579..d974418c8 100644 --- a/include/sys/crc32.h +++ b/include/sys/crc32.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CRC32_H #define _SPL_CRC32_H diff --git a/include/sys/cred.h b/include/sys/cred.h index 2ad7115e0..f966ac453 100644 --- a/include/sys/cred.h +++ b/include/sys/cred.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CRED_H #define _SPL_CRED_H diff --git a/include/sys/ctype.h b/include/sys/ctype.h index 52037f9a1..0a7ee4a8f 100644 --- a/include/sys/ctype.h +++ b/include/sys/ctype.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_CTYPE_H #define _SPL_CTYPE_H diff --git a/include/sys/ddi.h b/include/sys/ddi.h index 2fa1388fd..458c13ec8 100644 --- a/include/sys/ddi.h +++ b/include/sys/ddi.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DDI_H #define _SPL_DDI_H diff --git a/include/sys/debug.h b/include/sys/debug.h index 98ccbaf05..5fecaa869 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ /* * Available Solaris debug functions. All of the ASSERT() macros will be diff --git a/include/sys/dirent.h b/include/sys/dirent.h index 68f75da57..3069628da 100644 --- a/include/sys/dirent.h +++ b/include/sys/dirent.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DIRENT_H #define _SPL_DIRENT_H diff --git a/include/sys/disp.h b/include/sys/disp.h index c3077a73f..1994d53ed 100644 --- a/include/sys/disp.h +++ b/include/sys/disp.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DISP_H #define _SPL_DISP_H diff --git a/include/sys/dkio.h b/include/sys/dkio.h index dd7a95f13..49f166a9c 100644 --- a/include/sys/dkio.h +++ b/include/sys/dkio.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DKIO_H #define _SPL_DKIO_H diff --git a/include/sys/dkioc_free_util.h b/include/sys/dkioc_free_util.h index bea5a5bbc..579bf503f 100644 --- a/include/sys/dkioc_free_util.h +++ b/include/sys/dkioc_free_util.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DKIOC_UTIL_H #define _SPL_DKIOC_UTIL_H diff --git a/include/sys/dklabel.h b/include/sys/dklabel.h index 74c0d506f..ff58059c6 100644 --- a/include/sys/dklabel.h +++ b/include/sys/dklabel.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DKLABEL_H #define _SPL_DKLABEL_H diff --git a/include/sys/dnlc.h b/include/sys/dnlc.h index 99d16c885..20850c82e 100644 --- a/include/sys/dnlc.h +++ b/include/sys/dnlc.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DNLC_H #define _SPL_DNLC_H diff --git a/include/sys/dumphdr.h b/include/sys/dumphdr.h index 1b45058ad..dfb0585d1 100644 --- a/include/sys/dumphdr.h +++ b/include/sys/dumphdr.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_DUMPHDR_H #define _SPL_DUMPHDR_H diff --git a/include/sys/efi_partition.h b/include/sys/efi_partition.h index c39236423..6c4bb201e 100644 --- a/include/sys/efi_partition.h +++ b/include/sys/efi_partition.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_EFI_PARTITION_H #define _SPL_EFI_PARTITION_H diff --git a/include/sys/errno.h b/include/sys/errno.h index 64d8482dc..92b2cde6c 100644 --- a/include/sys/errno.h +++ b/include/sys/errno.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ERRNO_H #define _SPL_ERRNO_H diff --git a/include/sys/extdirent.h b/include/sys/extdirent.h index 1a5c03145..e0567fa6e 100644 --- a/include/sys/extdirent.h +++ b/include/sys/extdirent.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2010 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_EXTDIRENT_H #define _SPL_EXTDIRENT_H diff --git a/include/sys/fcntl.h b/include/sys/fcntl.h index 88b7a6928..bf5bf0323 100644 --- a/include/sys/fcntl.h +++ b/include/sys/fcntl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2010 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_FCNTL_H #define _SPL_FCNTL_H diff --git a/include/sys/file.h b/include/sys/file.h index 67b301c6e..4990e0505 100644 --- a/include/sys/file.h +++ b/include/sys/file.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_FILE_H #define _SPL_FILE_H diff --git a/include/sys/fm/protocol.h b/include/sys/fm/protocol.h index e9ce6ff6c..39f6cb1e5 100644 --- a/include/sys/fm/protocol.h +++ b/include/sys/fm/protocol.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_FM_PROTOCOL_H #define _SPL_FM_PROTOCOL_H diff --git a/include/sys/fm/util.h b/include/sys/fm/util.h index 7f2dbde9c..d8f68433d 100644 --- a/include/sys/fm/util.h +++ b/include/sys/fm/util.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_FM_UTIL_H #define _SPL_FM_UTIL_H diff --git a/include/sys/fs/swapnode.h b/include/sys/fs/swapnode.h index a5df1298d..dd18f3343 100644 --- a/include/sys/fs/swapnode.h +++ b/include/sys/fs/swapnode.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SWAPNODE_H #define _SPL_SWAPNODE_H diff --git a/include/sys/idmap.h b/include/sys/idmap.h index 3618c655c..aad96439f 100644 --- a/include/sys/idmap.h +++ b/include/sys/idmap.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2010 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_IDMAP_H #define _SPL_IDMAP_H diff --git a/include/sys/int_limits.h b/include/sys/int_limits.h index 64f0a1102..d9e775973 100644 --- a/include/sys/int_limits.h +++ b/include/sys/int_limits.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_INT_LIMITS_H #define _SPL_INT_LIMITS_H diff --git a/include/sys/int_types.h b/include/sys/int_types.h index 582fded20..2345205ea 100644 --- a/include/sys/int_types.h +++ b/include/sys/int_types.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_INT_TYPES_H #define _SPL_INT_TYPES_H diff --git a/include/sys/inttypes.h b/include/sys/inttypes.h index 82e555cdd..98e25110e 100644 --- a/include/sys/inttypes.h +++ b/include/sys/inttypes.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_INTTYPES_H #define _SPL_INTTYPES_H diff --git a/include/sys/isa_defs.h b/include/sys/isa_defs.h index 738795c70..6aa78e84c 100644 --- a/include/sys/isa_defs.h +++ b/include/sys/isa_defs.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ISA_DEFS_H #define _SPL_ISA_DEFS_H diff --git a/include/sys/kidmap.h b/include/sys/kidmap.h index 3d67b51a8..21e5e8f99 100644 --- a/include/sys/kidmap.h +++ b/include/sys/kidmap.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_KIDMAP_H #define _SPL_KIDMAP_H diff --git a/include/sys/kobj.h b/include/sys/kobj.h index 334449a8e..d133091e1 100644 --- a/include/sys/kobj.h +++ b/include/sys/kobj.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_KOBJ_H #define _SPL_KOBJ_H diff --git a/include/sys/kstat.h b/include/sys/kstat.h index 7862ab0a3..85909fc1f 100644 --- a/include/sys/kstat.h +++ b/include/sys/kstat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_KSTAT_H #define _SPL_KSTAT_H diff --git a/include/sys/list.h b/include/sys/list.h index 563784ae4..319e1f890 100644 --- a/include/sys/list.h +++ b/include/sys/list.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_LIST_H #define _SPL_LIST_H diff --git a/include/sys/mkdev.h b/include/sys/mkdev.h index d765b7374..e63d09f7c 100644 --- a/include/sys/mkdev.h +++ b/include/sys/mkdev.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MKDEV_H #define _SPL_MKDEV_H diff --git a/include/sys/mntent.h b/include/sys/mntent.h index 66fae87d4..4ca1b346a 100644 --- a/include/sys/mntent.h +++ b/include/sys/mntent.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MNTENT_H #define _SPL_MNTENT_H diff --git a/include/sys/modctl.h b/include/sys/modctl.h index 8d79e5312..f234c45ed 100644 --- a/include/sys/modctl.h +++ b/include/sys/modctl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MODCTL_H #define _SPL_MODCTL_H diff --git a/include/sys/mode.h b/include/sys/mode.h index d09965e4a..a9cf0da59 100644 --- a/include/sys/mode.h +++ b/include/sys/mode.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MODE_H #define _SPL_MODE_H diff --git a/include/sys/mount.h b/include/sys/mount.h index ca1796d7d..17eb1af57 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_MOUNT_H #define _SPL_MOUNT_H diff --git a/include/sys/note.h b/include/sys/note.h index 511756272..0c3386912 100644 --- a/include/sys/note.h +++ b/include/sys/note.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_NOTE_H #define _SPL_NOTE_H diff --git a/include/sys/open.h b/include/sys/open.h index e3ebd8c84..201bbeb56 100644 --- a/include/sys/open.h +++ b/include/sys/open.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_OPEN_H #define _SPL_OPEN_H diff --git a/include/sys/param.h b/include/sys/param.h index 5b5b5f550..2c9fcd8e9 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PARAM_H #define _SPL_PARAM_H diff --git a/include/sys/pathname.h b/include/sys/pathname.h index 71ea441cb..2806ce38b 100644 --- a/include/sys/pathname.h +++ b/include/sys/pathname.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PATHNAME_H #define _SPL_PATHNAME_H diff --git a/include/sys/policy.h b/include/sys/policy.h index 45e724bc5..6f40a0175 100644 --- a/include/sys/policy.h +++ b/include/sys/policy.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_POLICY_H #define _SPL_POLICY_H diff --git a/include/sys/pool.h b/include/sys/pool.h index bf6a0bb7d..9addd2c53 100644 --- a/include/sys/pool.h +++ b/include/sys/pool.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_POOL_H #define _SPL_POOL_H diff --git a/include/sys/priv_impl.h b/include/sys/priv_impl.h index f1507a89e..4d6640c8d 100644 --- a/include/sys/priv_impl.h +++ b/include/sys/priv_impl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PRIV_IMPL_H #define _SPL_PRIV_IMPL_H diff --git a/include/sys/proc.h b/include/sys/proc.h index dbaf4162f..5e2989610 100644 --- a/include/sys/proc.h +++ b/include/sys/proc.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PROC_H #define _SPL_PROC_H diff --git a/include/sys/processor.h b/include/sys/processor.h index 60b1a211b..de0395e5a 100644 --- a/include/sys/processor.h +++ b/include/sys/processor.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PROCESSOR_H #define _SPL_PROCESSOR_H diff --git a/include/sys/pset.h b/include/sys/pset.h index 2723d310b..58841e77d 100644 --- a/include/sys/pset.h +++ b/include/sys/pset.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_PSET_H #define _SPL_PSET_H diff --git a/include/sys/random.h b/include/sys/random.h index 64f70ee52..a3f2933e1 100644 --- a/include/sys/random.h +++ b/include/sys/random.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_RANDOM_H #define _SPL_RANDOM_H diff --git a/include/sys/refstr.h b/include/sys/refstr.h index 49a3417d1..7fe8a0360 100644 --- a/include/sys/refstr.h +++ b/include/sys/refstr.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_REFSTR_H #define _SPL_REFSTR_H diff --git a/include/sys/resource.h b/include/sys/resource.h index fe336555f..dfc6e28f4 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_RESOURCE_H #define _SPL_RESOURCE_H diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index ffb7b90b6..e806bdc9d 100644 --- a/include/sys/rwlock.h +++ b/include/sys/rwlock.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_RWLOCK_H #define _SPL_RWLOCK_H diff --git a/include/sys/sdt.h b/include/sys/sdt.h index 287bfaa71..80fb4c32a 100644 --- a/include/sys/sdt.h +++ b/include/sys/sdt.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SDT_H #define _SPL_SDT_H diff --git a/include/sys/sid.h b/include/sys/sid.h index 8ee5d0727..c5988a6f9 100644 --- a/include/sys/sid.h +++ b/include/sys/sid.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SID_H #define _SPL_SID_H diff --git a/include/sys/signal.h b/include/sys/signal.h index 77cc2d3c2..0c7236390 100644 --- a/include/sys/signal.h +++ b/include/sys/signal.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SIGNAL_H #define _SPL_SIGNAL_H diff --git a/include/sys/stat.h b/include/sys/stat.h index cde7556a6..c6ee57ed7 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_STAT_H #define _SPL_STAT_H diff --git a/include/sys/stropts.h b/include/sys/stropts.h index 25c7ee18f..68c4a0d14 100644 --- a/include/sys/stropts.h +++ b/include/sys/stropts.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_STROPTS_H #define _SPL_STROPTS_H diff --git a/include/sys/sunddi.h b/include/sys/sunddi.h index c49b0c26c..74ca4228f 100644 --- a/include/sys/sunddi.h +++ b/include/sys/sunddi.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SUNDDI_H #define _SPL_SUNDDI_H diff --git a/include/sys/sunldi.h b/include/sys/sunldi.h index ec8420231..0831904d6 100644 --- a/include/sys/sunldi.h +++ b/include/sys/sunldi.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SUNLDI_H #define _SPL_SUNLDI_H diff --git a/include/sys/sysdc.h b/include/sys/sysdc.h index 14ab48aa6..a563c87af 100644 --- a/include/sys/sysdc.h +++ b/include/sys/sysdc.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SYSDC_H #define _SPL_SYSDC_H diff --git a/include/sys/sysevent.h b/include/sys/sysevent.h index 5a7ca41ce..78e582f3c 100644 --- a/include/sys/sysevent.h +++ b/include/sys/sysevent.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SYSEVENT_H #define _SPL_SYSEVENT_H diff --git a/include/sys/sysevent/eventdefs.h b/include/sys/sysevent/eventdefs.h index 592c78a64..f92cc4f82 100644 --- a/include/sys/sysevent/eventdefs.h +++ b/include/sys/sysevent/eventdefs.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SYSEVENT_EVENTDEFS_H #define _SPL_SYSEVENT_EVENTDEFS_H diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index a4a9f3e98..03468d7d0 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SYSMACROS_H #define _SPL_SYSMACROS_H diff --git a/include/sys/systeminfo.h b/include/sys/systeminfo.h index 5c0cc4663..bc5337fa5 100644 --- a/include/sys/systeminfo.h +++ b/include/sys/systeminfo.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SYSTEMINFO_H #define _SPL_SYSTEMINFO_H diff --git a/include/sys/systm.h b/include/sys/systm.h index 3336fb357..cd49e14be 100644 --- a/include/sys/systm.h +++ b/include/sys/systm.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SYSTM_H #define _SPL_SYSTM_H diff --git a/include/sys/t_lock.h b/include/sys/t_lock.h index 6c159f933..f1de9616b 100644 --- a/include/sys/t_lock.h +++ b/include/sys/t_lock.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_T_LOCK_H #define _SPL_T_LOCK_H diff --git a/include/sys/thread.h b/include/sys/thread.h index 433a0761d..ae2188d84 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_THREAD_H #define _SPL_THREAD_H diff --git a/include/sys/time.h b/include/sys/time.h index ddda6dead..d6aaca913 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_TIME_H #define _SPL_TIME_H diff --git a/include/sys/timer.h b/include/sys/timer.h index 33d577e71..71190d287 100644 --- a/include/sys/timer.h +++ b/include/sys/timer.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_TIMER_H #define _SPL_TIMER_H diff --git a/include/sys/tsd.h b/include/sys/tsd.h index 1894a8232..4ddaea444 100644 --- a/include/sys/tsd.h +++ b/include/sys/tsd.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2010 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_TSD_H #define _SPL_TSD_H diff --git a/include/sys/types.h b/include/sys/types.h index d718ca0fa..b5359c7e8 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_TYPES_H #define _SPL_TYPES_H diff --git a/include/sys/types32.h b/include/sys/types32.h index 6ee580f4e..1b05b2a47 100644 --- a/include/sys/types32.h +++ b/include/sys/types32.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_TYPES32_H #define _SPL_TYPES32_H diff --git a/include/sys/u8_textprep.h b/include/sys/u8_textprep.h index 0a21c708c..f25cf1b2b 100644 --- a/include/sys/u8_textprep.h +++ b/include/sys/u8_textprep.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_U8_TEXTPREP_H #define _SPL_U8_TEXTPREP_H diff --git a/include/sys/uio.h b/include/sys/uio.h index 404c03774..b34741523 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Copyright (c) 2015 by Chunwei Chen. All rights reserved. @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_UIO_H #define _SPL_UIO_H diff --git a/include/sys/unistd.h b/include/sys/unistd.h index e1d93c61e..24eab763c 100644 --- a/include/sys/unistd.h +++ b/include/sys/unistd.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_UNISTD_H #define _SPL_UNISTD_H diff --git a/include/sys/user.h b/include/sys/user.h index 2b25dd33c..2dc3ed0c5 100644 --- a/include/sys/user.h +++ b/include/sys/user.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2015 Cluster Inc. * Produced at ClusterHQ Inc (cf, DISCLAIMER). * Written by Richard Yao . @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_USER_H #define _SPL_USER_H diff --git a/include/sys/va_list.h b/include/sys/va_list.h index 9fa173b58..4468d9e89 100644 --- a/include/sys/va_list.h +++ b/include/sys/va_list.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_VA_LIST_H #define _SPL_VA_LIST_H diff --git a/include/sys/varargs.h b/include/sys/varargs.h index bf360ff4d..b992e8430 100644 --- a/include/sys/varargs.h +++ b/include/sys/varargs.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_VARARGS_H #define _SPL_VARARGS_H diff --git a/include/sys/vfs.h b/include/sys/vfs.h index f01dc11cb..30fcfb476 100644 --- a/include/sys/vfs.h +++ b/include/sys/vfs.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ZFS_H #define _SPL_ZFS_H diff --git a/include/sys/vfs_opreg.h b/include/sys/vfs_opreg.h index d3540c593..1d20997ed 100644 --- a/include/sys/vfs_opreg.h +++ b/include/sys/vfs_opreg.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_OPREG_H #define _SPL_OPREG_H diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index 9d334fe0a..f048c318c 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_VMSYSTM_H #define _SPL_VMSYSTM_H diff --git a/include/sys/vnode.h b/include/sys/vnode.h index 0b857d384..9fa769e03 100644 --- a/include/sys/vnode.h +++ b/include/sys/vnode.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_VNODE_H #define _SPL_VNODE_H diff --git a/include/sys/zmod.h b/include/sys/zmod.h index 15b0bc8e7..d708c6612 100644 --- a/include/sys/zmod.h +++ b/include/sys/zmod.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -50,7 +50,7 @@ * * Jean-loup Gailly * Mark Adler -\*****************************************************************************/ + */ #ifndef _SPL_ZMOD_H #define _SPL_ZMOD_H diff --git a/include/sys/zone.h b/include/sys/zone.h index 5a3c0869f..4ed2a836f 100644 --- a/include/sys/zone.h +++ b/include/sys/zone.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_ZONE_H #define _SPL_ZONE_H diff --git a/include/unistd.h b/include/unistd.h index e1d93c61e..24eab763c 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_UNISTD_H #define _SPL_UNISTD_H diff --git a/include/util/qsort.h b/include/util/qsort.h index e55c4f8cc..5dc0b446b 100644 --- a/include/util/qsort.h +++ b/include/util/qsort.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_QSORT_H #define _SPL_QSORT_H diff --git a/include/util/sscanf.h b/include/util/sscanf.h index 23f0b5db0..561918d65 100644 --- a/include/util/sscanf.h +++ b/include/util/sscanf.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_UTIL_SSCANF_H #define _SPL_UTIL_SSCANF_H diff --git a/include/vm/anon.h b/include/vm/anon.h index 9c9c23959..a09f47c9f 100644 --- a/include/vm/anon.h +++ b/include/vm/anon.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_VM_ANON_H #define _SPL_VM_ANON_H diff --git a/include/vm/pvn.h b/include/vm/pvn.h index f3b308137..df916e68f 100644 --- a/include/vm/pvn.h +++ b/include/vm/pvn.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_VM_PVN_H #define _SPL_VM_PVN_H diff --git a/include/vm/seg_kmem.h b/include/vm/seg_kmem.h index 17df7b961..64b9688bd 100644 --- a/include/vm/seg_kmem.h +++ b/include/vm/seg_kmem.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPL_SEG_KMEM_H #define _SPL_SEG_KMEM_H diff --git a/module/spl/spl-atomic.c b/module/spl/spl-atomic.c index c46252c10..4c48684ba 100644 --- a/module/spl/spl-atomic.c +++ b/module/spl/spl-atomic.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Atomic Implementation. -\*****************************************************************************/ + */ #include diff --git a/module/spl/spl-cred.c b/module/spl/spl-cred.c index 1d486c1f0..f4431db7f 100644 --- a/module/spl/spl-cred.c +++ b/module/spl/spl-cred.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Credential Implementation. -\*****************************************************************************/ + */ #include diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 2f66b6e23..28c5258ef 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Error Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index f6782dae7..b5c9a9aef 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Generic Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index b79fcb828..6191163a8 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Kobj Implementation. -\*****************************************************************************/ + */ #include diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index ed5265311..4517824e7 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Kstat Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-mutex.c b/module/spl/spl-mutex.c index a29d488d1..9e1e103db 100644 --- a/module/spl/spl-mutex.c +++ b/module/spl/spl-mutex.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Mutex Implementation. -\*****************************************************************************/ + */ #include diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 05c1a5dbc..848eebffe 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Proc Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-rwlock.c b/module/spl/spl-rwlock.c index d99ef4f92..e497775e6 100644 --- a/module/spl/spl-rwlock.c +++ b/module/spl/spl-rwlock.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Reader/Writer Lock Implementation. -\*****************************************************************************/ + */ #include diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index b0f4d5715..92eba42ba 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Thread Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 346e63c0f..a54807db1 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) Vnode Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index 9405dc88d..04a337c2b 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (c) 2008-2010 Sun Microsystems, Inc. * Written by Ricardo Correia * @@ -19,7 +19,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting Layer (SPL) XDR Implementation. -\*****************************************************************************/ + */ #include #include diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c index 77c2a1dde..609bf5048 100644 --- a/module/spl/spl-zlib.c +++ b/module/spl/spl-zlib.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -50,7 +50,7 @@ * * Jean-loup Gailly * Mark Adler -\*****************************************************************************/ + */ #include diff --git a/module/splat/splat-atomic.c b/module/splat/splat-atomic.c index b8759e01f..8aaa0835d 100644 --- a/module/splat/splat-atomic.c +++ b/module/splat/splat-atomic.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Atomic Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-condvar.c b/module/splat/splat-condvar.c index 5a9b40f92..0804baf50 100644 --- a/module/splat/splat-condvar.c +++ b/module/splat/splat-condvar.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Condition Variable Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-cred.c b/module/splat/splat-cred.c index 5b07a1fe7..f13c0f752 100644 --- a/module/splat/splat-cred.c +++ b/module/splat/splat-cred.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Credential Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 8452f1363..cf6850100 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -41,7 +41,7 @@ * splat command line tool can be used to display all available * subsystems and tests. It can also be used to run the full suite * of regression tests or particular tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-generic.c b/module/splat/splat-generic.c index b8f6edc65..e256c83f0 100644 --- a/module/splat/splat-generic.c +++ b/module/splat/splat-generic.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Generic Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-internal.h b/module/splat/splat-internal.h index 9ae6c1d0c..97c10acfd 100644 --- a/module/splat/splat-internal.h +++ b/module/splat/splat-internal.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . -\*****************************************************************************/ + */ #ifndef _SPLAT_INTERNAL_H #define _SPLAT_INTERNAL_H diff --git a/module/splat/splat-kmem.c b/module/splat/splat-kmem.c index d0649ad9a..282f42d77 100644 --- a/module/splat/splat-kmem.c +++ b/module/splat/splat-kmem.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Kmem Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-kobj.c b/module/splat/splat-kobj.c index 6d78cb3e0..bd44de395 100644 --- a/module/splat/splat-kobj.c +++ b/module/splat/splat-kobj.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Kobj Tests. -\*****************************************************************************/ + */ #include #include "splat-internal.h" diff --git a/module/splat/splat-linux.c b/module/splat/splat-linux.c index b5a1f142e..1565d74a3 100644 --- a/module/splat/splat-linux.c +++ b/module/splat/splat-linux.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2011 Lawrence Livermore National Security, LLC. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Brian Behlendorf . @@ -21,7 +21,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Kernel Compatibility Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-list.c b/module/splat/splat-list.c index bfbaf23c7..8a5f3c937 100644 --- a/module/splat/splat-list.c +++ b/module/splat/splat-list.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) List Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-mutex.c b/module/splat/splat-mutex.c index 71291bbd4..202e6c0f6 100644 --- a/module/splat/splat-mutex.c +++ b/module/splat/splat-mutex.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Mutex Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-random.c b/module/splat/splat-random.c index 670931a8c..2ddb823fc 100644 --- a/module/splat/splat-random.c +++ b/module/splat/splat-random.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Random Number Generator Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-rwlock.c b/module/splat/splat-rwlock.c index 5d3ffb195..562a5f047 100644 --- a/module/splat/splat-rwlock.c +++ b/module/splat/splat-rwlock.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Read/Writer Lock Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-taskq.c b/module/splat/splat-taskq.c index 6d22018fc..ff73e103a 100644 --- a/module/splat/splat-taskq.c +++ b/module/splat/splat-taskq.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Task Queue Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-thread.c b/module/splat/splat-thread.c index e99d69101..f2e6bf15e 100644 --- a/module/splat/splat-thread.c +++ b/module/splat/splat-thread.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Thread Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-time.c b/module/splat/splat-time.c index 5b5ad62f6..a0e261956 100644 --- a/module/splat/splat-time.c +++ b/module/splat/splat-time.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Time Tests. -\*****************************************************************************/ + */ #include #include diff --git a/module/splat/splat-vnode.c b/module/splat/splat-vnode.c index ad69cf642..9b308975c 100644 --- a/module/splat/splat-vnode.c +++ b/module/splat/splat-vnode.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Vnode Tests. -\*****************************************************************************/ + */ #include #include "splat-internal.h" diff --git a/module/splat/splat-zlib.c b/module/splat/splat-zlib.c index dc9211838..28e521c82 100644 --- a/module/splat/splat-zlib.c +++ b/module/splat/splat-zlib.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. * Copyright (C) 2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -22,7 +22,7 @@ * with the SPL. If not, see . ***************************************************************************** * Solaris Porting LAyer Tests (SPLAT) Zlib Compression Tests. -\*****************************************************************************/ + */ #include #include -- cgit v1.2.3 From 5461eefe50427a8f8caf0b92f0195c754bed8ec6 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 7 Feb 2018 11:49:38 -0800 Subject: Fix cstyle warnings This patch contains no functional changes. It is solely intended to resolve cstyle warnings in order to facilitate moving the spl source code in to the zfs repository. Signed-off-by: Brian Behlendorf Closes #681 --- include/fs/fs_subr.h | 2 +- include/linux/math64_compat.h | 1 + include/rpc/types.h | 2 +- include/rpc/xdr.h | 48 ++-- include/sharefs/share.h | 2 +- include/spl-ctl.h | 22 +- include/splat-ctl.h | 60 ++-- include/strings.h | 2 +- include/sys/acl.h | 138 +++++----- include/sys/acl_impl.h | 2 +- include/sys/atomic.h | 80 +++--- include/sys/attr.h | 2 +- include/sys/bitmap.h | 2 +- include/sys/bootconf.h | 2 +- include/sys/bootprops.h | 2 +- include/sys/buf.h | 2 +- include/sys/byteorder.h | 32 ++- include/sys/callb.h | 21 +- include/sys/callo.h | 10 +- include/sys/cmn_err.h | 14 +- include/sys/compress.h | 2 +- include/sys/conf.h | 2 +- include/sys/console.h | 10 +- include/sys/cpupart.h | 2 +- include/sys/cpuvar.h | 2 +- include/sys/crc32.h | 2 +- include/sys/cred.h | 4 +- include/sys/ctype.h | 2 +- include/sys/ddi.h | 2 +- include/sys/debug.h | 6 +- include/sys/dirent.h | 2 +- include/sys/disp.h | 2 +- include/sys/dkioc_free_util.h | 2 +- include/sys/dnlc.h | 2 +- include/sys/dumphdr.h | 2 +- include/sys/efi_partition.h | 2 +- include/sys/errno.h | 2 +- include/sys/fcntl.h | 4 +- include/sys/file.h | 2 +- include/sys/fs/swapnode.h | 2 +- include/sys/idmap.h | 4 +- include/sys/int_limits.h | 2 +- include/sys/int_types.h | 2 +- include/sys/inttypes.h | 2 +- include/sys/isa_defs.h | 64 ++--- include/sys/kidmap.h | 2 +- include/sys/kobj.h | 2 +- include/sys/kstat.h | 244 ++++++++-------- include/sys/list.h | 36 +-- include/sys/mkdev.h | 2 +- include/sys/mntent.h | 2 +- include/sys/modctl.h | 2 +- include/sys/mode.h | 8 +- include/sys/mount.h | 2 +- include/sys/mutex.h | 10 +- include/sys/note.h | 2 +- include/sys/open.h | 2 +- include/sys/param.h | 8 +- include/sys/pathname.h | 2 +- include/sys/policy.h | 20 +- include/sys/pool.h | 2 +- include/sys/priv_impl.h | 2 +- include/sys/proc.h | 2 +- include/sys/processor.h | 2 +- include/sys/pset.h | 14 +- include/sys/random.h | 4 +- include/sys/refstr.h | 2 +- include/sys/resource.h | 2 +- include/sys/rwlock.h | 34 +-- include/sys/sdt.h | 4 +- include/sys/sid.h | 12 +- include/sys/signal.h | 7 +- include/sys/stat.h | 2 +- include/sys/stropts.h | 2 +- include/sys/sunddi.h | 8 +- include/sys/sunldi.h | 4 +- include/sys/sysdc.h | 2 +- include/sys/sysmacros.h | 196 ++++++------- include/sys/systeminfo.h | 8 +- include/sys/systm.h | 2 +- include/sys/t_lock.h | 2 +- include/sys/taskq.h | 2 +- include/sys/thread.h | 36 +-- include/sys/timer.h | 37 ++- include/sys/tsd.h | 10 +- include/sys/types.h | 6 +- include/sys/u8_textprep.h | 2 +- include/sys/uio.h | 20 +- include/sys/unistd.h | 2 +- include/sys/user.h | 4 +- include/sys/va_list.h | 2 +- include/sys/varargs.h | 4 +- include/sys/vfs.h | 4 +- include/sys/vfs_opreg.h | 2 +- include/sys/vmsystm.h | 14 +- include/sys/vnode.h | 100 +++---- include/sys/zmod.h | 5 +- include/sys/zone.h | 2 +- include/unistd.h | 2 +- include/util/qsort.h | 4 +- include/util/sscanf.h | 2 +- include/vm/anon.h | 2 +- include/vm/pvn.h | 2 +- include/vm/seg_kmem.h | 2 +- module/spl/spl-atomic.c | 8 +- module/spl/spl-condvar.c | 8 +- module/spl/spl-cred.c | 38 ++- module/spl/spl-err.c | 5 +- module/spl/spl-generic.c | 84 +++--- module/spl/spl-kmem-cache.c | 22 +- module/spl/spl-kmem.c | 2 +- module/spl/spl-kobj.c | 12 +- module/spl/spl-kstat.c | 521 +++++++++++++++++------------------ module/spl/spl-mutex.c | 8 +- module/spl/spl-proc.c | 628 +++++++++++++++++++++--------------------- module/spl/spl-rwlock.c | 10 +- module/spl/spl-taskq.c | 22 +- module/spl/spl-thread.c | 29 +- module/spl/spl-vnode.c | 164 ++++++----- module/spl/spl-xdr.c | 157 ++++++----- module/spl/spl-zlib.c | 37 +-- 121 files changed, 1633 insertions(+), 1621 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/include/fs/fs_subr.h b/include/fs/fs_subr.h index 802aa7336..71f074205 100644 --- a/include/fs/fs_subr.h +++ b/include/fs/fs_subr.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_FS_FS_SUBR_H -#define _SPL_FS_FS_SUBR_H +#define _SPL_FS_FS_SUBR_H #endif /* SPL_FS_FS_SUBR_H */ diff --git a/include/linux/math64_compat.h b/include/linux/math64_compat.h index e45015bea..c02f58479 100644 --- a/include/linux/math64_compat.h +++ b/include/linux/math64_compat.h @@ -26,6 +26,7 @@ #define _SPL_MATH64_COMPAT_H #ifndef abs64 +/* CSTYLED */ #define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; }) #endif diff --git a/include/rpc/types.h b/include/rpc/types.h index 57afbc52a..4fb5415ab 100644 --- a/include/rpc/types.h +++ b/include/rpc/types.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_RPC_TYPES_H -#define _SPL_RPC_TYPES_H +#define _SPL_RPC_TYPES_H typedef int bool_t; diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index 4f19f655b..e349757d5 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -20,7 +20,7 @@ */ #ifndef _SPL_RPC_XDR_H -#define _SPL_RPC_XDR_H +#define _SPL_RPC_XDR_H #include #include @@ -36,11 +36,10 @@ enum xdr_op { struct xdr_ops; typedef struct { - struct xdr_ops *x_ops; /* Also used to let caller know if - xdrmem_create() succeeds (sigh..) */ - caddr_t x_addr; /* Current buffer addr */ - caddr_t x_addr_end; /* End of the buffer */ - enum xdr_op x_op; /* Stream direction */ + struct xdr_ops *x_ops; /* Let caller know xdrmem_create() succeeds */ + caddr_t x_addr; /* Current buffer addr */ + caddr_t x_addr_end; /* End of the buffer */ + enum xdr_op x_op; /* Stream direction */ } XDR; typedef bool_t (*xdrproc_t)(XDR *xdrs, void *ptr); @@ -56,13 +55,13 @@ struct xdr_ops { bool_t (*xdr_opaque)(XDR *, caddr_t, const uint_t); bool_t (*xdr_string)(XDR *, char **, const uint_t); bool_t (*xdr_array)(XDR *, caddr_t *, uint_t *, const uint_t, - const uint_t, const xdrproc_t); + const uint_t, const xdrproc_t); }; /* * XDR control operator. */ -#define XDR_GET_BYTES_AVAIL 1 +#define XDR_GET_BYTES_AVAIL 1 struct xdr_bytesrec { bool_t xc_is_last_record; @@ -74,11 +73,12 @@ struct xdr_bytesrec { */ void xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size, const enum xdr_op op); -#define xdr_destroy(xdrs) ((void) 0) /* Currently not needed. If needed later, - we'll add it to struct xdr_ops */ -#define xdr_control(xdrs, req, info) (xdrs)->x_ops->xdr_control((xdrs), \ - (req), (info)) +/* Currently not needed. If needed later, we'll add it to struct xdr_ops */ +#define xdr_destroy(xdrs) ((void) 0) + +#define xdr_control(xdrs, req, info) \ + (xdrs)->x_ops->xdr_control((xdrs), (req), (info)) /* * For precaution, the following are defined as static inlines instead of macros @@ -89,40 +89,40 @@ void xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size, */ static inline bool_t xdr_char(XDR *xdrs, char *cp) { - return xdrs->x_ops->xdr_char(xdrs, cp); + return (xdrs->x_ops->xdr_char(xdrs, cp)); } static inline bool_t xdr_u_short(XDR *xdrs, unsigned short *usp) { - return xdrs->x_ops->xdr_u_short(xdrs, usp); + return (xdrs->x_ops->xdr_u_short(xdrs, usp)); } static inline bool_t xdr_short(XDR *xdrs, short *sp) { - BUILD_BUG_ON(sizeof(short) != 2); - return xdrs->x_ops->xdr_u_short(xdrs, (unsigned short *) sp); + BUILD_BUG_ON(sizeof (short) != 2); + return (xdrs->x_ops->xdr_u_short(xdrs, (unsigned short *) sp)); } static inline bool_t xdr_u_int(XDR *xdrs, unsigned *up) { - return xdrs->x_ops->xdr_u_int(xdrs, up); + return (xdrs->x_ops->xdr_u_int(xdrs, up)); } static inline bool_t xdr_int(XDR *xdrs, int *ip) { - BUILD_BUG_ON(sizeof(int) != 4); - return xdrs->x_ops->xdr_u_int(xdrs, (unsigned *) ip); + BUILD_BUG_ON(sizeof (int) != 4); + return (xdrs->x_ops->xdr_u_int(xdrs, (unsigned *)ip)); } static inline bool_t xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp) { - return xdrs->x_ops->xdr_u_longlong_t(xdrs, ullp); + return (xdrs->x_ops->xdr_u_longlong_t(xdrs, ullp)); } static inline bool_t xdr_longlong_t(XDR *xdrs, longlong_t *llp) { - BUILD_BUG_ON(sizeof(longlong_t) != 8); - return xdrs->x_ops->xdr_u_longlong_t(xdrs, (u_longlong_t *) llp); + BUILD_BUG_ON(sizeof (longlong_t) != 8); + return (xdrs->x_ops->xdr_u_longlong_t(xdrs, (u_longlong_t *)llp)); } /* @@ -130,7 +130,7 @@ static inline bool_t xdr_longlong_t(XDR *xdrs, longlong_t *llp) */ static inline bool_t xdr_opaque(XDR *xdrs, caddr_t cp, const uint_t cnt) { - return xdrs->x_ops->xdr_opaque(xdrs, cp, cnt); + return (xdrs->x_ops->xdr_opaque(xdrs, cp, cnt)); } /* @@ -139,7 +139,7 @@ static inline bool_t xdr_opaque(XDR *xdrs, caddr_t cp, const uint_t cnt) */ static inline bool_t xdr_string(XDR *xdrs, char **sp, const uint_t maxsize) { - return xdrs->x_ops->xdr_string(xdrs, sp, maxsize); + return (xdrs->x_ops->xdr_string(xdrs, sp, maxsize)); } /* diff --git a/include/sharefs/share.h b/include/sharefs/share.h index 6c140d0b8..a5bf0e2e1 100644 --- a/include/sharefs/share.h +++ b/include/sharefs/share.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_SHARE_H -#define _SPL_SHARE_H +#define _SPL_SHARE_H #endif /* SPL_SHARE_H */ diff --git a/include/spl-ctl.h b/include/spl-ctl.h index 21b1c1c05..571887d1d 100644 --- a/include/spl-ctl.h +++ b/include/spl-ctl.h @@ -23,23 +23,23 @@ */ #ifndef _DEBUG_CTL_H -#define _DEBUG_CTL_H +#define _DEBUG_CTL_H /* * Contains shared definitions which both the user space * and kernel space portions of splat must agree on. */ typedef struct spl_debug_header { - int ph_len; - int ph_flags; - int ph_subsys; - int ph_mask; - int ph_cpu_id; - int ph_sec; - long ph_usec; - int ph_stack; - int ph_pid; - int ph_line_num; + int ph_len; + int ph_flags; + int ph_subsys; + int ph_mask; + int ph_cpu_id; + int ph_sec; + long ph_usec; + int ph_stack; + int ph_pid; + int ph_line_num; } spl_debug_header_t; #endif /* _DEBUG_CTL_H */ diff --git a/include/splat-ctl.h b/include/splat-ctl.h index dab3b299f..0f020dc24 100644 --- a/include/splat-ctl.h +++ b/include/splat-ctl.h @@ -23,7 +23,7 @@ */ #ifndef _SPLAT_CTL_H -#define _SPLAT_CTL_H +#define _SPLAT_CTL_H #include @@ -32,11 +32,11 @@ * ensure 32-bit/64-bit interoperability over ioctl()'s only types with * fixed sizes can be used. */ -#define SPLAT_NAME "splatctl" -#define SPLAT_DEV "/dev/splatctl" +#define SPLAT_NAME "splatctl" +#define SPLAT_DEV "/dev/splatctl" -#define SPLAT_NAME_SIZE 20 -#define SPLAT_DESC_SIZE 60 +#define SPLAT_NAME_SIZE 20 +#define SPLAT_DESC_SIZE 60 typedef struct splat_user { char name[SPLAT_NAME_SIZE]; /* Short name */ @@ -72,38 +72,38 @@ typedef struct splat_cmd { } splat_cmd_t; /* Valid ioctls */ -#define SPLAT_CFG _IOWR('f', 101, splat_cfg_t) -#define SPLAT_CMD _IOWR('f', 102, splat_cmd_t) +#define SPLAT_CFG _IOWR('f', 101, splat_cfg_t) +#define SPLAT_CMD _IOWR('f', 102, splat_cmd_t) /* Valid configuration commands */ -#define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */ -#define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */ -#define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */ -#define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */ -#define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */ -#define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */ +#define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */ +#define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */ +#define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */ +#define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */ +#define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */ +#define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */ /* * Valid subsystem and test commands are defined in each subsystem as * SPLAT_SUBSYSTEM_*. We do need to be careful to avoid collisions, the * currently defined subsystems are as follows: */ -#define SPLAT_SUBSYSTEM_KMEM 0x0100 -#define SPLAT_SUBSYSTEM_TASKQ 0x0200 -#define SPLAT_SUBSYSTEM_KRNG 0x0300 -#define SPLAT_SUBSYSTEM_MUTEX 0x0400 -#define SPLAT_SUBSYSTEM_CONDVAR 0x0500 -#define SPLAT_SUBSYSTEM_THREAD 0x0600 -#define SPLAT_SUBSYSTEM_RWLOCK 0x0700 -#define SPLAT_SUBSYSTEM_TIME 0x0800 -#define SPLAT_SUBSYSTEM_VNODE 0x0900 -#define SPLAT_SUBSYSTEM_KOBJ 0x0a00 -#define SPLAT_SUBSYSTEM_ATOMIC 0x0b00 -#define SPLAT_SUBSYSTEM_LIST 0x0c00 -#define SPLAT_SUBSYSTEM_GENERIC 0x0d00 -#define SPLAT_SUBSYSTEM_CRED 0x0e00 -#define SPLAT_SUBSYSTEM_ZLIB 0x0f00 -#define SPLAT_SUBSYSTEM_LINUX 0x1000 -#define SPLAT_SUBSYSTEM_UNKNOWN 0xff00 +#define SPLAT_SUBSYSTEM_KMEM 0x0100 +#define SPLAT_SUBSYSTEM_TASKQ 0x0200 +#define SPLAT_SUBSYSTEM_KRNG 0x0300 +#define SPLAT_SUBSYSTEM_MUTEX 0x0400 +#define SPLAT_SUBSYSTEM_CONDVAR 0x0500 +#define SPLAT_SUBSYSTEM_THREAD 0x0600 +#define SPLAT_SUBSYSTEM_RWLOCK 0x0700 +#define SPLAT_SUBSYSTEM_TIME 0x0800 +#define SPLAT_SUBSYSTEM_VNODE 0x0900 +#define SPLAT_SUBSYSTEM_KOBJ 0x0a00 +#define SPLAT_SUBSYSTEM_ATOMIC 0x0b00 +#define SPLAT_SUBSYSTEM_LIST 0x0c00 +#define SPLAT_SUBSYSTEM_GENERIC 0x0d00 +#define SPLAT_SUBSYSTEM_CRED 0x0e00 +#define SPLAT_SUBSYSTEM_ZLIB 0x0f00 +#define SPLAT_SUBSYSTEM_LINUX 0x1000 +#define SPLAT_SUBSYSTEM_UNKNOWN 0xff00 #endif /* _SPLAT_CTL_H */ diff --git a/include/strings.h b/include/strings.h index c3b5741de..18179c79e 100644 --- a/include/strings.h +++ b/include/strings.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_STRINGS_H -#define _SPL_STRINGS_H +#define _SPL_STRINGS_H #endif /* SPL_STRINGS_H */ diff --git a/include/sys/acl.h b/include/sys/acl.h index 4c301b2a8..9fc79c025 100644 --- a/include/sys/acl.h +++ b/include/sys/acl.h @@ -23,95 +23,97 @@ */ #ifndef _SPL_ACL_H -#define _SPL_ACL_H +#define _SPL_ACL_H #include typedef struct ace { - uid_t a_who; - uint32_t a_access_mask; - uint16_t a_flags; - uint16_t a_type; + uid_t a_who; + uint32_t a_access_mask; + uint16_t a_flags; + uint16_t a_type; } ace_t; typedef struct ace_object { - uid_t a_who; /* uid or gid */ - uint32_t a_access_mask; /* read,write,... */ - uint16_t a_flags; /* see below */ - uint16_t a_type; /* allow or deny */ - uint8_t a_obj_type[16]; /* obj type */ - uint8_t a_inherit_obj_type[16]; /* inherit obj */ + uid_t a_who; /* uid or gid */ + uint32_t a_access_mask; /* read,write,... */ + uint16_t a_flags; /* see below */ + uint16_t a_type; /* allow or deny */ + uint8_t a_obj_type[16]; /* obj type */ + uint8_t a_inherit_obj_type[16]; /* inherit obj */ } ace_object_t; -#define MAX_ACL_ENTRIES 1024 +#define MAX_ACL_ENTRIES 1024 -#define ACE_READ_DATA 0x00000001 -#define ACE_LIST_DIRECTORY 0x00000001 -#define ACE_WRITE_DATA 0x00000002 -#define ACE_ADD_FILE 0x00000002 -#define ACE_APPEND_DATA 0x00000004 -#define ACE_ADD_SUBDIRECTORY 0x00000004 -#define ACE_READ_NAMED_ATTRS 0x00000008 -#define ACE_WRITE_NAMED_ATTRS 0x00000010 -#define ACE_EXECUTE 0x00000020 -#define ACE_DELETE_CHILD 0x00000040 -#define ACE_READ_ATTRIBUTES 0x00000080 -#define ACE_WRITE_ATTRIBUTES 0x00000100 -#define ACE_DELETE 0x00010000 -#define ACE_READ_ACL 0x00020000 -#define ACE_WRITE_ACL 0x00040000 -#define ACE_WRITE_OWNER 0x00080000 -#define ACE_SYNCHRONIZE 0x00100000 +#define ACE_READ_DATA 0x00000001 +#define ACE_LIST_DIRECTORY 0x00000001 +#define ACE_WRITE_DATA 0x00000002 +#define ACE_ADD_FILE 0x00000002 +#define ACE_APPEND_DATA 0x00000004 +#define ACE_ADD_SUBDIRECTORY 0x00000004 +#define ACE_READ_NAMED_ATTRS 0x00000008 +#define ACE_WRITE_NAMED_ATTRS 0x00000010 +#define ACE_EXECUTE 0x00000020 +#define ACE_DELETE_CHILD 0x00000040 +#define ACE_READ_ATTRIBUTES 0x00000080 +#define ACE_WRITE_ATTRIBUTES 0x00000100 +#define ACE_DELETE 0x00010000 +#define ACE_READ_ACL 0x00020000 +#define ACE_WRITE_ACL 0x00040000 +#define ACE_WRITE_OWNER 0x00080000 +#define ACE_SYNCHRONIZE 0x00100000 -#define ACE_FILE_INHERIT_ACE 0x0001 -#define ACE_DIRECTORY_INHERIT_ACE 0x0002 -#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 -#define ACE_INHERIT_ONLY_ACE 0x0008 -#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010 -#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020 -#define ACE_IDENTIFIER_GROUP 0x0040 -#define ACE_INHERITED_ACE 0x0080 -#define ACE_OWNER 0x1000 -#define ACE_GROUP 0x2000 -#define ACE_EVERYONE 0x4000 +#define ACE_FILE_INHERIT_ACE 0x0001 +#define ACE_DIRECTORY_INHERIT_ACE 0x0002 +#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 +#define ACE_INHERIT_ONLY_ACE 0x0008 +#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010 +#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020 +#define ACE_IDENTIFIER_GROUP 0x0040 +#define ACE_INHERITED_ACE 0x0080 +#define ACE_OWNER 0x1000 +#define ACE_GROUP 0x2000 +#define ACE_EVERYONE 0x4000 -#define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000 -#define ACE_ACCESS_DENIED_ACE_TYPE 0x0001 -#define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002 -#define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003 +#define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000 +#define ACE_ACCESS_DENIED_ACE_TYPE 0x0001 +#define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002 +#define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003 -#define ACL_AUTO_INHERIT 0x0001 -#define ACL_PROTECTED 0x0002 -#define ACL_DEFAULTED 0x0004 -#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED) +#define ACL_AUTO_INHERIT 0x0001 +#define ACL_PROTECTED 0x0002 +#define ACL_DEFAULTED 0x0004 +#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED) -#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04 -#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05 -#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06 -#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07 -#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08 -#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09 -#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A -#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B -#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C -#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D -#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E -#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F -#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10 +#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04 +#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05 +#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06 +#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07 +#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08 +#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09 +#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A +#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B +#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C +#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D +#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E +#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F +#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10 -#define ACE_ALL_TYPES 0x001F +#define ACE_ALL_TYPES 0x001F -#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP) +#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP) -#define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \ +/* BEGIN CSTYLED */ +#define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \ ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \ ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \ ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \ ACE_WRITE_OWNER|ACE_SYNCHRONIZE) +/* END CSTYLED */ -#define VSA_ACE 0x0010 -#define VSA_ACECNT 0x0020 -#define VSA_ACE_ALLTYPES 0x0040 -#define VSA_ACE_ACLFLAGS 0x0080 +#define VSA_ACE 0x0010 +#define VSA_ACECNT 0x0020 +#define VSA_ACE_ALLTYPES 0x0040 +#define VSA_ACE_ACLFLAGS 0x0080 #endif /* _SPL_ACL_H */ diff --git a/include/sys/acl_impl.h b/include/sys/acl_impl.h index 45a4561dc..9cb21124b 100644 --- a/include/sys/acl_impl.h +++ b/include/sys/acl_impl.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_ACL_IMPL_H -#define _SPL_ACL_IMPL_H +#define _SPL_ACL_IMPL_H #endif /* _SPL_ACL_IMPL_H */ diff --git a/include/sys/atomic.h b/include/sys/atomic.h index d0229fb88..e992fdce3 100644 --- a/include/sys/atomic.h +++ b/include/sys/atomic.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_ATOMIC_H -#define _SPL_ATOMIC_H +#define _SPL_ATOMIC_H #include #include @@ -91,7 +91,7 @@ atomic_inc_32_nv(volatile uint32_t *target) nv = ++(*target); spin_unlock(&atomic32_lock); - return nv; + return (nv); } static __inline__ uint32_t @@ -103,7 +103,7 @@ atomic_dec_32_nv(volatile uint32_t *target) nv = --(*target); spin_unlock(&atomic32_lock); - return nv; + return (nv); } static __inline__ uint32_t @@ -116,7 +116,7 @@ atomic_add_32_nv(volatile uint32_t *target, uint32_t delta) nv = *target; spin_unlock(&atomic32_lock); - return nv; + return (nv); } static __inline__ uint32_t @@ -129,12 +129,11 @@ atomic_sub_32_nv(volatile uint32_t *target, uint32_t delta) nv = *target; spin_unlock(&atomic32_lock); - return nv; + return (nv); } static __inline__ uint32_t -atomic_cas_32(volatile uint32_t *target, uint32_t cmp, - uint32_t newval) +atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t newval) { uint32_t rc; @@ -145,7 +144,7 @@ atomic_cas_32(volatile uint32_t *target, uint32_t cmp, spin_unlock(&atomic32_lock); - return rc; + return (rc); } static __inline__ uint32_t @@ -158,7 +157,7 @@ atomic_swap_32(volatile uint32_t *target, uint32_t newval) *target = newval; spin_unlock(&atomic32_lock); - return rc; + return (rc); } static __inline__ void @@ -202,7 +201,7 @@ atomic_inc_64_nv(volatile uint64_t *target) nv = ++(*target); spin_unlock(&atomic64_lock); - return nv; + return (nv); } static __inline__ uint64_t @@ -214,7 +213,7 @@ atomic_dec_64_nv(volatile uint64_t *target) nv = --(*target); spin_unlock(&atomic64_lock); - return nv; + return (nv); } static __inline__ uint64_t @@ -227,7 +226,7 @@ atomic_add_64_nv(volatile uint64_t *target, uint64_t delta) nv = *target; spin_unlock(&atomic64_lock); - return nv; + return (nv); } static __inline__ uint64_t @@ -240,12 +239,11 @@ atomic_sub_64_nv(volatile uint64_t *target, uint64_t delta) nv = *target; spin_unlock(&atomic64_lock); - return nv; + return (nv); } static __inline__ uint64_t -atomic_cas_64(volatile uint64_t *target, uint64_t cmp, - uint64_t newval) +atomic_cas_64(volatile uint64_t *target, uint64_t cmp, uint64_t newval) { uint64_t rc; @@ -255,7 +253,7 @@ atomic_cas_64(volatile uint64_t *target, uint64_t cmp, *target = newval; spin_unlock(&atomic64_lock); - return rc; + return (rc); } static __inline__ uint64_t @@ -268,31 +266,31 @@ atomic_swap_64(volatile uint64_t *target, uint64_t newval) *target = newval; spin_unlock(&atomic64_lock); - return rc; + return (rc); } #else /* ATOMIC_SPINLOCK */ -#define atomic_inc_32(v) atomic_inc((atomic_t *)(v)) -#define atomic_dec_32(v) atomic_dec((atomic_t *)(v)) -#define atomic_add_32(v, i) atomic_add((i), (atomic_t *)(v)) -#define atomic_sub_32(v, i) atomic_sub((i), (atomic_t *)(v)) -#define atomic_inc_32_nv(v) atomic_inc_return((atomic_t *)(v)) -#define atomic_dec_32_nv(v) atomic_dec_return((atomic_t *)(v)) -#define atomic_add_32_nv(v, i) atomic_add_return((i), (atomic_t *)(v)) -#define atomic_sub_32_nv(v, i) atomic_sub_return((i), (atomic_t *)(v)) -#define atomic_cas_32(v, x, y) atomic_cmpxchg((atomic_t *)(v), x, y) -#define atomic_swap_32(v, x) atomic_xchg((atomic_t *)(v), x) -#define atomic_inc_64(v) atomic64_inc((atomic64_t *)(v)) -#define atomic_dec_64(v) atomic64_dec((atomic64_t *)(v)) -#define atomic_add_64(v, i) atomic64_add((i), (atomic64_t *)(v)) -#define atomic_sub_64(v, i) atomic64_sub((i), (atomic64_t *)(v)) -#define atomic_inc_64_nv(v) atomic64_inc_return((atomic64_t *)(v)) -#define atomic_dec_64_nv(v) atomic64_dec_return((atomic64_t *)(v)) -#define atomic_add_64_nv(v, i) atomic64_add_return((i), (atomic64_t *)(v)) -#define atomic_sub_64_nv(v, i) atomic64_sub_return((i), (atomic64_t *)(v)) -#define atomic_cas_64(v, x, y) atomic64_cmpxchg((atomic64_t *)(v), x, y) -#define atomic_swap_64(v, x) atomic64_xchg((atomic64_t *)(v), x) +#define atomic_inc_32(v) atomic_inc((atomic_t *)(v)) +#define atomic_dec_32(v) atomic_dec((atomic_t *)(v)) +#define atomic_add_32(v, i) atomic_add((i), (atomic_t *)(v)) +#define atomic_sub_32(v, i) atomic_sub((i), (atomic_t *)(v)) +#define atomic_inc_32_nv(v) atomic_inc_return((atomic_t *)(v)) +#define atomic_dec_32_nv(v) atomic_dec_return((atomic_t *)(v)) +#define atomic_add_32_nv(v, i) atomic_add_return((i), (atomic_t *)(v)) +#define atomic_sub_32_nv(v, i) atomic_sub_return((i), (atomic_t *)(v)) +#define atomic_cas_32(v, x, y) atomic_cmpxchg((atomic_t *)(v), x, y) +#define atomic_swap_32(v, x) atomic_xchg((atomic_t *)(v), x) +#define atomic_inc_64(v) atomic64_inc((atomic64_t *)(v)) +#define atomic_dec_64(v) atomic64_dec((atomic64_t *)(v)) +#define atomic_add_64(v, i) atomic64_add((i), (atomic64_t *)(v)) +#define atomic_sub_64(v, i) atomic64_sub((i), (atomic64_t *)(v)) +#define atomic_inc_64_nv(v) atomic64_inc_return((atomic64_t *)(v)) +#define atomic_dec_64_nv(v) atomic64_dec_return((atomic64_t *)(v)) +#define atomic_add_64_nv(v, i) atomic64_add_return((i), (atomic64_t *)(v)) +#define atomic_sub_64_nv(v, i) atomic64_sub_return((i), (atomic64_t *)(v)) +#define atomic_cas_64(v, x, y) atomic64_cmpxchg((atomic64_t *)(v), x, y) +#define atomic_swap_64(v, x) atomic64_xchg((atomic64_t *)(v), x) #endif /* ATOMIC_SPINLOCK */ @@ -300,15 +298,15 @@ atomic_swap_64(volatile uint64_t *target, uint64_t newval) static __inline__ void * atomic_cas_ptr(volatile void *target, void *cmp, void *newval) { - return (void *)atomic_cas_64((volatile uint64_t *)target, - (uint64_t)cmp, (uint64_t)newval); + return ((void *)atomic_cas_64((volatile uint64_t *)target, + (uint64_t)cmp, (uint64_t)newval)); } #else /* _LP64 */ static __inline__ void * atomic_cas_ptr(volatile void *target, void *cmp, void *newval) { - return (void *)atomic_cas_32((volatile uint32_t *)target, - (uint32_t)cmp, (uint32_t)newval); + return ((void *)atomic_cas_32((volatile uint32_t *)target, + (uint32_t)cmp, (uint32_t)newval)); } #endif /* _LP64 */ diff --git a/include/sys/attr.h b/include/sys/attr.h index 549807f25..7941acbec 100644 --- a/include/sys/attr.h +++ b/include/sys/attr.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_ATTR_H -#define _SPL_ATTR_H +#define _SPL_ATTR_H #endif /* SPL_ATTR_H */ diff --git a/include/sys/bitmap.h b/include/sys/bitmap.h index 5bbf15f4b..3e7d910c0 100644 --- a/include/sys/bitmap.h +++ b/include/sys/bitmap.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_BITMAP_H -#define _SPL_BITMAP_H +#define _SPL_BITMAP_H #endif /* SPL_BITMAP_H */ diff --git a/include/sys/bootconf.h b/include/sys/bootconf.h index 883b9ec76..62730ba5d 100644 --- a/include/sys/bootconf.h +++ b/include/sys/bootconf.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_BOOTCONF_H -#define _SPL_BOOTCONF_H +#define _SPL_BOOTCONF_H #endif /* SPL_BOOTCONF_H */ diff --git a/include/sys/bootprops.h b/include/sys/bootprops.h index bd1c3182b..50150eda9 100644 --- a/include/sys/bootprops.h +++ b/include/sys/bootprops.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_BOOTPROPS_H -#define _SPL_BOOTPROPS_H +#define _SPL_BOOTPROPS_H #endif /* SPL_BOOTPROPS_H */ diff --git a/include/sys/buf.h b/include/sys/buf.h index 60b1c621d..fa453e478 100644 --- a/include/sys/buf.h +++ b/include/sys/buf.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_BUF_H -#define _SPL_BUF_H +#define _SPL_BUF_H #endif /* SPL_BUF_H */ diff --git a/include/sys/byteorder.h b/include/sys/byteorder.h index ffd7ec4c4..a0ff424f8 100644 --- a/include/sys/byteorder.h +++ b/include/sys/byteorder.h @@ -23,45 +23,49 @@ */ #ifndef _SPL_BYTEORDER_H -#define _SPL_BYTEORDER_H +#define _SPL_BYTEORDER_H #include #include -#define LE_16(x) cpu_to_le16(x) -#define LE_32(x) cpu_to_le32(x) -#define LE_64(x) cpu_to_le64(x) -#define BE_16(x) cpu_to_be16(x) -#define BE_32(x) cpu_to_be32(x) -#define BE_64(x) cpu_to_be64(x) +#define LE_16(x) cpu_to_le16(x) +#define LE_32(x) cpu_to_le32(x) +#define LE_64(x) cpu_to_le64(x) +#define BE_16(x) cpu_to_be16(x) +#define BE_32(x) cpu_to_be32(x) +#define BE_64(x) cpu_to_be64(x) -#define BE_IN8(xa) \ +#define BE_IN8(xa) \ *((uint8_t *)(xa)) -#define BE_IN16(xa) \ +#define BE_IN16(xa) \ (((uint16_t)BE_IN8(xa) << 8) | BE_IN8((uint8_t *)(xa)+1)) -#define BE_IN32(xa) \ +#define BE_IN32(xa) \ (((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2)) #ifdef _BIG_ENDIAN static __inline__ uint64_t -htonll(uint64_t n) { +htonll(uint64_t n) +{ return (n); } static __inline__ uint64_t -ntohll(uint64_t n) { +ntohll(uint64_t n) +{ return (n); } #else static __inline__ uint64_t -htonll(uint64_t n) { +htonll(uint64_t n) +{ return ((((uint64_t)htonl(n)) << 32) + htonl(n >> 32)); } static __inline__ uint64_t -ntohll(uint64_t n) { +ntohll(uint64_t n) +{ return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32)); } #endif diff --git a/include/sys/callb.h b/include/sys/callb.h index 0b33bc0f3..f1826bfd3 100644 --- a/include/sys/callb.h +++ b/include/sys/callb.h @@ -23,33 +23,32 @@ */ #ifndef _SPL_CALLB_H -#define _SPL_CALLB_H +#define _SPL_CALLB_H #include #include -#define CALLB_CPR_ASSERT(cp) ASSERT(MUTEX_HELD((cp)->cc_lockp)); +#define CALLB_CPR_ASSERT(cp) ASSERT(MUTEX_HELD((cp)->cc_lockp)); typedef struct callb_cpr { - kmutex_t *cc_lockp; + kmutex_t *cc_lockp; } callb_cpr_t; -#define CALLB_CPR_INIT(cp, lockp, func, name) { \ - (cp)->cc_lockp = lockp; \ +#define CALLB_CPR_INIT(cp, lockp, func, name) { \ + (cp)->cc_lockp = lockp; \ } -#define CALLB_CPR_SAFE_BEGIN(cp) { \ +#define CALLB_CPR_SAFE_BEGIN(cp) { \ CALLB_CPR_ASSERT(cp); \ } -#define CALLB_CPR_SAFE_END(cp, lockp) { \ +#define CALLB_CPR_SAFE_END(cp, lockp) { \ CALLB_CPR_ASSERT(cp); \ } -#define CALLB_CPR_EXIT(cp) { \ - ASSERT(MUTEX_HELD((cp)->cc_lockp)); \ - mutex_exit((cp)->cc_lockp); \ +#define CALLB_CPR_EXIT(cp) { \ + ASSERT(MUTEX_HELD((cp)->cc_lockp)); \ + mutex_exit((cp)->cc_lockp); \ } #endif /* _SPL_CALLB_H */ - diff --git a/include/sys/callo.h b/include/sys/callo.h index 1e1516392..c43ac92e7 100644 --- a/include/sys/callo.h +++ b/include/sys/callo.h @@ -22,7 +22,7 @@ */ #ifndef _SPL_CALLO_H -#define _SPL_CALLO_H +#define _SPL_CALLO_H /* * Callout flags: @@ -44,9 +44,9 @@ * Legacy interfaces timeout() and realtime_timeout() pass this flag * to timeout_generic() to indicate that a 32-bit ID should be allocated. */ -#define CALLOUT_FLAG_ROUNDUP 0x1 -#define CALLOUT_FLAG_ABSOLUTE 0x2 -#define CALLOUT_FLAG_HRESTIME 0x4 -#define CALLOUT_FLAG_32BIT 0x8 +#define CALLOUT_FLAG_ROUNDUP 0x1 +#define CALLOUT_FLAG_ABSOLUTE 0x2 +#define CALLOUT_FLAG_HRESTIME 0x4 +#define CALLOUT_FLAG_32BIT 0x8 #endif /* _SPL_CALLB_H */ diff --git a/include/sys/cmn_err.h b/include/sys/cmn_err.h index 0e8e41841..594a76333 100644 --- a/include/sys/cmn_err.h +++ b/include/sys/cmn_err.h @@ -23,20 +23,20 @@ */ #ifndef _SPL_CMN_ERR_H -#define _SPL_CMN_ERR_H +#define _SPL_CMN_ERR_H #include -#define CE_CONT 0 /* continuation */ -#define CE_NOTE 1 /* notice */ -#define CE_WARN 2 /* warning */ -#define CE_PANIC 3 /* panic */ -#define CE_IGNORE 4 /* print nothing */ +#define CE_CONT 0 /* continuation */ +#define CE_NOTE 1 /* notice */ +#define CE_WARN 2 /* warning */ +#define CE_PANIC 3 /* panic */ +#define CE_IGNORE 4 /* print nothing */ extern void cmn_err(int, const char *, ...); extern void vcmn_err(int, const char *, __va_list); extern void vpanic(const char *, __va_list); -#define fm_panic panic +#define fm_panic panic #endif /* SPL_CMN_ERR_H */ diff --git a/include/sys/compress.h b/include/sys/compress.h index 719d87c4e..e46ab0df2 100644 --- a/include/sys/compress.h +++ b/include/sys/compress.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_COMPRESS_H -#define _SPL_COMPRESS_H +#define _SPL_COMPRESS_H #endif /* SPL_COMPRESS_H */ diff --git a/include/sys/conf.h b/include/sys/conf.h index eeaecb6f0..68f4095dd 100644 --- a/include/sys/conf.h +++ b/include/sys/conf.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_CONF_H -#define _SPL_CONF_H +#define _SPL_CONF_H #endif /* SPL_CONF_H */ diff --git a/include/sys/console.h b/include/sys/console.h index 2c327fb8f..3469cb762 100644 --- a/include/sys/console.h +++ b/include/sys/console.h @@ -28,17 +28,17 @@ void console_vprintf(const char *fmt, va_list args) { - vprintk(fmt, args); + vprintk(fmt, args); } void console_printf(const char *fmt, ...) { - va_list args; + va_list args; - va_start(args, fmt); - console_vprintf(fmt, args); - va_end(args); + va_start(args, fmt); + console_vprintf(fmt, args); + va_end(args); } #endif /* _SPL_CONSOLE_H */ diff --git a/include/sys/cpupart.h b/include/sys/cpupart.h index 1c3eb00f1..ba57c19e8 100644 --- a/include/sys/cpupart.h +++ b/include/sys/cpupart.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_CPUPART_H -#define _SPL_CPUPART_H +#define _SPL_CPUPART_H #endif /* SPL_CPUPART_H */ diff --git a/include/sys/cpuvar.h b/include/sys/cpuvar.h index d2e48063e..075c06047 100644 --- a/include/sys/cpuvar.h +++ b/include/sys/cpuvar.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_CPUVAR_H -#define _SPL_CPUVAR_H +#define _SPL_CPUVAR_H #endif /* SPL_CPUVAR_H */ diff --git a/include/sys/crc32.h b/include/sys/crc32.h index d974418c8..eb021b1ff 100644 --- a/include/sys/crc32.h +++ b/include/sys/crc32.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_CRC32_H -#define _SPL_CRC32_H +#define _SPL_CRC32_H #endif /* SPL_CRC32_H */ diff --git a/include/sys/cred.h b/include/sys/cred.h index f966ac453..e4b18b665 100644 --- a/include/sys/cred.h +++ b/include/sys/cred.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_CRED_H -#define _SPL_CRED_H +#define _SPL_CRED_H #include #include @@ -68,7 +68,7 @@ extern gid_t crgetrgid(const cred_t *cr); extern gid_t crgetsgid(const cred_t *cr); extern gid_t crgetfsgid(const cred_t *cr); extern int crgetngroups(const cred_t *cr); -extern gid_t * crgetgroups(const cred_t *cr); +extern gid_t *crgetgroups(const cred_t *cr); extern int groupmember(gid_t gid, const cred_t *cr); #endif /* _SPL_CRED_H */ diff --git a/include/sys/ctype.h b/include/sys/ctype.h index 0a7ee4a8f..18beb1daa 100644 --- a/include/sys/ctype.h +++ b/include/sys/ctype.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_CTYPE_H -#define _SPL_CTYPE_H +#define _SPL_CTYPE_H #include diff --git a/include/sys/ddi.h b/include/sys/ddi.h index 458c13ec8..af2806ee7 100644 --- a/include/sys/ddi.h +++ b/include/sys/ddi.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_DDI_H -#define _SPL_DDI_H +#define _SPL_DDI_H #endif /* SPL_DDI_H */ diff --git a/include/sys/debug.h b/include/sys/debug.h index 5fecaa869..cd78171df 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -54,16 +54,17 @@ int spl_panic(const char *file, const char *func, int line, const char *fmt, ...); void spl_dumpstack(void); +/* BEGIN CSTYLED */ #define PANIC(fmt, a...) \ spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a) #define VERIFY(cond) \ - (void)(unlikely(!(cond)) && \ + (void) (unlikely(!(cond)) && \ spl_panic(__FILE__, __FUNCTION__, __LINE__, \ "%s", "VERIFY(" #cond ") failed\n")) #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \ - (void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \ + (void) ((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \ spl_panic(__FILE__, __FUNCTION__, __LINE__, \ "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \ "failed (" FMT " " #OP " " FMT ")\n", \ @@ -120,6 +121,7 @@ void spl_dumpstack(void); ((void)((!!(A) == !!(B)) || \ spl_panic(__FILE__, __FUNCTION__, __LINE__, \ "(" #A ") is equivalent to (" #B ")"))) +/* END CSTYLED */ #endif /* NDEBUG */ diff --git a/include/sys/dirent.h b/include/sys/dirent.h index 3069628da..8237d0dd9 100644 --- a/include/sys/dirent.h +++ b/include/sys/dirent.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_DIRENT_H -#define _SPL_DIRENT_H +#define _SPL_DIRENT_H #endif /* SPL_DIRENT_H */ diff --git a/include/sys/disp.h b/include/sys/disp.h index 1994d53ed..413b623c8 100644 --- a/include/sys/disp.h +++ b/include/sys/disp.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_DISP_H -#define _SPL_DISP_H +#define _SPL_DISP_H #include diff --git a/include/sys/dkioc_free_util.h b/include/sys/dkioc_free_util.h index 579bf503f..d519b2f8e 100644 --- a/include/sys/dkioc_free_util.h +++ b/include/sys/dkioc_free_util.h @@ -52,7 +52,7 @@ static inline void dfl_free(dkioc_free_list_t *dfl) { } static inline dkioc_free_list_t *dfl_alloc(uint64_t dfl_num_exts, int flags) { - return vmem_zalloc(DFL_SZ(dfl_num_exts), flags); + return (vmem_zalloc(DFL_SZ(dfl_num_exts), flags)); } #endif /* _SPL_DKIOC_UTIL_H */ diff --git a/include/sys/dnlc.h b/include/sys/dnlc.h index 20850c82e..cda112c18 100644 --- a/include/sys/dnlc.h +++ b/include/sys/dnlc.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_DNLC_H -#define _SPL_DNLC_H +#define _SPL_DNLC_H #endif /* SPL_DNLC_H */ diff --git a/include/sys/dumphdr.h b/include/sys/dumphdr.h index dfb0585d1..a452fe35d 100644 --- a/include/sys/dumphdr.h +++ b/include/sys/dumphdr.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_DUMPHDR_H -#define _SPL_DUMPHDR_H +#define _SPL_DUMPHDR_H #endif /* SPL_DUMPHDR_H */ diff --git a/include/sys/efi_partition.h b/include/sys/efi_partition.h index 6c4bb201e..d0c9c2005 100644 --- a/include/sys/efi_partition.h +++ b/include/sys/efi_partition.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_EFI_PARTITION_H -#define _SPL_EFI_PARTITION_H +#define _SPL_EFI_PARTITION_H #endif /* SPL_EFI_PARTITION_H */ diff --git a/include/sys/errno.h b/include/sys/errno.h index 92b2cde6c..2dd378bc8 100644 --- a/include/sys/errno.h +++ b/include/sys/errno.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_ERRNO_H -#define _SPL_ERRNO_H +#define _SPL_ERRNO_H #endif /* SPL_ERRNO_H */ diff --git a/include/sys/fcntl.h b/include/sys/fcntl.h index bf5bf0323..3faa5dad7 100644 --- a/include/sys/fcntl.h +++ b/include/sys/fcntl.h @@ -22,11 +22,11 @@ */ #ifndef _SPL_FCNTL_H -#define _SPL_FCNTL_H +#define _SPL_FCNTL_H #include -#define F_FREESP 11 +#define F_FREESP 11 #ifdef CONFIG_64BIT typedef struct flock flock64_t; diff --git a/include/sys/file.h b/include/sys/file.h index 4990e0505..b6c40aff2 100644 --- a/include/sys/file.h +++ b/include/sys/file.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_FILE_H -#define _SPL_FILE_H +#define _SPL_FILE_H #define FIGNORECASE 0x00080000 #define FKIOCTL 0x80000000 diff --git a/include/sys/fs/swapnode.h b/include/sys/fs/swapnode.h index dd18f3343..1fa5fdc83 100644 --- a/include/sys/fs/swapnode.h +++ b/include/sys/fs/swapnode.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_SWAPNODE_H -#define _SPL_SWAPNODE_H +#define _SPL_SWAPNODE_H #endif /* SPL_SWAPNODE_H */ diff --git a/include/sys/idmap.h b/include/sys/idmap.h index aad96439f..abbfcbed1 100644 --- a/include/sys/idmap.h +++ b/include/sys/idmap.h @@ -22,8 +22,8 @@ */ #ifndef _SPL_IDMAP_H -#define _SPL_IDMAP_H +#define _SPL_IDMAP_H -#define IDMAP_WK_CREATOR_OWNER_UID 2147483648U +#define IDMAP_WK_CREATOR_OWNER_UID 2147483648U #endif /* SPL_IDMAP_H */ diff --git a/include/sys/int_limits.h b/include/sys/int_limits.h index d9e775973..5d7e9be89 100644 --- a/include/sys/int_limits.h +++ b/include/sys/int_limits.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_INT_LIMITS_H -#define _SPL_INT_LIMITS_H +#define _SPL_INT_LIMITS_H #endif /* SPL_INT_LIMITS_H */ diff --git a/include/sys/int_types.h b/include/sys/int_types.h index 2345205ea..7e3b7329f 100644 --- a/include/sys/int_types.h +++ b/include/sys/int_types.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_INT_TYPES_H -#define _SPL_INT_TYPES_H +#define _SPL_INT_TYPES_H #include diff --git a/include/sys/inttypes.h b/include/sys/inttypes.h index 98e25110e..92e76206b 100644 --- a/include/sys/inttypes.h +++ b/include/sys/inttypes.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_INTTYPES_H -#define _SPL_INTTYPES_H +#define _SPL_INTTYPES_H #endif /* SPL_INTTYPES_H */ diff --git a/include/sys/isa_defs.h b/include/sys/isa_defs.h index 6aa78e84c..089ae0f85 100644 --- a/include/sys/isa_defs.h +++ b/include/sys/isa_defs.h @@ -29,59 +29,59 @@ #if defined(__x86_64) || defined(__x86_64__) #if !defined(__x86_64) -#define __x86_64 +#define __x86_64 #endif #if !defined(__amd64) -#define __amd64 +#define __amd64 #endif #if !defined(__x86) -#define __x86 +#define __x86 #endif #if !defined(_LP64) -#define _LP64 +#define _LP64 #endif -#define _ALIGNMENT_REQUIRED 1 +#define _ALIGNMENT_REQUIRED 1 /* i386 arch specific defines */ #elif defined(__i386) || defined(__i386__) #if !defined(__i386) -#define __i386 +#define __i386 #endif #if !defined(__x86) -#define __x86 +#define __x86 #endif #if !defined(_ILP32) -#define _ILP32 +#define _ILP32 #endif -#define _ALIGNMENT_REQUIRED 0 +#define _ALIGNMENT_REQUIRED 0 /* powerpc (ppc64) arch specific defines */ #elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) #if !defined(__powerpc) -#define __powerpc +#define __powerpc #endif #if !defined(__powerpc__) -#define __powerpc__ +#define __powerpc__ #endif #if defined(__powerpc64__) #if !defined(_LP64) -#define _LP64 +#define _LP64 #endif #else #if !defined(_ILP32) -#define _ILP32 +#define _ILP32 #endif #endif @@ -89,65 +89,65 @@ * Illumos doesn't define _ALIGNMENT_REQUIRED for PPC, so default to 1 * out of paranoia. */ -#define _ALIGNMENT_REQUIRED 1 +#define _ALIGNMENT_REQUIRED 1 /* arm arch specific defines */ #elif defined(__arm) || defined(__arm__) || defined(__aarch64__) #if !defined(__arm) -#define __arm +#define __arm #endif #if !defined(__arm__) -#define __arm__ +#define __arm__ #endif #if defined(__aarch64__) #if !defined(_LP64) -#define _LP64 +#define _LP64 #endif #else #if !defined(_ILP32) -#define _ILP32 +#define _ILP32 #endif #endif #if defined(__ARMEL__) || defined(__AARCH64EL__) -#define _LITTLE_ENDIAN +#define _LITTLE_ENDIAN #else -#define _BIG_ENDIAN +#define _BIG_ENDIAN #endif /* * Illumos doesn't define _ALIGNMENT_REQUIRED for ARM, so default to 1 * out of paranoia. */ -#define _ALIGNMENT_REQUIRED 1 +#define _ALIGNMENT_REQUIRED 1 /* sparc arch specific defines */ #elif defined(__sparc) || defined(__sparc__) #if !defined(__sparc) -#define __sparc +#define __sparc #endif #if !defined(__sparc__) -#define __sparc__ +#define __sparc__ #endif #if defined(__arch64__) #if !defined(_LP64) -#define _LP64 +#define _LP64 #endif #else #if !defined(_ILP32) -#define _ILP32 +#define _ILP32 #endif #endif -#define _BIG_ENDIAN -#define _SUNOS_VTOC_16 -#define _ALIGNMENT_REQUIRED 1 +#define _BIG_ENDIAN +#define _SUNOS_VTOC_16 +#define _ALIGNMENT_REQUIRED 1 /* s390 arch specific defines */ #elif defined(__s390__) @@ -167,7 +167,7 @@ * Illumos doesn't define _ALIGNMENT_REQUIRED for s390, so default to 1 * out of paranoia. */ -#define _ALIGNMENT_REQUIRED 1 +#define _ALIGNMENT_REQUIRED 1 /* MIPS arch specific defines */ #elif defined(__mips__) @@ -190,7 +190,7 @@ * Illumos doesn't define _ALIGNMENT_REQUIRED for MIPS, so default to 1 * out of paranoia. */ -#define _ALIGNMENT_REQUIRED 1 +#define _ALIGNMENT_REQUIRED 1 #else /* @@ -211,11 +211,11 @@ #include #if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN) -#define _LITTLE_ENDIAN __LITTLE_ENDIAN +#define _LITTLE_ENDIAN __LITTLE_ENDIAN #endif #if defined(__BIG_ENDIAN) && !defined(_BIG_ENDIAN) -#define _BIG_ENDIAN __BIG_ENDIAN +#define _BIG_ENDIAN __BIG_ENDIAN #endif #if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN) diff --git a/include/sys/kidmap.h b/include/sys/kidmap.h index 21e5e8f99..a5e6375c3 100644 --- a/include/sys/kidmap.h +++ b/include/sys/kidmap.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_KIDMAP_H -#define _SPL_KIDMAP_H +#define _SPL_KIDMAP_H #include diff --git a/include/sys/kobj.h b/include/sys/kobj.h index d133091e1..558ec39a8 100644 --- a/include/sys/kobj.h +++ b/include/sys/kobj.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_KOBJ_H -#define _SPL_KOBJ_H +#define _SPL_KOBJ_H #include diff --git a/include/sys/kstat.h b/include/sys/kstat.h index 85909fc1f..e9aff7386 100644 --- a/include/sys/kstat.h +++ b/include/sys/kstat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_KSTAT_H -#define _SPL_KSTAT_H +#define _SPL_KSTAT_H #include #include @@ -32,63 +32,65 @@ #include #include -#define KSTAT_STRLEN 255 -#define KSTAT_RAW_MAX (128*1024) +#define KSTAT_STRLEN 255 +#define KSTAT_RAW_MAX (128*1024) -/* For reference valid classes are: +/* + * For reference valid classes are: * disk, tape, net, controller, vm, kvm, hat, streams, kstat, misc */ -#define KSTAT_TYPE_RAW 0 /* can be anything; ks_ndata >= 1 */ -#define KSTAT_TYPE_NAMED 1 /* name/value pair; ks_ndata >= 1 */ -#define KSTAT_TYPE_INTR 2 /* interrupt stats; ks_ndata == 1 */ -#define KSTAT_TYPE_IO 3 /* I/O stats; ks_ndata == 1 */ -#define KSTAT_TYPE_TIMER 4 /* event timer; ks_ndata >= 1 */ -#define KSTAT_NUM_TYPES 5 - -#define KSTAT_DATA_CHAR 0 -#define KSTAT_DATA_INT32 1 -#define KSTAT_DATA_UINT32 2 -#define KSTAT_DATA_INT64 3 -#define KSTAT_DATA_UINT64 4 -#define KSTAT_DATA_LONG 5 -#define KSTAT_DATA_ULONG 6 -#define KSTAT_DATA_STRING 7 -#define KSTAT_NUM_DATAS 8 - -#define KSTAT_INTR_HARD 0 -#define KSTAT_INTR_SOFT 1 -#define KSTAT_INTR_WATCHDOG 2 -#define KSTAT_INTR_SPURIOUS 3 -#define KSTAT_INTR_MULTSVC 4 -#define KSTAT_NUM_INTRS 5 - -#define KSTAT_FLAG_VIRTUAL 0x01 -#define KSTAT_FLAG_VAR_SIZE 0x02 -#define KSTAT_FLAG_WRITABLE 0x04 -#define KSTAT_FLAG_PERSISTENT 0x08 -#define KSTAT_FLAG_DORMANT 0x10 -#define KSTAT_FLAG_UNSUPPORTED (KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \ - KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT) - - -#define KS_MAGIC 0x9d9d9d9d +#define KSTAT_TYPE_RAW 0 /* can be anything; ks_ndata >= 1 */ +#define KSTAT_TYPE_NAMED 1 /* name/value pair; ks_ndata >= 1 */ +#define KSTAT_TYPE_INTR 2 /* interrupt stats; ks_ndata == 1 */ +#define KSTAT_TYPE_IO 3 /* I/O stats; ks_ndata == 1 */ +#define KSTAT_TYPE_TIMER 4 /* event timer; ks_ndata >= 1 */ +#define KSTAT_NUM_TYPES 5 + +#define KSTAT_DATA_CHAR 0 +#define KSTAT_DATA_INT32 1 +#define KSTAT_DATA_UINT32 2 +#define KSTAT_DATA_INT64 3 +#define KSTAT_DATA_UINT64 4 +#define KSTAT_DATA_LONG 5 +#define KSTAT_DATA_ULONG 6 +#define KSTAT_DATA_STRING 7 +#define KSTAT_NUM_DATAS 8 + +#define KSTAT_INTR_HARD 0 +#define KSTAT_INTR_SOFT 1 +#define KSTAT_INTR_WATCHDOG 2 +#define KSTAT_INTR_SPURIOUS 3 +#define KSTAT_INTR_MULTSVC 4 +#define KSTAT_NUM_INTRS 5 + +#define KSTAT_FLAG_VIRTUAL 0x01 +#define KSTAT_FLAG_VAR_SIZE 0x02 +#define KSTAT_FLAG_WRITABLE 0x04 +#define KSTAT_FLAG_PERSISTENT 0x08 +#define KSTAT_FLAG_DORMANT 0x10 +#define KSTAT_FLAG_UNSUPPORTED \ + (KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \ + KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT) + + +#define KS_MAGIC 0x9d9d9d9d /* Dynamic updates */ -#define KSTAT_READ 0 -#define KSTAT_WRITE 1 +#define KSTAT_READ 0 +#define KSTAT_WRITE 1 struct kstat_s; typedef struct kstat_s kstat_t; -typedef int kid_t; /* unique kstat id */ -typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */ +typedef int kid_t; /* unique kstat id */ +typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */ typedef struct kstat_module { - char ksm_name[KSTAT_STRLEN+1]; /* module name */ - struct list_head ksm_module_list; /* module linkage */ - struct list_head ksm_kstat_list; /* list of kstat entries */ - struct proc_dir_entry *ksm_proc; /* proc entry */ + char ksm_name[KSTAT_STRLEN+1]; /* module name */ + struct list_head ksm_module_list; /* module linkage */ + struct list_head ksm_kstat_list; /* list of kstat entries */ + struct proc_dir_entry *ksm_proc; /* proc entry */ } kstat_module_t; typedef struct kstat_raw_ops { @@ -98,95 +100,96 @@ typedef struct kstat_raw_ops { } kstat_raw_ops_t; struct kstat_s { - int ks_magic; /* magic value */ - kid_t ks_kid; /* unique kstat ID */ - hrtime_t ks_crtime; /* creation time */ - hrtime_t ks_snaptime; /* last access time */ - char ks_module[KSTAT_STRLEN+1]; /* provider module name */ - int ks_instance; /* provider module instance */ - char ks_name[KSTAT_STRLEN+1]; /* kstat name */ - char ks_class[KSTAT_STRLEN+1]; /* kstat class */ - uchar_t ks_type; /* kstat data type */ - uchar_t ks_flags; /* kstat flags */ - void *ks_data; /* kstat type-specific data */ - uint_t ks_ndata; /* # of type-specific data records */ - size_t ks_data_size; /* size of kstat data section */ - struct proc_dir_entry *ks_proc; /* proc linkage */ - kstat_update_t *ks_update; /* dynamic updates */ - void *ks_private; /* private data */ - kmutex_t ks_private_lock; /* kstat private data lock */ - kmutex_t *ks_lock; /* kstat data lock */ - struct list_head ks_list; /* kstat linkage */ - kstat_module_t *ks_owner; /* kstat module linkage */ - kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */ - char *ks_raw_buf; /* buf used for raw ops */ - size_t ks_raw_bufsize; /* size of raw ops buffer */ + int ks_magic; /* magic value */ + kid_t ks_kid; /* unique kstat ID */ + hrtime_t ks_crtime; /* creation time */ + hrtime_t ks_snaptime; /* last access time */ + char ks_module[KSTAT_STRLEN+1]; /* provider module name */ + int ks_instance; /* provider module instance */ + char ks_name[KSTAT_STRLEN+1]; /* kstat name */ + char ks_class[KSTAT_STRLEN+1]; /* kstat class */ + uchar_t ks_type; /* kstat data type */ + uchar_t ks_flags; /* kstat flags */ + void *ks_data; /* kstat type-specific data */ + uint_t ks_ndata; /* # of data records */ + size_t ks_data_size; /* size of kstat data section */ + struct proc_dir_entry *ks_proc; /* proc linkage */ + kstat_update_t *ks_update; /* dynamic updates */ + void *ks_private; /* private data */ + kmutex_t ks_private_lock; /* kstat private data lock */ + kmutex_t *ks_lock; /* kstat data lock */ + struct list_head ks_list; /* kstat linkage */ + kstat_module_t *ks_owner; /* kstat module linkage */ + kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */ + char *ks_raw_buf; /* buf used for raw ops */ + size_t ks_raw_bufsize; /* size of raw ops buffer */ }; typedef struct kstat_named_s { - char name[KSTAT_STRLEN]; /* name of counter */ - uchar_t data_type; /* data type */ - union { - char c[16]; /* 128-bit int */ - int32_t i32; /* 32-bit signed int */ - uint32_t ui32; /* 32-bit unsigned int */ - int64_t i64; /* 64-bit signed int */ - uint64_t ui64; /* 64-bit unsigned int */ - long l; /* native signed long */ - ulong_t ul; /* native unsigned long */ - struct { - union { - char *ptr; /* NULL-term string */ - char __pad[8]; /* 64-bit padding */ - } addr; - uint32_t len; /* # bytes for strlen + '\0' */ - } string; - } value; + char name[KSTAT_STRLEN]; /* name of counter */ + uchar_t data_type; /* data type */ + union { + char c[16]; /* 128-bit int */ + int32_t i32; /* 32-bit signed int */ + uint32_t ui32; /* 32-bit unsigned int */ + int64_t i64; /* 64-bit signed int */ + uint64_t ui64; /* 64-bit unsigned int */ + long l; /* native signed long */ + ulong_t ul; /* native unsigned long */ + struct { + union { + char *ptr; /* NULL-term string */ + char __pad[8]; /* 64-bit padding */ + } addr; + uint32_t len; /* # bytes for strlen + '\0' */ + } string; + } value; } kstat_named_t; -#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr) -#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len) +#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr) +#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len) typedef struct kstat_intr { - uint_t intrs[KSTAT_NUM_INTRS]; + uint_t intrs[KSTAT_NUM_INTRS]; } kstat_intr_t; typedef struct kstat_io { - u_longlong_t nread; /* number of bytes read */ - u_longlong_t nwritten; /* number of bytes written */ - uint_t reads; /* number of read operations */ - uint_t writes; /* number of write operations */ - hrtime_t wtime; /* cumulative wait (pre-service) time */ - hrtime_t wlentime; /* cumulative wait length*time product*/ - hrtime_t wlastupdate; /* last time wait queue changed */ - hrtime_t rtime; /* cumulative run (service) time */ - hrtime_t rlentime; /* cumulative run length*time product */ - hrtime_t rlastupdate; /* last time run queue changed */ - uint_t wcnt; /* count of elements in wait state */ - uint_t rcnt; /* count of elements in run state */ + u_longlong_t nread; /* number of bytes read */ + u_longlong_t nwritten; /* number of bytes written */ + uint_t reads; /* number of read operations */ + uint_t writes; /* number of write operations */ + hrtime_t wtime; /* cumulative wait (pre-service) time */ + hrtime_t wlentime; /* cumulative wait len*time product */ + hrtime_t wlastupdate; /* last time wait queue changed */ + hrtime_t rtime; /* cumulative run (service) time */ + hrtime_t rlentime; /* cumulative run length*time product */ + hrtime_t rlastupdate; /* last time run queue changed */ + uint_t wcnt; /* count of elements in wait state */ + uint_t rcnt; /* count of elements in run state */ } kstat_io_t; typedef struct kstat_timer { - char name[KSTAT_STRLEN+1]; /* event name */ - u_longlong_t num_events; /* number of events */ - hrtime_t elapsed_time; /* cumulative elapsed time */ - hrtime_t min_time; /* shortest event duration */ - hrtime_t max_time; /* longest event duration */ - hrtime_t start_time; /* previous event start time */ - hrtime_t stop_time; /* previous event stop time */ + char name[KSTAT_STRLEN+1]; /* event name */ + u_longlong_t num_events; /* number of events */ + hrtime_t elapsed_time; /* cumulative elapsed time */ + hrtime_t min_time; /* shortest event duration */ + hrtime_t max_time; /* longest event duration */ + hrtime_t start_time; /* previous event start time */ + hrtime_t stop_time; /* previous event stop time */ } kstat_timer_t; int spl_kstat_init(void); void spl_kstat_fini(void); extern void __kstat_set_raw_ops(kstat_t *ksp, - int (*headers)(char *buf, size_t size), - int (*data)(char *buf, size_t size, void *data), - void* (*addr)(kstat_t *ksp, loff_t index)); + int (*headers)(char *buf, size_t size), + int (*data)(char *buf, size_t size, void *data), + void* (*addr)(kstat_t *ksp, loff_t index)); + extern kstat_t *__kstat_create(const char *ks_module, int ks_instance, - const char *ks_name, const char *ks_class, - uchar_t ks_type, uint_t ks_ndata, - uchar_t ks_flags); + const char *ks_name, const char *ks_class, uchar_t ks_type, + uint_t ks_ndata, uchar_t ks_flags); + extern void __kstat_install(kstat_t *ksp); extern void __kstat_delete(kstat_t *ksp); extern void kstat_waitq_enter(kstat_io_t *); @@ -194,9 +197,12 @@ extern void kstat_waitq_exit(kstat_io_t *); extern void kstat_runq_enter(kstat_io_t *); extern void kstat_runq_exit(kstat_io_t *); -#define kstat_set_raw_ops(k,h,d,a) __kstat_set_raw_ops(k,h,d,a) -#define kstat_create(m,i,n,c,t,s,f) __kstat_create(m,i,n,c,t,s,f) -#define kstat_install(k) __kstat_install(k) -#define kstat_delete(k) __kstat_delete(k) +#define kstat_set_raw_ops(k, h, d, a) \ + __kstat_set_raw_ops(k, h, d, a) +#define kstat_create(m, i, n, c, t, s, f) \ + __kstat_create(m, i, n, c, t, s, f) + +#define kstat_install(k) __kstat_install(k) +#define kstat_delete(k) __kstat_delete(k) #endif /* _SPL_KSTAT_H */ diff --git a/include/sys/list.h b/include/sys/list.h index 319e1f890..d80c8474e 100644 --- a/include/sys/list.h +++ b/include/sys/list.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_LIST_H -#define _SPL_LIST_H +#define _SPL_LIST_H #include #include @@ -53,13 +53,13 @@ typedef struct list { list_node_t list_head; } list_t; -#define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset)) -#define list_object(a, node) ((void *)(((char *)node) - (a)->list_offset)) +#define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset)) +#define list_object(a, node) ((void *)(((char *)node) - (a)->list_offset)) static inline int list_is_empty(list_t *list) { - return list_empty(&list->list_head); + return (list_empty(&list->list_head)); } static inline void @@ -74,7 +74,7 @@ list_create(list_t *list, size_t size, size_t offset) { ASSERT(list); ASSERT(size > 0); - ASSERT(size >= offset + sizeof(list_node_t)); + ASSERT(size >= offset + sizeof (list_node_t)); list->list_size = size; list->list_offset = offset; @@ -132,10 +132,10 @@ list_remove_head(list_t *list) { list_node_t *head = list->list_head.next; if (head == &list->list_head) - return NULL; + return (NULL); list_del(head); - return list_object(list, head); + return (list_object(list, head)); } static inline void * @@ -143,28 +143,28 @@ list_remove_tail(list_t *list) { list_node_t *tail = list->list_head.prev; if (tail == &list->list_head) - return NULL; + return (NULL); list_del(tail); - return list_object(list, tail); + return (list_object(list, tail)); } static inline void * list_head(list_t *list) { if (list_is_empty(list)) - return NULL; + return (NULL); - return list_object(list, list->list_head.next); + return (list_object(list, list->list_head.next)); } static inline void * list_tail(list_t *list) { if (list_is_empty(list)) - return NULL; + return (NULL); - return list_object(list, list->list_head.prev); + return (list_object(list, list->list_head.prev)); } static inline void * @@ -173,9 +173,9 @@ list_next(list_t *list, void *object) list_node_t *node = list_d2l(list, object); if (node->next != &list->list_head) - return list_object(list, node->next); + return (list_object(list, node->next)); - return NULL; + return (NULL); } static inline void * @@ -184,9 +184,9 @@ list_prev(list_t *list, void *object) list_node_t *node = list_d2l(list, object); if (node->prev != &list->list_head) - return list_object(list, node->prev); + return (list_object(list, node->prev)); - return NULL; + return (NULL); } static inline int @@ -201,7 +201,7 @@ spl_list_move_tail(list_t *dst, list_t *src) list_splice_init(&src->list_head, dst->list_head.prev); } -#define list_move_tail(dst, src) spl_list_move_tail(dst, src) +#define list_move_tail(dst, src) spl_list_move_tail(dst, src) static inline void list_link_replace(list_node_t *old_node, list_node_t *new_node) diff --git a/include/sys/mkdev.h b/include/sys/mkdev.h index e63d09f7c..7dff2d22d 100644 --- a/include/sys/mkdev.h +++ b/include/sys/mkdev.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_MKDEV_H -#define _SPL_MKDEV_H +#define _SPL_MKDEV_H #endif /* SPL_MKDEV_H */ diff --git a/include/sys/mntent.h b/include/sys/mntent.h index 4ca1b346a..cac28c530 100644 --- a/include/sys/mntent.h +++ b/include/sys/mntent.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_MNTENT_H -#define _SPL_MNTENT_H +#define _SPL_MNTENT_H #endif /* SPL_MNTENT_H */ diff --git a/include/sys/modctl.h b/include/sys/modctl.h index f234c45ed..8f9ae496d 100644 --- a/include/sys/modctl.h +++ b/include/sys/modctl.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_MODCTL_H -#define _SPL_MODCTL_H +#define _SPL_MODCTL_H #endif /* SPL_MODCTL_H */ diff --git a/include/sys/mode.h b/include/sys/mode.h index a9cf0da59..02802d0d4 100644 --- a/include/sys/mode.h +++ b/include/sys/mode.h @@ -23,10 +23,10 @@ */ #ifndef _SPL_MODE_H -#define _SPL_MODE_H +#define _SPL_MODE_H -#define IFTOVT(mode) vn_mode_to_vtype(mode) -#define VTTOIF(vtype) vn_vtype_to_mode(vtype) -#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT)) +#define IFTOVT(mode) vn_mode_to_vtype(mode) +#define VTTOIF(vtype) vn_vtype_to_mode(vtype) +#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT)) #endif /* SPL_MODE_H */ diff --git a/include/sys/mount.h b/include/sys/mount.h index 17eb1af57..fdd1c6678 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_MOUNT_H -#define _SPL_MOUNT_H +#define _SPL_MOUNT_H #endif /* SPL_MOUNT_H */ diff --git a/include/sys/mutex.h b/include/sys/mutex.h index 8cbab7c47..c7084b3c3 100644 --- a/include/sys/mutex.h +++ b/include/sys/mutex.h @@ -84,13 +84,13 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \ lockdep_on(); \ } #else /* CONFIG_LOCKDEP */ -#define spl_mutex_set_type(mp, type) -#define spl_mutex_lockdep_off_maybe(mp) -#define spl_mutex_lockdep_on_maybe(mp) +#define spl_mutex_set_type(mp, type) +#define spl_mutex_lockdep_off_maybe(mp) +#define spl_mutex_lockdep_on_maybe(mp) #endif /* CONFIG_LOCKDEP */ /* - * The following functions must be a #define and not static inline. + * The following functions must be a #define and not static inline. * This ensures that the native linux mutex functions (lock/unlock) * will be correctly located in the users code which is important * for the built in kernel lock analysis tools @@ -113,6 +113,7 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \ VERIFY3P(mutex_owner(mp), ==, NULL); \ } +/* BEGIN CSTYLED */ #define mutex_tryenter(mp) \ ({ \ int _rc_; \ @@ -124,6 +125,7 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \ \ _rc_; \ }) +/* END CSTYLED */ #ifdef CONFIG_DEBUG_LOCK_ALLOC #define mutex_enter_nested(mp, subclass) \ diff --git a/include/sys/note.h b/include/sys/note.h index 0c3386912..f7f9b70ef 100644 --- a/include/sys/note.h +++ b/include/sys/note.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_NOTE_H -#define _SPL_NOTE_H +#define _SPL_NOTE_H #endif /* SPL_NOTE_H */ diff --git a/include/sys/open.h b/include/sys/open.h index 201bbeb56..7c9e0cb7a 100644 --- a/include/sys/open.h +++ b/include/sys/open.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_OPEN_H -#define _SPL_OPEN_H +#define _SPL_OPEN_H #endif /* SPL_OPEN_H */ diff --git a/include/sys/param.h b/include/sys/param.h index 10bf96588..4ef929151 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -23,14 +23,14 @@ */ #ifndef _SPL_PARAM_H -#define _SPL_PARAM_H +#define _SPL_PARAM_H #include /* Pages to bytes and back */ -#define ptob(pages) ((pages) << PAGE_SHIFT) -#define btop(bytes) ((bytes) >> PAGE_SHIFT) +#define ptob(pages) ((pages) << PAGE_SHIFT) +#define btop(bytes) ((bytes) >> PAGE_SHIFT) -#define MAXUID UINT32_MAX +#define MAXUID UINT32_MAX #endif /* SPL_PARAM_H */ diff --git a/include/sys/pathname.h b/include/sys/pathname.h index 2806ce38b..fde1b3c1e 100644 --- a/include/sys/pathname.h +++ b/include/sys/pathname.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_PATHNAME_H -#define _SPL_PATHNAME_H +#define _SPL_PATHNAME_H typedef struct pathname { char *pn_buf; /* underlying storage */ diff --git a/include/sys/policy.h b/include/sys/policy.h index 6f40a0175..e4333cfcf 100644 --- a/include/sys/policy.h +++ b/include/sys/policy.h @@ -23,25 +23,25 @@ */ #ifndef _SPL_POLICY_H -#define _SPL_POLICY_H +#define _SPL_POLICY_H -#define secpolicy_fs_unmount(c,vfs) (0) +#define secpolicy_fs_unmount(c, vfs) (0) #define secpolicy_nfs(c) (0) -#define secpolicy_sys_config(c,co) (0) +#define secpolicy_sys_config(c, co) (0) #define secpolicy_zfs(c) (0) #define secpolicy_zinject(c) (0) -#define secpolicy_vnode_setids_setgids(c,id) (0) +#define secpolicy_vnode_setids_setgids(c, id) (0) #define secpolicy_vnode_setid_retain(c, sr) (0) #define secpolicy_setid_clear(v, c) (0) -#define secpolicy_vnode_any_access(c,vp,o) (0) -#define secpolicy_vnode_access2(c,cp,o,m1,m2) (0) -#define secpolicy_vnode_chown(c,o) (0) -#define secpolicy_vnode_setdac(c,o) (0) +#define secpolicy_vnode_any_access(c, vp, o) (0) +#define secpolicy_vnode_access2(c, cp, o, m1, m2) (0) +#define secpolicy_vnode_chown(c, o) (0) +#define secpolicy_vnode_setdac(c, o) (0) #define secpolicy_vnode_remove(c) (0) -#define secpolicy_vnode_setattr(c,v,a,o,f,func,n) (0) +#define secpolicy_vnode_setattr(c, v, a, o, f, func, n) (0) #define secpolicy_xvattr(x, o, c, t) (0) #define secpolicy_vnode_stky_modify(c) (0) -#define secpolicy_setid_setsticky_clear(v,a,o,c) (0) +#define secpolicy_setid_setsticky_clear(v, a, o, c) (0) #define secpolicy_basic_link(c) (0) #endif /* SPL_POLICY_H */ diff --git a/include/sys/pool.h b/include/sys/pool.h index 9addd2c53..392c14b5e 100644 --- a/include/sys/pool.h +++ b/include/sys/pool.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_POOL_H -#define _SPL_POOL_H +#define _SPL_POOL_H #include diff --git a/include/sys/priv_impl.h b/include/sys/priv_impl.h index 4d6640c8d..822c2dec1 100644 --- a/include/sys/priv_impl.h +++ b/include/sys/priv_impl.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_PRIV_IMPL_H -#define _SPL_PRIV_IMPL_H +#define _SPL_PRIV_IMPL_H #endif /* _SPL_PRIV_IMPL_H */ diff --git a/include/sys/proc.h b/include/sys/proc.h index 5e2989610..95fc8cc5f 100644 --- a/include/sys/proc.h +++ b/include/sys/proc.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_PROC_H -#define _SPL_PROC_H +#define _SPL_PROC_H #endif /* SPL_PROC_H */ diff --git a/include/sys/processor.h b/include/sys/processor.h index de0395e5a..a70101fa2 100644 --- a/include/sys/processor.h +++ b/include/sys/processor.h @@ -25,7 +25,7 @@ #ifndef _SPL_PROCESSOR_H #define _SPL_PROCESSOR_H -#define getcpuid() smp_processor_id() +#define getcpuid() smp_processor_id() typedef int processorid_t; diff --git a/include/sys/pset.h b/include/sys/pset.h index 58841e77d..a6a9d343b 100644 --- a/include/sys/pset.h +++ b/include/sys/pset.h @@ -23,16 +23,16 @@ */ #ifndef _SPL_PSET_H -#define _SPL_PSET_H +#define _SPL_PSET_H typedef int psetid_t; /* special processor set id's */ -#define PS_NONE -1 -#define PS_QUERY -2 -#define PS_MYID -3 -#define PS_SOFT -4 -#define PS_HARD -5 -#define PS_QUERY_TYPE -6 +#define PS_NONE -1 +#define PS_QUERY -2 +#define PS_MYID -3 +#define PS_SOFT -4 +#define PS_HARD -5 +#define PS_QUERY_TYPE -6 #endif /* SPL_PSET_H */ diff --git a/include/sys/random.h b/include/sys/random.h index a3f2933e1..93e244f56 100644 --- a/include/sys/random.h +++ b/include/sys/random.h @@ -31,8 +31,8 @@ static __inline__ int random_get_bytes(uint8_t *ptr, size_t len) { - get_random_bytes((void *)ptr,(int)len); - return 0; + get_random_bytes((void *)ptr, (int)len); + return (0); } extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); diff --git a/include/sys/refstr.h b/include/sys/refstr.h index 7fe8a0360..1b54dab45 100644 --- a/include/sys/refstr.h +++ b/include/sys/refstr.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_REFSTR_H -#define _SPL_REFSTR_H +#define _SPL_REFSTR_H #endif /* SPL_REFSTR_H */ diff --git a/include/sys/resource.h b/include/sys/resource.h index dfc6e28f4..d1ffb6c2d 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_RESOURCE_H -#define _SPL_RESOURCE_H +#define _SPL_RESOURCE_H #include diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index e806bdc9d..bb8b785e8 100644 --- a/include/sys/rwlock.h +++ b/include/sys/rwlock.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_RWLOCK_H -#define _SPL_RWLOCK_H +#define _SPL_RWLOCK_H #include #include @@ -55,7 +55,7 @@ typedef struct { #endif /* CONFIG_LOCKDEP */ } krwlock_t; -#define SEM(rwp) (&(rwp)->rw_rwlock) +#define SEM(rwp) (&(rwp)->rw_rwlock) static inline void spl_rw_set_owner(krwlock_t *rwp) @@ -81,9 +81,9 @@ static inline kthread_t * rw_owner(krwlock_t *rwp) { #ifdef CONFIG_RWSEM_SPIN_ON_OWNER - return SEM(rwp)->owner; + return (SEM(rwp)->owner); #else - return rwp->rw_owner; + return (rwp->rw_owner); #endif } @@ -106,9 +106,9 @@ spl_rw_lockdep_on_maybe(krwlock_t *rwp) \ lockdep_on(); \ } #else /* CONFIG_LOCKDEP */ -#define spl_rw_set_type(rwp, type) -#define spl_rw_lockdep_off_maybe(rwp) -#define spl_rw_lockdep_on_maybe(rwp) +#define spl_rw_set_type(rwp, type) +#define spl_rw_lockdep_off_maybe(rwp) +#define spl_rw_lockdep_on_maybe(rwp) #endif /* CONFIG_LOCKDEP */ static inline int @@ -131,16 +131,17 @@ RW_WRITE_HELD(krwlock_t *rwp) static inline int RW_LOCK_HELD(krwlock_t *rwp) { - return spl_rwsem_is_locked(SEM(rwp)); + return (spl_rwsem_is_locked(SEM(rwp))); } /* - * The following functions must be a #define and not static inline. + * The following functions must be a #define and not static inline. * This ensures that the native linux semaphore functions (down/up) * will be correctly located in the users code which is important * for the built in kernel lock analysis tools */ -#define rw_init(rwp, name, type, arg) \ +/* BEGIN CSTYLED */ +#define rw_init(rwp, name, type, arg) \ ({ \ static struct lock_class_key __key; \ ASSERT(type == RW_DEFAULT || type == RW_NOLOCKDEP); \ @@ -150,12 +151,12 @@ RW_LOCK_HELD(krwlock_t *rwp) spl_rw_set_type(rwp, type); \ }) -#define rw_destroy(rwp) \ +#define rw_destroy(rwp) \ ({ \ VERIFY(!RW_LOCK_HELD(rwp)); \ }) -#define rw_tryenter(rwp, rw) \ +#define rw_tryenter(rwp, rw) \ ({ \ int _rc_ = 0; \ \ @@ -175,7 +176,7 @@ RW_LOCK_HELD(krwlock_t *rwp) _rc_; \ }) -#define rw_enter(rwp, rw) \ +#define rw_enter(rwp, rw) \ ({ \ spl_rw_lockdep_off_maybe(rwp); \ switch (rw) { \ @@ -192,7 +193,7 @@ RW_LOCK_HELD(krwlock_t *rwp) spl_rw_lockdep_on_maybe(rwp); \ }) -#define rw_exit(rwp) \ +#define rw_exit(rwp) \ ({ \ spl_rw_lockdep_off_maybe(rwp); \ if (RW_WRITE_HELD(rwp)) { \ @@ -205,7 +206,7 @@ RW_LOCK_HELD(krwlock_t *rwp) spl_rw_lockdep_on_maybe(rwp); \ }) -#define rw_downgrade(rwp) \ +#define rw_downgrade(rwp) \ ({ \ spl_rw_lockdep_off_maybe(rwp); \ spl_rw_clear_owner(rwp); \ @@ -213,7 +214,7 @@ RW_LOCK_HELD(krwlock_t *rwp) spl_rw_lockdep_on_maybe(rwp); \ }) -#define rw_tryupgrade(rwp) \ +#define rw_tryupgrade(rwp) \ ({ \ int _rc_ = 0; \ \ @@ -227,6 +228,7 @@ RW_LOCK_HELD(krwlock_t *rwp) } \ _rc_; \ }) +/* END CSTYLED */ int spl_rw_init(void); void spl_rw_fini(void); diff --git a/include/sys/sdt.h b/include/sys/sdt.h index 80fb4c32a..2d4679d65 100644 --- a/include/sys/sdt.h +++ b/include/sys/sdt.h @@ -23,8 +23,8 @@ */ #ifndef _SPL_SDT_H -#define _SPL_SDT_H +#define _SPL_SDT_H -#define SET_ERROR(x) (x) +#define SET_ERROR(x) (x) #endif /* SPL_SDT_H */ diff --git a/include/sys/sid.h b/include/sys/sid.h index c5988a6f9..731b62c47 100644 --- a/include/sys/sid.h +++ b/include/sys/sid.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SID_H -#define _SPL_SID_H +#define _SPL_SID_H typedef struct ksiddomain { char *kd_name; @@ -41,21 +41,21 @@ typedef int ksid_t; static inline ksiddomain_t * ksid_lookupdomain(const char *dom) { - ksiddomain_t *kd; + ksiddomain_t *kd; int len = strlen(dom); - kd = kmem_zalloc(sizeof(ksiddomain_t), KM_SLEEP); - kd->kd_name = kmem_zalloc(len + 1, KM_SLEEP); + kd = kmem_zalloc(sizeof (ksiddomain_t), KM_SLEEP); + kd->kd_name = kmem_zalloc(len + 1, KM_SLEEP); memcpy(kd->kd_name, dom, len); - return (kd); + return (kd); } static inline void ksiddomain_rele(ksiddomain_t *ksid) { kmem_free(ksid->kd_name, strlen(ksid->kd_name) + 1); - kmem_free(ksid, sizeof(ksiddomain_t)); + kmem_free(ksid, sizeof (ksiddomain_t)); } #endif /* _SPL_SID_H */ diff --git a/include/sys/signal.h b/include/sys/signal.h index 0c7236390..36b8b5d98 100644 --- a/include/sys/signal.h +++ b/include/sys/signal.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SIGNAL_H -#define _SPL_SIGNAL_H +#define _SPL_SIGNAL_H #include @@ -34,7 +34,8 @@ #define FORREAL 0 /* Usual side-effects */ #define JUSTLOOKING 1 /* Don't stop the process */ -/* The "why" argument indicates the allowable side-effects of the call: +/* + * The "why" argument indicates the allowable side-effects of the call: * * FORREAL: Extract the next pending signal from p_sig into p_cursig; * stop the process if a stop has been requested or if a traced signal @@ -48,7 +49,7 @@ issig(int why) { ASSERT(why == FORREAL || why == JUSTLOOKING); - return signal_pending(current); + return (signal_pending(current)); } #endif /* SPL_SIGNAL_H */ diff --git a/include/sys/stat.h b/include/sys/stat.h index c6ee57ed7..83018e894 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_STAT_H -#define _SPL_STAT_H +#define _SPL_STAT_H #include diff --git a/include/sys/stropts.h b/include/sys/stropts.h index 68c4a0d14..746141fe8 100644 --- a/include/sys/stropts.h +++ b/include/sys/stropts.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_STROPTS_H -#define _SPL_STROPTS_H +#define _SPL_STROPTS_H #endif /* SPL_STROPTS_H */ diff --git a/include/sys/sunddi.h b/include/sys/sunddi.h index 74ca4228f..1bae594c8 100644 --- a/include/sys/sunddi.h +++ b/include/sys/sunddi.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SUNDDI_H -#define _SPL_SUNDDI_H +#define _SPL_SUNDDI_H #include #include @@ -44,9 +44,9 @@ typedef int ddi_devid_t; #define DDI_SUCCESS 0 #define DDI_FAILURE -1 -#define ddi_prop_lookup_string(x1,x2,x3,x4,x5) (*x5 = NULL) -#define ddi_prop_free(x) (void)0 -#define ddi_root_node() (void)0 +#define ddi_prop_lookup_string(x1, x2, x3, x4, x5) (*x5 = NULL) +#define ddi_prop_free(x) (void)0 +#define ddi_root_node() (void)0 extern int ddi_strtoul(const char *, char **, int, unsigned long *); extern int ddi_strtol(const char *, char **, int, long *); diff --git a/include/sys/sunldi.h b/include/sys/sunldi.h index 0831904d6..43462efad 100644 --- a/include/sys/sunldi.h +++ b/include/sys/sunldi.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SUNLDI_H -#define _SPL_SUNLDI_H +#define _SPL_SUNLDI_H #include #include @@ -32,6 +32,6 @@ #include #include -#define SECTOR_SIZE 512 +#define SECTOR_SIZE 512 #endif /* SPL_SUNLDI_H */ diff --git a/include/sys/sysdc.h b/include/sys/sysdc.h index a563c87af..d963774ac 100644 --- a/include/sys/sysdc.h +++ b/include/sys/sysdc.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_SYSDC_H -#define _SPL_SYSDC_H +#define _SPL_SYSDC_H #endif /* SPL_SYSDC_H */ diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 03468d7d0..d083cebda 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SYSMACROS_H -#define _SPL_SYSMACROS_H +#define _SPL_SYSMACROS_H #include #include @@ -39,120 +39,122 @@ #endif #ifndef _KERNEL -#define _KERNEL __KERNEL__ +#define _KERNEL __KERNEL__ #endif -#define FALSE 0 -#define TRUE 1 - -#define INT8_MAX (127) -#define INT8_MIN (-128) -#define UINT8_MAX (255) -#define UINT8_MIN (0) - -#define INT16_MAX (32767) -#define INT16_MIN (-32768) -#define UINT16_MAX (65535) -#define UINT16_MIN (0) - -#define INT32_MAX INT_MAX -#define INT32_MIN INT_MIN -#define UINT32_MAX UINT_MAX -#define UINT32_MIN UINT_MIN - -#define INT64_MAX LLONG_MAX -#define INT64_MIN LLONG_MIN -#define UINT64_MAX ULLONG_MAX -#define UINT64_MIN ULLONG_MIN - -#define NBBY 8 -#define ENOTSUP EOPNOTSUPP - -#define MAXMSGLEN 256 -#define MAXNAMELEN 256 -#define MAXPATHLEN PATH_MAX -#define MAXOFFSET_T LLONG_MAX -#define MAXBSIZE 8192 -#define DEV_BSIZE 512 -#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ - -#define proc_pageout NULL -#define curproc current -#define max_ncpus num_possible_cpus() -#define boot_ncpus num_online_cpus() -#define CPU_SEQID smp_processor_id() -#define _NOTE(x) -#define is_system_labeled() 0 +#define FALSE 0 +#define TRUE 1 + +#define INT8_MAX (127) +#define INT8_MIN (-128) +#define UINT8_MAX (255) +#define UINT8_MIN (0) + +#define INT16_MAX (32767) +#define INT16_MIN (-32768) +#define UINT16_MAX (65535) +#define UINT16_MIN (0) + +#define INT32_MAX INT_MAX +#define INT32_MIN INT_MIN +#define UINT32_MAX UINT_MAX +#define UINT32_MIN UINT_MIN + +#define INT64_MAX LLONG_MAX +#define INT64_MIN LLONG_MIN +#define UINT64_MAX ULLONG_MAX +#define UINT64_MIN ULLONG_MIN + +#define NBBY 8 +#define ENOTSUP EOPNOTSUPP + +#define MAXMSGLEN 256 +#define MAXNAMELEN 256 +#define MAXPATHLEN PATH_MAX +#define MAXOFFSET_T LLONG_MAX +#define MAXBSIZE 8192 +#define DEV_BSIZE 512 +#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ + +#define proc_pageout NULL +#define curproc current +#define max_ncpus num_possible_cpus() +#define boot_ncpus num_online_cpus() +#define CPU_SEQID smp_processor_id() +#define _NOTE(x) +#define is_system_labeled() 0 #ifndef RLIM64_INFINITY -#define RLIM64_INFINITY (~0ULL) +#define RLIM64_INFINITY (~0ULL) #endif -/* 0..MAX_PRIO-1: Process priority +/* + * 0..MAX_PRIO-1: Process priority * 0..MAX_RT_PRIO-1: RT priority tasks * MAX_RT_PRIO..MAX_PRIO-1: SCHED_NORMAL tasks * * Treat shim tasks as SCHED_NORMAL tasks */ -#define minclsyspri (MAX_PRIO-1) -#define maxclsyspri (MAX_RT_PRIO) -#define defclsyspri (DEFAULT_PRIO) +#define minclsyspri (MAX_PRIO-1) +#define maxclsyspri (MAX_RT_PRIO) +#define defclsyspri (DEFAULT_PRIO) #ifndef NICE_TO_PRIO -#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20) +#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20) #endif #ifndef PRIO_TO_NICE -#define PRIO_TO_NICE(prio) ((prio) - MAX_RT_PRIO - 20) +#define PRIO_TO_NICE(prio) ((prio) - MAX_RT_PRIO - 20) #endif /* * Missing macros */ #ifndef PAGESIZE -#define PAGESIZE PAGE_SIZE +#define PAGESIZE PAGE_SIZE #endif #ifndef PAGESHIFT -#define PAGESHIFT PAGE_SHIFT +#define PAGESHIFT PAGE_SHIFT #endif /* from Solaris sys/byteorder.h */ -#define BSWAP_8(x) ((x) & 0xff) -#define BSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8)) -#define BSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16)) -#define BSWAP_64(x) ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32)) +#define BSWAP_8(x) ((x) & 0xff) +#define BSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8)) +#define BSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16)) +#define BSWAP_64(x) ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32)) -/* Map some simple functions. +/* + * Map some simple functions. */ -#define bzero(ptr,size) memset(ptr,0,size) -#define bcopy(src,dest,size) memmove(dest,src,size) -#define bcmp(src,dest,size) memcmp((src), (dest), (size_t)(size)) +#define bzero(ptr, size) memset(ptr, 0, size) +#define bcopy(src, dest, size) memmove(dest, src, size) +#define bcmp(src, dest, size) memcmp((src), (dest), (size_t)(size)) /* Dtrace probes do not exist in the linux kernel */ #ifdef DTRACE_PROBE #undef DTRACE_PROBE #endif /* DTRACE_PROBE */ -#define DTRACE_PROBE(a) ((void)0) +#define DTRACE_PROBE(a) ((void)0) #ifdef DTRACE_PROBE1 #undef DTRACE_PROBE1 #endif /* DTRACE_PROBE1 */ -#define DTRACE_PROBE1(a, b, c) ((void)0) +#define DTRACE_PROBE1(a, b, c) ((void)0) #ifdef DTRACE_PROBE2 #undef DTRACE_PROBE2 #endif /* DTRACE_PROBE2 */ -#define DTRACE_PROBE2(a, b, c, d, e) ((void)0) +#define DTRACE_PROBE2(a, b, c, d, e) ((void)0) #ifdef DTRACE_PROBE3 #undef DTRACE_PROBE3 #endif /* DTRACE_PROBE3 */ -#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0) +#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0) #ifdef DTRACE_PROBE4 #undef DTRACE_PROBE4 #endif /* DTRACE_PROBE4 */ -#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0) +#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0) /* Missing globals */ extern char spl_version[32]; @@ -167,39 +169,39 @@ extern void spl_cleanup(void); #define lowbit(x) __ffs(x) #define highbit64(x) fls64(x) -#define makedevice(maj,min) makedev(maj,min) +#define makedevice(maj, min) makedev(maj, min) /* common macros */ #ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX -#define MAX(a, b) ((a) < (b) ? (b) : (a)) +#define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif #ifndef ABS -#define ABS(a) ((a) < 0 ? -(a) : (a)) +#define ABS(a) ((a) < 0 ? -(a) : (a)) #endif #ifndef DIV_ROUND_UP -#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #endif #ifndef roundup -#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) +#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif #ifndef howmany -#define howmany(x, y) (((x) + ((y) - 1)) / (y)) +#define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif /* * Compatibility macros/typedefs needed for Solaris -> Linux port */ -#define P2ALIGN(x, align) ((x) & -(align)) -#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) -#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1) -#define P2PHASE(x, align) ((x) & ((align) - 1)) -#define P2NPHASE(x, align) (-(x) & ((align) - 1)) -#define ISP2(x) (((x) & ((x) - 1)) == 0) -#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1))==0) -#define P2BOUNDARY(off, len, align) \ +#define P2ALIGN(x, align) ((x) & -(align)) +#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) +#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1) +#define P2PHASE(x, align) ((x) & ((align) - 1)) +#define P2NPHASE(x, align) (-(x) & ((align) - 1)) +#define ISP2(x) (((x) & ((x) - 1)) == 0) +#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) +#define P2BOUNDARY(off, len, align) \ (((off) ^ ((off) + (len) - 1)) > (align) - 1) /* @@ -214,28 +216,28 @@ extern void spl_cleanup(void); * or * P2ROUNDUP_TYPED(x, PAGESIZE, uint64_t) */ -#define P2ALIGN_TYPED(x, align, type) \ - ((type)(x) & -(type)(align)) -#define P2PHASE_TYPED(x, align, type) \ - ((type)(x) & ((type)(align) - 1)) -#define P2NPHASE_TYPED(x, align, type) \ - (-(type)(x) & ((type)(align) - 1)) -#define P2ROUNDUP_TYPED(x, align, type) \ - ((((type)(x) - 1) | ((type)(align) - 1)) + 1) -#define P2END_TYPED(x, align, type) \ - (-(~(type)(x) & -(type)(align))) -#define P2PHASEUP_TYPED(x, align, phase, type) \ - ((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align))) -#define P2CROSS_TYPED(x, y, align, type) \ - (((type)(x) ^ (type)(y)) > (type)(align) - 1) -#define P2SAMEHIGHBIT_TYPED(x, y, type) \ - (((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y))) +#define P2ALIGN_TYPED(x, align, type) \ + ((type)(x) & -(type)(align)) +#define P2PHASE_TYPED(x, align, type) \ + ((type)(x) & ((type)(align) - 1)) +#define P2NPHASE_TYPED(x, align, type) \ + (-(type)(x) & ((type)(align) - 1)) +#define P2ROUNDUP_TYPED(x, align, type) \ + ((((type)(x) - 1) | ((type)(align) - 1)) + 1) +#define P2END_TYPED(x, align, type) \ + (-(~(type)(x) & -(type)(align))) +#define P2PHASEUP_TYPED(x, align, phase, type) \ + ((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align))) +#define P2CROSS_TYPED(x, y, align, type) \ + (((type)(x) ^ (type)(y)) > (type)(align) - 1) +#define P2SAMEHIGHBIT_TYPED(x, y, type) \ + (((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y))) #if defined(_KERNEL) && !defined(_KMEMUSER) && !defined(offsetof) /* avoid any possibility of clashing with version */ -#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) +#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) #endif #endif /* _SPL_SYSMACROS_H */ diff --git a/include/sys/systeminfo.h b/include/sys/systeminfo.h index bc5337fa5..225569158 100644 --- a/include/sys/systeminfo.h +++ b/include/sys/systeminfo.h @@ -23,14 +23,14 @@ */ #ifndef _SPL_SYSTEMINFO_H -#define _SPL_SYSTEMINFO_H +#define _SPL_SYSTEMINFO_H -#define HW_HOSTID_LEN 11 /* minimum buffer size needed */ +#define HW_HOSTID_LEN 11 /* minimum buffer size needed */ /* to hold a decimal or hex */ /* hostid string */ /* Supplemental definitions for Linux. */ -#define HW_HOSTID_PATH "/etc/hostid" /* binary configuration file */ -#define HW_HOSTID_MASK 0xFFFFFFFF /* significant hostid bits */ +#define HW_HOSTID_PATH "/etc/hostid" /* binary configuration file */ +#define HW_HOSTID_MASK 0xFFFFFFFF /* significant hostid bits */ #endif /* SPL_SYSTEMINFO_H */ diff --git a/include/sys/systm.h b/include/sys/systm.h index cd49e14be..2420e7e9d 100644 --- a/include/sys/systm.h +++ b/include/sys/systm.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SYSTM_H -#define _SPL_SYSTM_H +#define _SPL_SYSTM_H #include diff --git a/include/sys/t_lock.h b/include/sys/t_lock.h index f1de9616b..dcdfaeec5 100644 --- a/include/sys/t_lock.h +++ b/include/sys/t_lock.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_T_LOCK_H -#define _SPL_T_LOCK_H +#define _SPL_T_LOCK_H #include #include diff --git a/include/sys/taskq.h b/include/sys/taskq.h index c5ccec715..4d90a3563 100644 --- a/include/sys/taskq.h +++ b/include/sys/taskq.h @@ -94,7 +94,7 @@ typedef struct taskq { taskqid_t tq_lowest_id; /* lowest pend/work id */ struct list_head tq_free_list; /* free taskq_ent_t's */ struct list_head tq_pend_list; /* pending taskq_ent_t's */ - struct list_head tq_prio_list; /* priority pending taskq_ent_t's */ + struct list_head tq_prio_list; /* priority taskq_ent_t's */ struct list_head tq_delay_list; /* delayed taskq_ent_t's */ struct list_head tq_taskqs; /* all taskq_t's */ spl_wait_queue_head_t tq_work_waitq; /* new work waitq */ diff --git a/include/sys/thread.h b/include/sys/thread.h index ae2188d84..80cf49914 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_THREAD_H -#define _SPL_THREAD_H +#define _SPL_THREAD_H #include #include @@ -36,28 +36,30 @@ /* * Thread interfaces */ -#define TP_MAGIC 0x53535353 +#define TP_MAGIC 0x53535353 -#define TS_SLEEP TASK_INTERRUPTIBLE -#define TS_RUN TASK_RUNNING -#define TS_ZOMB EXIT_ZOMBIE -#define TS_STOPPED TASK_STOPPED +#define TS_SLEEP TASK_INTERRUPTIBLE +#define TS_RUN TASK_RUNNING +#define TS_ZOMB EXIT_ZOMBIE +#define TS_STOPPED TASK_STOPPED typedef void (*thread_func_t)(void *); -#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ - __thread_create(stk, stksize, (thread_func_t)func, \ - #func, arg, len, pp, state, pri) -#define thread_exit() __thread_exit() -#define thread_join(t) VERIFY(0) -#define curthread current -#define getcomm() current->comm -#define getpid() current->pid +/* BEGIN CSTYLED */ +#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ + __thread_create(stk, stksize, (thread_func_t)func, \ + #func, arg, len, pp, state, pri) +/* END CSTYLED */ + +#define thread_exit() __thread_exit() +#define thread_join(t) VERIFY(0) +#define curthread current +#define getcomm() current->comm +#define getpid() current->pid extern kthread_t *__thread_create(caddr_t stk, size_t stksize, - thread_func_t func, const char *name, - void *args, size_t len, proc_t *pp, - int state, pri_t pri); + thread_func_t func, const char *name, void *args, size_t len, proc_t *pp, + int state, pri_t pri); extern void __thread_exit(void); extern struct task_struct *spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...); diff --git a/include/sys/timer.h b/include/sys/timer.h index 71190d287..821590e3a 100644 --- a/include/sys/timer.h +++ b/include/sys/timer.h @@ -23,38 +23,37 @@ */ #ifndef _SPL_TIMER_H -#define _SPL_TIMER_H +#define _SPL_TIMER_H #include #include #include -#define lbolt ((clock_t)jiffies) -#define lbolt64 ((int64_t)get_jiffies_64()) +#define lbolt ((clock_t)jiffies) +#define lbolt64 ((int64_t)get_jiffies_64()) -#define ddi_get_lbolt() ((clock_t)jiffies) -#define ddi_get_lbolt64() ((int64_t)get_jiffies_64()) +#define ddi_get_lbolt() ((clock_t)jiffies) +#define ddi_get_lbolt64() ((int64_t)get_jiffies_64()) -#define ddi_time_before(a, b) (typecheck(clock_t, a) && \ +#define ddi_time_before(a, b) (typecheck(clock_t, a) && \ typecheck(clock_t, b) && \ ((a) - (b) < 0)) -#define ddi_time_after(a, b) ddi_time_before(b, a) -#define ddi_time_before_eq(a, b) (!ddi_time_after(a, b)) -#define ddi_time_after_eq(a, b) ddi_time_before_eq(b, a) +#define ddi_time_after(a, b) ddi_time_before(b, a) +#define ddi_time_before_eq(a, b) (!ddi_time_after(a, b)) +#define ddi_time_after_eq(a, b) ddi_time_before_eq(b, a) -#define ddi_time_before64(a, b) (typecheck(int64_t, a) && \ +#define ddi_time_before64(a, b) (typecheck(int64_t, a) && \ typecheck(int64_t, b) && \ ((a) - (b) < 0)) -#define ddi_time_after64(a, b) ddi_time_before64(b, a) -#define ddi_time_before_eq64(a, b) (!ddi_time_after64(a, b)) -#define ddi_time_after_eq64(a, b) ddi_time_before_eq64(b, a) +#define ddi_time_after64(a, b) ddi_time_before64(b, a) +#define ddi_time_before_eq64(a, b) (!ddi_time_after64(a, b)) +#define ddi_time_after_eq64(a, b) ddi_time_before_eq64(b, a) -#define delay(ticks) schedule_timeout_uninterruptible(ticks) +#define delay(ticks) schedule_timeout_uninterruptible(ticks) -#define SEC_TO_TICK(sec) ((sec) * HZ) -#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms) -#define USEC_TO_TICK(us) usecs_to_jiffies(us) -#define NSEC_TO_TICK(ns) usecs_to_jiffies(ns / NSEC_PER_USEC) +#define SEC_TO_TICK(sec) ((sec) * HZ) +#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms) +#define USEC_TO_TICK(us) usecs_to_jiffies(us) +#define NSEC_TO_TICK(ns) usecs_to_jiffies(ns / NSEC_PER_USEC) #endif /* _SPL_TIMER_H */ - diff --git a/include/sys/tsd.h b/include/sys/tsd.h index 4ddaea444..39a291bf3 100644 --- a/include/sys/tsd.h +++ b/include/sys/tsd.h @@ -22,14 +22,14 @@ */ #ifndef _SPL_TSD_H -#define _SPL_TSD_H +#define _SPL_TSD_H #include -#define TSD_HASH_TABLE_BITS_DEFAULT 9 -#define TSD_KEYS_MAX 32768 -#define DTOR_PID (PID_MAX_LIMIT+1) -#define PID_KEY (TSD_KEYS_MAX+1) +#define TSD_HASH_TABLE_BITS_DEFAULT 9 +#define TSD_KEYS_MAX 32768 +#define DTOR_PID (PID_MAX_LIMIT+1) +#define PID_KEY (TSD_KEYS_MAX+1) typedef void (*dtor_func_t)(void *); diff --git a/include/sys/types.h b/include/sys/types.h index b5359c7e8..e159dda21 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -29,14 +29,14 @@ #include #ifndef ULLONG_MAX -#define ULLONG_MAX (~0ULL) +#define ULLONG_MAX (~0ULL) #endif #ifndef LLONG_MAX -#define LLONG_MAX ((long long)(~0ULL>>1)) +#define LLONG_MAX ((long long)(~0ULL>>1)) #endif -typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t; +typedef enum { B_FALSE = 0, B_TRUE = 1 } boolean_t; typedef unsigned long intptr_t; typedef unsigned long ulong_t; typedef unsigned int uint_t; diff --git a/include/sys/u8_textprep.h b/include/sys/u8_textprep.h index f25cf1b2b..6e76651d5 100644 --- a/include/sys/u8_textprep.h +++ b/include/sys/u8_textprep.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_U8_TEXTPREP_H -#define _SPL_U8_TEXTPREP_H +#define _SPL_U8_TEXTPREP_H #endif /* SPL_U8_TEXTPREP_H */ diff --git a/include/sys/uio.h b/include/sys/uio.h index b34741523..64c452b8d 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -24,7 +24,7 @@ */ #ifndef _SPL_UIO_H -#define _SPL_UIO_H +#define _SPL_UIO_H #include #include @@ -34,15 +34,15 @@ typedef struct iovec iovec_t; typedef enum uio_rw { - UIO_READ = 0, - UIO_WRITE = 1, + UIO_READ = 0, + UIO_WRITE = 1, } uio_rw_t; typedef enum uio_seg { - UIO_USERSPACE = 0, - UIO_SYSSPACE = 1, - UIO_USERISPACE= 2, - UIO_BVEC = 3, + UIO_USERSPACE = 0, + UIO_SYSSPACE = 1, + UIO_USERISPACE = 2, + UIO_BVEC = 3, } uio_seg_t; typedef struct uio { @@ -71,7 +71,7 @@ typedef enum xuio_type { } xuio_type_t; -#define UIOA_IOV_MAX 16 +#define UIOA_IOV_MAX 16 typedef struct uioa_page_s { int uioa_pfncnt; @@ -100,7 +100,7 @@ typedef struct xuio { } xu_ext; } xuio_t; -#define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv -#define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw +#define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv +#define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw #endif /* SPL_UIO_H */ diff --git a/include/sys/unistd.h b/include/sys/unistd.h index 24eab763c..d86de891c 100644 --- a/include/sys/unistd.h +++ b/include/sys/unistd.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_UNISTD_H -#define _SPL_UNISTD_H +#define _SPL_UNISTD_H #endif /* SPL_UNISTD_H */ diff --git a/include/sys/user.h b/include/sys/user.h index 2dc3ed0c5..b12cb240e 100644 --- a/include/sys/user.h +++ b/include/sys/user.h @@ -21,7 +21,7 @@ */ #ifndef _SPL_USER_H -#define _SPL_USER_H +#define _SPL_USER_H /* * We have uf_info_t for areleasef(). We implement areleasef() using a global @@ -37,6 +37,6 @@ struct uf_info; typedef struct uf_info uf_info_t; -#define P_FINFO(x) ((uf_info_t *)x) +#define P_FINFO(x) ((uf_info_t *)x) #endif /* SPL_USER_H */ diff --git a/include/sys/va_list.h b/include/sys/va_list.h index 4468d9e89..62d18b9ae 100644 --- a/include/sys/va_list.h +++ b/include/sys/va_list.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_VA_LIST_H -#define _SPL_VA_LIST_H +#define _SPL_VA_LIST_H #endif /* SPL_VA_LIST_H */ diff --git a/include/sys/varargs.h b/include/sys/varargs.h index b992e8430..cdb73fbbd 100644 --- a/include/sys/varargs.h +++ b/include/sys/varargs.h @@ -23,8 +23,8 @@ */ #ifndef _SPL_VARARGS_H -#define _SPL_VARARGS_H +#define _SPL_VARARGS_H -#define __va_list va_list +#define __va_list va_list #endif /* SPL_VARARGS_H */ diff --git a/include/sys/vfs.h b/include/sys/vfs.h index 30fcfb476..0d5e1d51d 100644 --- a/include/sys/vfs.h +++ b/include/sys/vfs.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_ZFS_H -#define _SPL_ZFS_H +#define _SPL_ZFS_H #include #include @@ -40,7 +40,7 @@ typedef struct spl_fid { long fid_pad; struct { ushort_t len; /* length of data in bytes */ - char data[MAXFIDSZ];/* data (variable len) */ + char data[MAXFIDSZ]; /* data (variable len) */ } _fid; } un; } fid_t; diff --git a/include/sys/vfs_opreg.h b/include/sys/vfs_opreg.h index 1d20997ed..1d48f2d5a 100644 --- a/include/sys/vfs_opreg.h +++ b/include/sys/vfs_opreg.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_OPREG_H -#define _SPL_OPREG_H +#define _SPL_OPREG_H #endif /* SPL_OPREG_H */ diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index f048c318c..2b48fe0e3 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_VMSYSTM_H -#define _SPL_VMSYSTM_H +#define _SPL_VMSYSTM_H #include #include @@ -48,9 +48,9 @@ copyin(const void *from, void *to, size_t len) { /* On error copyin routine returns -1 */ if (xcopyin(from, to, len)) - return -1; + return (-1); - return 0; + return (0); } static __inline__ int @@ -58,9 +58,9 @@ copyout(const void *from, void *to, size_t len) { /* On error copyout routine returns -1 */ if (xcopyout(from, to, len)) - return -1; + return (-1); - return 0; + return (0); } static __inline__ int @@ -69,7 +69,7 @@ copyinstr(const void *from, void *to, size_t len, size_t *done) size_t rc; if (len == 0) - return -ENAMETOOLONG; + return (-ENAMETOOLONG); /* XXX: Should return ENAMETOOLONG if 'strlen(from) > len' */ @@ -78,7 +78,7 @@ copyinstr(const void *from, void *to, size_t len, size_t *done) if (done != NULL) *done = rc; - return 0; + return (0); } #endif /* SPL_VMSYSTM_H */ diff --git a/include/sys/vnode.h b/include/sys/vnode.h index 9ae48c7f0..946654b7b 100644 --- a/include/sys/vnode.h +++ b/include/sys/vnode.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_VNODE_H -#define _SPL_VNODE_H +#define _SPL_VNODE_H #include #include @@ -49,25 +49,25 @@ * was properly split in to O_SYNC and O_DSYNC respectively. */ #ifndef O_DSYNC -#define O_DSYNC O_SYNC +#define O_DSYNC O_SYNC #endif -#define FREAD 1 -#define FWRITE 2 -#define FCREAT O_CREAT -#define FTRUNC O_TRUNC -#define FOFFMAX O_LARGEFILE -#define FSYNC O_SYNC -#define FDSYNC O_DSYNC -#define FRSYNC O_SYNC -#define FEXCL O_EXCL -#define FDIRECT O_DIRECT -#define FAPPEND O_APPEND +#define FREAD 1 +#define FWRITE 2 +#define FCREAT O_CREAT +#define FTRUNC O_TRUNC +#define FOFFMAX O_LARGEFILE +#define FSYNC O_SYNC +#define FDSYNC O_DSYNC +#define FRSYNC O_SYNC +#define FEXCL O_EXCL +#define FDIRECT O_DIRECT +#define FAPPEND O_APPEND -#define FNODSYNC 0x10000 /* fsync pseudo flag */ -#define FNOFOLLOW 0x20000 /* don't follow symlinks */ +#define FNODSYNC 0x10000 /* fsync pseudo flag */ +#define FNOFOLLOW 0x20000 /* don't follow symlinks */ -#define F_FREESP 11 /* Free file space */ +#define F_FREESP 11 /* Free file space */ /* @@ -79,30 +79,30 @@ #undef AT_UID #undef AT_GID -#define AT_MODE ATTR_MODE -#define AT_UID ATTR_UID -#define AT_GID ATTR_GID -#define AT_SIZE ATTR_SIZE -#define AT_ATIME ATTR_ATIME -#define AT_MTIME ATTR_MTIME -#define AT_CTIME ATTR_CTIME +#define AT_MODE ATTR_MODE +#define AT_UID ATTR_UID +#define AT_GID ATTR_GID +#define AT_SIZE ATTR_SIZE +#define AT_ATIME ATTR_ATIME +#define AT_MTIME ATTR_MTIME +#define AT_CTIME ATTR_CTIME -#define ATTR_XVATTR (1 << 31) -#define AT_XVATTR ATTR_XVATTR +#define ATTR_XVATTR (1 << 31) +#define AT_XVATTR ATTR_XVATTR -#define ATTR_IATTR_MASK (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \ +#define ATTR_IATTR_MASK (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \ ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_FILE) -#define CRCREAT 0x01 -#define RMFILE 0x02 +#define CRCREAT 0x01 +#define RMFILE 0x02 -#define B_INVAL 0x01 -#define B_TRUNC 0x02 +#define B_INVAL 0x01 +#define B_TRUNC 0x02 -#define LOOKUP_DIR 0x01 -#define LOOKUP_XATTR 0x02 -#define CREATE_XATTR_DIR 0x04 -#define ATTR_NOACLCHECK 0x20 +#define LOOKUP_DIR 0x01 +#define LOOKUP_XATTR 0x02 +#define CREATE_XATTR_DIR 0x04 +#define ATTR_NOACLCHECK 0x20 typedef enum vtype { VNON = 0, @@ -121,8 +121,8 @@ typedef enum vtype { typedef struct vattr { enum vtype va_type; /* vnode type */ - u_int va_mask; /* attribute bit-mask */ - u_short va_mode; /* acc mode */ + uint_t va_mask; /* attribute bit-mask */ + ushort_t va_mode; /* acc mode */ uid_t va_uid; /* owner uid */ gid_t va_gid; /* owner gid */ long va_fsid; /* fs id */ @@ -168,12 +168,12 @@ void vn_free(vnode_t *vp); extern vtype_t vn_mode_to_vtype(mode_t); extern mode_t vn_vtype_to_mode(vtype_t); extern int vn_open(const char *path, uio_seg_t seg, int flags, int mode, - vnode_t **vpp, int x1, void *x2); + vnode_t **vpp, int x1, void *x2); extern int vn_openat(const char *path, uio_seg_t seg, int flags, int mode, - vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd); + vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd); extern int vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, - offset_t off, uio_seg_t seg, int x1, rlim64_t x2, - void *x3, ssize_t *residp); + offset_t off, uio_seg_t seg, int x1, rlim64_t x2, + void *x3, ssize_t *residp); extern int vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4); extern int vn_seek(vnode_t *vp, offset_t o, offset_t *op, void *ct); @@ -189,16 +189,16 @@ extern int vn_set_pwd(const char *filename); int spl_vn_init(void); void spl_vn_fini(void); -#define VOP_CLOSE vn_close -#define VOP_SEEK vn_seek -#define VOP_GETATTR vn_getattr -#define VOP_FSYNC vn_fsync -#define VOP_SPACE vn_space -#define VOP_PUTPAGE(vp, o, s, f, x1, x2) ((void)0) -#define vn_is_readonly(vp) 0 -#define getf vn_getf -#define releasef vn_releasef -#define areleasef vn_areleasef +#define VOP_CLOSE vn_close +#define VOP_SEEK vn_seek +#define VOP_GETATTR vn_getattr +#define VOP_FSYNC vn_fsync +#define VOP_SPACE vn_space +#define VOP_PUTPAGE(vp, o, s, f, x1, x2) ((void)0) +#define vn_is_readonly(vp) 0 +#define getf vn_getf +#define releasef vn_releasef +#define areleasef vn_areleasef extern vnode_t *rootdir; diff --git a/include/sys/zmod.h b/include/sys/zmod.h index d708c6612..5380bd6fd 100644 --- a/include/sys/zmod.h +++ b/include/sys/zmod.h @@ -20,7 +20,8 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * + * * z_compress_level/z_uncompress are nearly identical copies of the * compress2/uncompress functions provided by the official zlib package * available at http://zlib.net/. The only changes made we to slightly @@ -53,7 +54,7 @@ */ #ifndef _SPL_ZMOD_H -#define _SPL_ZMOD_H +#define _SPL_ZMOD_H #include #include diff --git a/include/sys/zone.h b/include/sys/zone.h index 4ed2a836f..b2efd13b8 100644 --- a/include/sys/zone.h +++ b/include/sys/zone.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_ZONE_H -#define _SPL_ZONE_H +#define _SPL_ZONE_H #include diff --git a/include/unistd.h b/include/unistd.h index 24eab763c..d86de891c 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_UNISTD_H -#define _SPL_UNISTD_H +#define _SPL_UNISTD_H #endif /* SPL_UNISTD_H */ diff --git a/include/util/qsort.h b/include/util/qsort.h index 5dc0b446b..90ae6e4c2 100644 --- a/include/util/qsort.h +++ b/include/util/qsort.h @@ -23,10 +23,10 @@ */ #ifndef _SPL_QSORT_H -#define _SPL_QSORT_H +#define _SPL_QSORT_H #include -#define qsort(base, num, size, cmp) sort(base, num, size, cmp, NULL) +#define qsort(base, num, size, cmp) sort(base, num, size, cmp, NULL) #endif /* SPL_QSORT_H */ diff --git a/include/util/sscanf.h b/include/util/sscanf.h index 561918d65..9788234bb 100644 --- a/include/util/sscanf.h +++ b/include/util/sscanf.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_UTIL_SSCANF_H -#define _SPL_UTIL_SSCANF_H +#define _SPL_UTIL_SSCANF_H #endif /* SPL_UTIL_SSCAN_H */ diff --git a/include/vm/anon.h b/include/vm/anon.h index a09f47c9f..706734ff3 100644 --- a/include/vm/anon.h +++ b/include/vm/anon.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_VM_ANON_H -#define _SPL_VM_ANON_H +#define _SPL_VM_ANON_H #endif /* SPL_VM_ANON_H */ diff --git a/include/vm/pvn.h b/include/vm/pvn.h index df916e68f..1011e6cd8 100644 --- a/include/vm/pvn.h +++ b/include/vm/pvn.h @@ -23,6 +23,6 @@ */ #ifndef _SPL_VM_PVN_H -#define _SPL_VM_PVN_H +#define _SPL_VM_PVN_H #endif /* SPL_VM_PVN_H */ diff --git a/include/vm/seg_kmem.h b/include/vm/seg_kmem.h index 64b9688bd..a0ab7fce6 100644 --- a/include/vm/seg_kmem.h +++ b/include/vm/seg_kmem.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_SEG_KMEM_H -#define _SPL_SEG_KMEM_H +#define _SPL_SEG_KMEM_H #include diff --git a/module/spl/spl-atomic.c b/module/spl/spl-atomic.c index 4c48684ba..47ed1886e 100644 --- a/module/spl/spl-atomic.c +++ b/module/spl/spl-atomic.c @@ -20,18 +20,12 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Atomic Implementation. */ #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM -#endif - -#define DEBUG_SUBSYSTEM S_ATOMIC - #ifdef ATOMIC_SPINLOCK /* Global atomic lock declarations */ DEFINE_SPINLOCK(atomic32_lock); diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c index 4778fb256..f0060bbdc 100644 --- a/module/spl/spl-condvar.c +++ b/module/spl/spl-condvar.c @@ -335,8 +335,8 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t expire_time, * Compatibility wrapper for the cv_timedwait_hires() Illumos interface. */ static clock_t -cv_timedwait_hires_common(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, - int flag, int state) +cv_timedwait_hires_common(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, + hrtime_t res, int flag, int state) { if (res > 1) { /* @@ -363,8 +363,8 @@ cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, EXPORT_SYMBOL(cv_timedwait_hires); clock_t -cv_timedwait_sig_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, - int flag) +cv_timedwait_sig_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, + hrtime_t res, int flag) { return (cv_timedwait_hires_common(cvp, mp, tim, res, flag, TASK_INTERRUPTIBLE)); diff --git a/module/spl/spl-cred.c b/module/spl/spl-cred.c index f4431db7f..ea3e903f9 100644 --- a/module/spl/spl-cred.c +++ b/module/spl/spl-cred.c @@ -20,18 +20,12 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Credential Implementation. */ #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM -#endif - -#define DEBUG_SUBSYSTEM S_CRED - static int #ifdef HAVE_KUIDGID_T cr_groups_search(const struct group_info *group_info, kgid_t grp) @@ -43,7 +37,7 @@ cr_groups_search(const struct group_info *group_info, gid_t grp) int cmp; if (!group_info) - return 0; + return (0); left = 0; right = group_info->ngroups; @@ -57,16 +51,16 @@ cr_groups_search(const struct group_info *group_info, gid_t grp) else if (cmp < 0) right = mid; else - return 1; + return (1); } - return 0; + return (0); } /* Hold a reference on the credential */ void crhold(cred_t *cr) { - (void)get_cred((const cred_t *)cr); + (void) get_cred((const cred_t *)cr); } /* Free a reference on the credential */ @@ -96,7 +90,7 @@ crgetngroups(const cred_t *cr) rc = NGROUPS_PER_BLOCK; } #endif - return rc; + return (rc); } /* @@ -119,7 +113,7 @@ crgetgroups(const cred_t *cr) if (gi->nblocks > 0) gids = KGIDP_TO_SGIDP(gi->blocks[0]); #endif - return gids; + return (gids); } /* Check if the passed gid is available in supplied credential. */ @@ -132,63 +126,63 @@ groupmember(gid_t gid, const cred_t *cr) gi = cr->group_info; rc = cr_groups_search(gi, SGID_TO_KGID(gid)); - return rc; + return (rc); } /* Return the effective user id */ uid_t crgetuid(const cred_t *cr) { - return KUID_TO_SUID(cr->euid); + return (KUID_TO_SUID(cr->euid)); } /* Return the real user id */ uid_t crgetruid(const cred_t *cr) { - return KUID_TO_SUID(cr->uid); + return (KUID_TO_SUID(cr->uid)); } /* Return the saved user id */ uid_t crgetsuid(const cred_t *cr) { - return KUID_TO_SUID(cr->suid); + return (KUID_TO_SUID(cr->suid)); } /* Return the filesystem user id */ uid_t crgetfsuid(const cred_t *cr) { - return KUID_TO_SUID(cr->fsuid); + return (KUID_TO_SUID(cr->fsuid)); } /* Return the effective group id */ gid_t crgetgid(const cred_t *cr) { - return KGID_TO_SGID(cr->egid); + return (KGID_TO_SGID(cr->egid)); } /* Return the real group id */ gid_t crgetrgid(const cred_t *cr) { - return KGID_TO_SGID(cr->gid); + return (KGID_TO_SGID(cr->gid)); } /* Return the saved group id */ gid_t crgetsgid(const cred_t *cr) { - return KGID_TO_SGID(cr->sgid); + return (KGID_TO_SGID(cr->sgid)); } /* Return the filesystem group id */ gid_t crgetfsgid(const cred_t *cr) { - return KGID_TO_SGID(cr->fsgid); + return (KGID_TO_SGID(cr->fsgid)); } EXPORT_SYMBOL(crhold); diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 28c5258ef..33a8df898 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Error Implementation. */ @@ -36,8 +36,7 @@ */ unsigned int spl_panic_halt; module_param(spl_panic_halt, uint, 0644); -MODULE_PARM_DESC(spl_panic_halt, - "Cause kernel panic on assertion failures"); +MODULE_PARM_DESC(spl_panic_halt, "Cause kernel panic on assertion failures"); /* * Limit the number of stack traces dumped to not more than 5 every diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index b5c9a9aef..efd901094 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Generic Implementation. */ @@ -109,13 +109,14 @@ spl_rand_next(uint64_t *s) { static inline void spl_rand_jump(uint64_t *s) { - static const uint64_t JUMP[] = { 0x8a5cd789635d2dff, 0x121fd2155c472f96 }; + static const uint64_t JUMP[] = + { 0x8a5cd789635d2dff, 0x121fd2155c472f96 }; uint64_t s0 = 0; uint64_t s1 = 0; int i, b; - for(i = 0; i < sizeof JUMP / sizeof *JUMP; i++) - for(b = 0; b < 64; b++) { + for (i = 0; i < sizeof (JUMP) / sizeof (*JUMP); i++) + for (b = 0; b < 64; b++) { if (JUMP[i] & 1ULL << b) { s0 ^= s[0]; s1 ^= s[1]; @@ -187,16 +188,16 @@ nlz64(uint64_t x) { register int n = 0; if (x == 0) - return 64; + return (64); - if (x <= 0x00000000FFFFFFFFULL) {n = n + 32; x = x << 32;} - if (x <= 0x0000FFFFFFFFFFFFULL) {n = n + 16; x = x << 16;} - if (x <= 0x00FFFFFFFFFFFFFFULL) {n = n + 8; x = x << 8;} - if (x <= 0x0FFFFFFFFFFFFFFFULL) {n = n + 4; x = x << 4;} - if (x <= 0x3FFFFFFFFFFFFFFFULL) {n = n + 2; x = x << 2;} - if (x <= 0x7FFFFFFFFFFFFFFFULL) {n = n + 1;} + if (x <= 0x00000000FFFFFFFFULL) { n = n + 32; x = x << 32; } + if (x <= 0x0000FFFFFFFFFFFFULL) { n = n + 16; x = x << 16; } + if (x <= 0x00FFFFFFFFFFFFFFULL) { n = n + 8; x = x << 8; } + if (x <= 0x0FFFFFFFFFFFFFFFULL) { n = n + 4; x = x << 4; } + if (x <= 0x3FFFFFFFFFFFFFFFULL) { n = n + 2; x = x << 2; } + if (x <= 0x7FFFFFFFFFFFFFFFULL) { n = n + 1; } - return n; + return (n); } /* @@ -207,7 +208,7 @@ static inline uint64_t __div_u64(uint64_t u, uint32_t v) { (void) do_div(u, v); - return u; + return (u); } /* @@ -227,7 +228,7 @@ __udivdi3(uint64_t u, uint64_t v) if (v >> 32 == 0) { // If v < 2**32: if (u >> 32 < v) { // If u/v cannot overflow, - return __div_u64(u, v); // just do one division. + return (__div_u64(u, v)); // just do one division. } else { // If u/v would overflow: u1 = u >> 32; // Break u into two halves. u0 = u & 0xFFFFFFFF; @@ -235,7 +236,7 @@ __udivdi3(uint64_t u, uint64_t v) k = u1 - q1 * v; // First remainder, < v. u0 += (k << 32); q0 = __div_u64(u0, v); // Seconds quotient digit. - return (q1 << 32) + q0; + return ((q1 << 32) + q0); } } else { // If v >= 2**32: n = nlz64(v); // 0 <= n <= 31. @@ -249,7 +250,7 @@ __udivdi3(uint64_t u, uint64_t v) if ((u - q0 * v) >= v) q0 = q0 + 1; // Now q0 is correct. - return q0; + return (q0); } } EXPORT_SYMBOL(__udivdi3); @@ -263,7 +264,7 @@ __divdi3(int64_t u, int64_t v) int64_t q, t; q = __udivdi3(abs64(u), abs64(v)); t = (u ^ v) >> 63; // If u, v have different - return (q ^ t) - t; // signs, negate q. + return ((q ^ t) - t); // signs, negate q. } EXPORT_SYMBOL(__divdi3); @@ -344,9 +345,11 @@ __aeabi_uldivmod(uint64_t u, uint64_t v) register uint32_t r2 asm("r2") = (mod & 0xFFFFFFFF); register uint32_t r3 asm("r3") = (mod >> 32); + /* BEGIN CSTYLED */ asm volatile("" : "+r"(r0), "+r"(r1), "+r"(r2),"+r"(r3) /* output */ : "r"(r0), "r"(r1), "r"(r2), "r"(r3)); /* input */ + /* END CSTYLED */ return; /* r0; */ } @@ -367,9 +370,11 @@ __aeabi_ldivmod(int64_t u, int64_t v) register uint32_t r2 asm("r2") = (mod & 0xFFFFFFFF); register uint32_t r3 asm("r3") = (mod >> 32); + /* BEGIN CSTYLED */ asm volatile("" : "+r"(r0), "+r"(r1), "+r"(r2),"+r"(r3) /* output */ : "r"(r0), "r"(r1), "r"(r2), "r"(r3)); /* input */ + /* END CSTYLED */ return; /* r0; */ } @@ -378,7 +383,8 @@ EXPORT_SYMBOL(__aeabi_ldivmod); #endif /* __arm || __arm__ */ #endif /* BITS_PER_LONG */ -/* NOTE: The strtoxx behavior is solely based on my reading of the Solaris +/* + * NOTE: The strtoxx behavior is solely based on my reading of the Solaris * ddi_strtol(9F) man page. I have not verified the behavior of these * functions against their Solaris counterparts. It is possible that I * may have misinterpreted the man page or the man page is incorrect. @@ -388,28 +394,28 @@ int ddi_strtol(const char *, char **, int, long *); int ddi_strtoull(const char *, char **, int, unsigned long long *); int ddi_strtoll(const char *, char **, int, long long *); -#define define_ddi_strtoux(type, valtype) \ +#define define_ddi_strtoux(type, valtype) \ int ddi_strtou##type(const char *str, char **endptr, \ - int base, valtype *result) \ + int base, valtype *result) \ { \ valtype last_value, value = 0; \ char *ptr = (char *)str; \ int flag = 1, digit; \ \ if (strlen(ptr) == 0) \ - return EINVAL; \ + return (EINVAL); \ \ /* Auto-detect base based on prefix */ \ if (!base) { \ if (str[0] == '0') { \ - if (tolower(str[1])=='x' && isxdigit(str[2])) { \ + if (tolower(str[1]) == 'x' && isxdigit(str[2])) { \ base = 16; /* hex */ \ ptr += 2; \ } else if (str[1] >= '0' && str[1] < 8) { \ base = 8; /* octal */ \ ptr += 1; \ } else { \ - return EINVAL; \ + return (EINVAL); \ } \ } else { \ base = 10; /* decimal */ \ @@ -430,7 +436,7 @@ int ddi_strtou##type(const char *str, char **endptr, \ last_value = value; \ value = value * base + digit; \ if (last_value > value) /* Overflow */ \ - return ERANGE; \ + return (ERANGE); \ \ flag = 1; \ ptr++; \ @@ -442,12 +448,12 @@ int ddi_strtou##type(const char *str, char **endptr, \ if (endptr) \ *endptr = (char *)(flag ? ptr : str); \ \ - return 0; \ + return (0); \ } \ -#define define_ddi_strtox(type, valtype) \ +#define define_ddi_strtox(type, valtype) \ int ddi_strto##type(const char *str, char **endptr, \ - int base, valtype *result) \ + int base, valtype *result) \ { \ int rc; \ \ @@ -463,7 +469,7 @@ int ddi_strto##type(const char *str, char **endptr, \ rc = ddi_strtou##type(str, endptr, base, result); \ } \ \ - return rc; \ + return (rc); \ } define_ddi_strtoux(l, unsigned long) @@ -482,10 +488,10 @@ ddi_copyin(const void *from, void *to, size_t len, int flags) /* Fake ioctl() issued by kernel, 'from' is a kernel address */ if (flags & FKIOCTL) { memcpy(to, from, len); - return 0; + return (0); } - return copyin(from, to, len); + return (copyin(from, to, len)); } EXPORT_SYMBOL(ddi_copyin); @@ -495,10 +501,10 @@ ddi_copyout(const void *from, void *to, size_t len, int flags) /* Fake ioctl() issued by kernel, 'from' is a kernel address */ if (flags & FKIOCTL) { memcpy(to, from, len); - return 0; + return (0); } - return copyout(from, to, len); + return (copyout(from, to, len)); } EXPORT_SYMBOL(ddi_copyout); @@ -559,7 +565,7 @@ hostid_read(uint32_t *hostid) return (error); } - if (size < sizeof(HW_HOSTID_MASK)) { + if (size < sizeof (HW_HOSTID_MASK)) { kobj_close_file(file); return (EINVAL); } @@ -568,7 +574,7 @@ hostid_read(uint32_t *hostid) * Read directly into the variable like eglibc does. * Short reads are okay; native behavior is preserved. */ - error = kobj_read_file(file, (char *)&value, sizeof(value), 0); + error = kobj_read_file(file, (char *)&value, sizeof (value), 0); if (error < 0) { kobj_close_file(file); return (EIO); @@ -578,7 +584,7 @@ hostid_read(uint32_t *hostid) *hostid = (value & HW_HOSTID_MASK); kobj_close_file(file); - return 0; + return (0); } /* @@ -704,7 +710,7 @@ spl_init(void) goto out10; printk(KERN_NOTICE "SPL: Loaded module v%s-%s%s\n", SPL_META_VERSION, - SPL_META_RELEASE, SPL_DEBUG_STR); + SPL_META_RELEASE, SPL_DEBUG_STR); return (rc); out10: @@ -727,8 +733,8 @@ out2: spl_kvmem_fini(); out1: printk(KERN_NOTICE "SPL: Failed to Load Solaris Porting Layer " - "v%s-%s%s, rc = %d\n", SPL_META_VERSION, SPL_META_RELEASE, - SPL_DEBUG_STR, rc); + "v%s-%s%s, rc = %d\n", SPL_META_VERSION, SPL_META_RELEASE, + SPL_DEBUG_STR, rc); return (rc); } @@ -737,7 +743,7 @@ static void __exit spl_fini(void) { printk(KERN_NOTICE "SPL: Unloaded module v%s-%s%s\n", - SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR); + SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR); spl_zlib_fini(); spl_kstat_fini(); spl_proc_fini(); diff --git a/module/spl/spl-kmem-cache.c b/module/spl/spl-kmem-cache.c index 36686692b..e4bcdd825 100644 --- a/module/spl/spl-kmem-cache.c +++ b/module/spl/spl-kmem-cache.c @@ -134,8 +134,8 @@ MODULE_PARM_DESC(spl_kmem_cache_slab_limit, * have been deemed costly by the kernel. */ unsigned int spl_kmem_cache_kmem_limit = - ((1 << (PAGE_ALLOC_COSTLY_ORDER - 1)) * PAGE_SIZE) / - SPL_KMEM_CACHE_OBJ_PER_SLAB; + ((1 << (PAGE_ALLOC_COSTLY_ORDER - 1)) * PAGE_SIZE) / + SPL_KMEM_CACHE_OBJ_PER_SLAB; module_param(spl_kmem_cache_kmem_limit, uint, 0644); MODULE_PARM_DESC(spl_kmem_cache_kmem_limit, "Objects less than N bytes use the kmalloc"); @@ -1000,15 +1000,15 @@ spl_kmem_cache_create(char *name, size_t size, size_t align, #endif #if defined(HAVE_KMEM_CACHE_CREATE_USERCOPY) - /* - * Newer grsec patchset uses kmem_cache_create_usercopy() - * instead of SLAB_USERCOPY flag - */ - skc->skc_linux_cache = kmem_cache_create_usercopy( - skc->skc_name, size, align, slabflags, 0, size, NULL); + /* + * Newer grsec patchset uses kmem_cache_create_usercopy() + * instead of SLAB_USERCOPY flag + */ + skc->skc_linux_cache = kmem_cache_create_usercopy( + skc->skc_name, size, align, slabflags, 0, size, NULL); #else - skc->skc_linux_cache = kmem_cache_create( - skc->skc_name, size, align, slabflags, NULL); + skc->skc_linux_cache = kmem_cache_create( + skc->skc_name, size, align, slabflags, NULL); #endif if (skc->skc_linux_cache == NULL) { rc = ENOMEM; @@ -1186,7 +1186,7 @@ spl_cache_grow_work(void *data) spl_kmem_alloc_t *ska = (spl_kmem_alloc_t *)data; spl_kmem_cache_t *skc = ska->ska_cache; - (void)__spl_cache_grow(skc, ska->ska_flags); + (void) __spl_cache_grow(skc, ska->ska_flags); atomic_dec(&skc->skc_ref); smp_mb__before_atomic(); diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 41bec75d2..bf9c6b179 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -383,7 +383,7 @@ spl_kmem_free_track(const void *ptr, size_t size) { kmem_debug_t *dptr; - /* Ignore NULL pointer since we haven't tracked it at all*/ + /* Ignore NULL pointer since we haven't tracked it at all */ if (ptr == NULL) return; diff --git a/module/spl/spl-kobj.c b/module/spl/spl-kobj.c index 6191163a8..7019369bd 100644 --- a/module/spl/spl-kobj.c +++ b/module/spl/spl-kobj.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Kobj Implementation. */ @@ -33,7 +33,7 @@ kobj_open_file(const char *name) vnode_t *vp; int rc; - file = kmalloc(sizeof(_buf_t), kmem_flags_convert(KM_SLEEP)); + file = kmalloc(sizeof (_buf_t), kmem_flags_convert(KM_SLEEP)); if (file == NULL) return ((_buf_t *)-1UL); @@ -52,7 +52,7 @@ void kobj_close_file(struct _buf *file) { VOP_CLOSE(file->vp, 0, 0, 0, 0, 0); - kfree(file); + kfree(file); } /* kobj_close_file() */ EXPORT_SYMBOL(kobj_close_file); @@ -72,15 +72,15 @@ EXPORT_SYMBOL(kobj_read_file); int kobj_get_filesize(struct _buf *file, uint64_t *size) { - vattr_t vap; + vattr_t vap; int rc; rc = VOP_GETATTR(file->vp, &vap, 0, 0, NULL); if (rc) return (rc); - *size = vap.va_size; + *size = vap.va_size; - return (rc); + return (rc); } /* kobj_get_filesize() */ EXPORT_SYMBOL(kobj_get_filesize); diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 4517824e7..70c0c98f8 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Kstat Implementation. */ @@ -30,7 +30,7 @@ #include #ifndef HAVE_PDE_DATA -#define PDE_DATA(x) (PDE(x)->data) +#define PDE_DATA(x) (PDE(x)->data) #endif static kmutex_t kstat_module_lock; @@ -41,13 +41,13 @@ static int kstat_resize_raw(kstat_t *ksp) { if (ksp->ks_raw_bufsize == KSTAT_RAW_MAX) - return ENOMEM; + return (ENOMEM); vmem_free(ksp->ks_raw_buf, ksp->ks_raw_bufsize); ksp->ks_raw_bufsize = MIN(ksp->ks_raw_bufsize * 2, KSTAT_RAW_MAX); ksp->ks_raw_buf = vmem_alloc(ksp->ks_raw_bufsize, KM_SLEEP); - return 0; + return (0); } void @@ -119,210 +119,212 @@ EXPORT_SYMBOL(kstat_runq_exit); static int kstat_seq_show_headers(struct seq_file *f) { - kstat_t *ksp = (kstat_t *)f->private; + kstat_t *ksp = (kstat_t *)f->private; int rc = 0; - ASSERT(ksp->ks_magic == KS_MAGIC); + ASSERT(ksp->ks_magic == KS_MAGIC); - seq_printf(f, "%d %d 0x%02x %d %d %lld %lld\n", - ksp->ks_kid, ksp->ks_type, ksp->ks_flags, - ksp->ks_ndata, (int)ksp->ks_data_size, - ksp->ks_crtime, ksp->ks_snaptime); + seq_printf(f, "%d %d 0x%02x %d %d %lld %lld\n", + ksp->ks_kid, ksp->ks_type, ksp->ks_flags, + ksp->ks_ndata, (int)ksp->ks_data_size, + ksp->ks_crtime, ksp->ks_snaptime); switch (ksp->ks_type) { - case KSTAT_TYPE_RAW: + case KSTAT_TYPE_RAW: restart: - if (ksp->ks_raw_ops.headers) { - rc = ksp->ks_raw_ops.headers( - ksp->ks_raw_buf, ksp->ks_raw_bufsize); + if (ksp->ks_raw_ops.headers) { + rc = ksp->ks_raw_ops.headers( + ksp->ks_raw_buf, ksp->ks_raw_bufsize); if (rc == ENOMEM && !kstat_resize_raw(ksp)) goto restart; if (!rc) - seq_puts(f, ksp->ks_raw_buf); - } else { - seq_printf(f, "raw data\n"); - } - break; - case KSTAT_TYPE_NAMED: - seq_printf(f, "%-31s %-4s %s\n", - "name", "type", "data"); - break; - case KSTAT_TYPE_INTR: - seq_printf(f, "%-8s %-8s %-8s %-8s %-8s\n", - "hard", "soft", "watchdog", - "spurious", "multsvc"); - break; - case KSTAT_TYPE_IO: - seq_printf(f, - "%-8s %-8s %-8s %-8s %-8s %-8s " - "%-8s %-8s %-8s %-8s %-8s %-8s\n", - "nread", "nwritten", "reads", "writes", - "wtime", "wlentime", "wupdate", - "rtime", "rlentime", "rupdate", - "wcnt", "rcnt"); - break; - case KSTAT_TYPE_TIMER: - seq_printf(f, - "%-31s %-8s " - "%-8s %-8s %-8s %-8s %-8s\n", - "name", "events", "elapsed", - "min", "max", "start", "stop"); - break; - default: - PANIC("Undefined kstat type %d\n", ksp->ks_type); - } - - return -rc; + seq_puts(f, ksp->ks_raw_buf); + } else { + seq_printf(f, "raw data\n"); + } + break; + case KSTAT_TYPE_NAMED: + seq_printf(f, "%-31s %-4s %s\n", + "name", "type", "data"); + break; + case KSTAT_TYPE_INTR: + seq_printf(f, "%-8s %-8s %-8s %-8s %-8s\n", + "hard", "soft", "watchdog", + "spurious", "multsvc"); + break; + case KSTAT_TYPE_IO: + seq_printf(f, + "%-8s %-8s %-8s %-8s %-8s %-8s " + "%-8s %-8s %-8s %-8s %-8s %-8s\n", + "nread", "nwritten", "reads", "writes", + "wtime", "wlentime", "wupdate", + "rtime", "rlentime", "rupdate", + "wcnt", "rcnt"); + break; + case KSTAT_TYPE_TIMER: + seq_printf(f, + "%-31s %-8s " + "%-8s %-8s %-8s %-8s %-8s\n", + "name", "events", "elapsed", + "min", "max", "start", "stop"); + break; + default: + PANIC("Undefined kstat type %d\n", ksp->ks_type); + } + + return (-rc); } static int kstat_seq_show_raw(struct seq_file *f, unsigned char *p, int l) { - int i, j; + int i, j; - for (i = 0; ; i++) { - seq_printf(f, "%03x:", i); + for (i = 0; ; i++) { + seq_printf(f, "%03x:", i); - for (j = 0; j < 16; j++) { - if (i * 16 + j >= l) { - seq_printf(f, "\n"); - goto out; - } + for (j = 0; j < 16; j++) { + if (i * 16 + j >= l) { + seq_printf(f, "\n"); + goto out; + } - seq_printf(f, " %02x", (unsigned char)p[i * 16 + j]); - } - seq_printf(f, "\n"); - } + seq_printf(f, " %02x", (unsigned char)p[i * 16 + j]); + } + seq_printf(f, "\n"); + } out: - return 0; + return (0); } static int kstat_seq_show_named(struct seq_file *f, kstat_named_t *knp) { - seq_printf(f, "%-31s %-4d ", knp->name, knp->data_type); - - switch (knp->data_type) { - case KSTAT_DATA_CHAR: - knp->value.c[15] = '\0'; /* NULL terminate */ - seq_printf(f, "%-16s", knp->value.c); - break; - /* XXX - We need to be more careful able what tokens are - * used for each arch, for now this is correct for x86_64. - */ - case KSTAT_DATA_INT32: - seq_printf(f, "%d", knp->value.i32); - break; - case KSTAT_DATA_UINT32: - seq_printf(f, "%u", knp->value.ui32); - break; - case KSTAT_DATA_INT64: - seq_printf(f, "%lld", (signed long long)knp->value.i64); - break; - case KSTAT_DATA_UINT64: - seq_printf(f, "%llu", (unsigned long long)knp->value.ui64); - break; - case KSTAT_DATA_LONG: - seq_printf(f, "%ld", knp->value.l); - break; - case KSTAT_DATA_ULONG: - seq_printf(f, "%lu", knp->value.ul); - break; - case KSTAT_DATA_STRING: - KSTAT_NAMED_STR_PTR(knp) - [KSTAT_NAMED_STR_BUFLEN(knp)-1] = '\0'; - seq_printf(f, "%s", KSTAT_NAMED_STR_PTR(knp)); - break; - default: - PANIC("Undefined kstat data type %d\n", knp->data_type); - } - - seq_printf(f, "\n"); - - return 0; + seq_printf(f, "%-31s %-4d ", knp->name, knp->data_type); + + switch (knp->data_type) { + case KSTAT_DATA_CHAR: + knp->value.c[15] = '\0'; /* NULL terminate */ + seq_printf(f, "%-16s", knp->value.c); + break; + /* + * NOTE - We need to be more careful able what tokens are + * used for each arch, for now this is correct for x86_64. + */ + case KSTAT_DATA_INT32: + seq_printf(f, "%d", knp->value.i32); + break; + case KSTAT_DATA_UINT32: + seq_printf(f, "%u", knp->value.ui32); + break; + case KSTAT_DATA_INT64: + seq_printf(f, "%lld", (signed long long)knp->value.i64); + break; + case KSTAT_DATA_UINT64: + seq_printf(f, "%llu", + (unsigned long long)knp->value.ui64); + break; + case KSTAT_DATA_LONG: + seq_printf(f, "%ld", knp->value.l); + break; + case KSTAT_DATA_ULONG: + seq_printf(f, "%lu", knp->value.ul); + break; + case KSTAT_DATA_STRING: + KSTAT_NAMED_STR_PTR(knp) + [KSTAT_NAMED_STR_BUFLEN(knp)-1] = '\0'; + seq_printf(f, "%s", KSTAT_NAMED_STR_PTR(knp)); + break; + default: + PANIC("Undefined kstat data type %d\n", knp->data_type); + } + + seq_printf(f, "\n"); + + return (0); } static int kstat_seq_show_intr(struct seq_file *f, kstat_intr_t *kip) { - seq_printf(f, "%-8u %-8u %-8u %-8u %-8u\n", - kip->intrs[KSTAT_INTR_HARD], - kip->intrs[KSTAT_INTR_SOFT], - kip->intrs[KSTAT_INTR_WATCHDOG], - kip->intrs[KSTAT_INTR_SPURIOUS], - kip->intrs[KSTAT_INTR_MULTSVC]); - - return 0; + seq_printf(f, "%-8u %-8u %-8u %-8u %-8u\n", + kip->intrs[KSTAT_INTR_HARD], + kip->intrs[KSTAT_INTR_SOFT], + kip->intrs[KSTAT_INTR_WATCHDOG], + kip->intrs[KSTAT_INTR_SPURIOUS], + kip->intrs[KSTAT_INTR_MULTSVC]); + + return (0); } static int kstat_seq_show_io(struct seq_file *f, kstat_io_t *kip) { - seq_printf(f, - "%-8llu %-8llu %-8u %-8u %-8lld %-8lld " - "%-8lld %-8lld %-8lld %-8lld %-8u %-8u\n", - kip->nread, kip->nwritten, - kip->reads, kip->writes, - kip->wtime, kip->wlentime, kip->wlastupdate, - kip->rtime, kip->rlentime, kip->rlastupdate, - kip->wcnt, kip->rcnt); - - return 0; + seq_printf(f, + "%-8llu %-8llu %-8u %-8u %-8lld %-8lld " + "%-8lld %-8lld %-8lld %-8lld %-8u %-8u\n", + kip->nread, kip->nwritten, + kip->reads, kip->writes, + kip->wtime, kip->wlentime, kip->wlastupdate, + kip->rtime, kip->rlentime, kip->rlastupdate, + kip->wcnt, kip->rcnt); + + return (0); } static int kstat_seq_show_timer(struct seq_file *f, kstat_timer_t *ktp) { - seq_printf(f, - "%-31s %-8llu %-8lld %-8lld %-8lld %-8lld %-8lld\n", - ktp->name, ktp->num_events, ktp->elapsed_time, - ktp->min_time, ktp->max_time, - ktp->start_time, ktp->stop_time); + seq_printf(f, + "%-31s %-8llu %-8lld %-8lld %-8lld %-8lld %-8lld\n", + ktp->name, ktp->num_events, ktp->elapsed_time, + ktp->min_time, ktp->max_time, + ktp->start_time, ktp->stop_time); - return 0; + return (0); } static int kstat_seq_show(struct seq_file *f, void *p) { - kstat_t *ksp = (kstat_t *)f->private; - int rc = 0; + kstat_t *ksp = (kstat_t *)f->private; + int rc = 0; - ASSERT(ksp->ks_magic == KS_MAGIC); + ASSERT(ksp->ks_magic == KS_MAGIC); switch (ksp->ks_type) { - case KSTAT_TYPE_RAW: + case KSTAT_TYPE_RAW: restart: - if (ksp->ks_raw_ops.data) { - rc = ksp->ks_raw_ops.data( + if (ksp->ks_raw_ops.data) { + rc = ksp->ks_raw_ops.data( ksp->ks_raw_buf, ksp->ks_raw_bufsize, p); if (rc == ENOMEM && !kstat_resize_raw(ksp)) goto restart; if (!rc) - seq_puts(f, ksp->ks_raw_buf); - } else { - ASSERT(ksp->ks_ndata == 1); - rc = kstat_seq_show_raw(f, ksp->ks_data, - ksp->ks_data_size); - } - break; - case KSTAT_TYPE_NAMED: - rc = kstat_seq_show_named(f, (kstat_named_t *)p); - break; - case KSTAT_TYPE_INTR: - rc = kstat_seq_show_intr(f, (kstat_intr_t *)p); - break; - case KSTAT_TYPE_IO: - rc = kstat_seq_show_io(f, (kstat_io_t *)p); - break; - case KSTAT_TYPE_TIMER: - rc = kstat_seq_show_timer(f, (kstat_timer_t *)p); - break; - default: - PANIC("Undefined kstat type %d\n", ksp->ks_type); - } - - return -rc; + seq_puts(f, ksp->ks_raw_buf); + } else { + ASSERT(ksp->ks_ndata == 1); + rc = kstat_seq_show_raw(f, ksp->ks_data, + ksp->ks_data_size); + } + break; + case KSTAT_TYPE_NAMED: + rc = kstat_seq_show_named(f, (kstat_named_t *)p); + break; + case KSTAT_TYPE_INTR: + rc = kstat_seq_show_intr(f, (kstat_intr_t *)p); + break; + case KSTAT_TYPE_IO: + rc = kstat_seq_show_io(f, (kstat_io_t *)p); + break; + case KSTAT_TYPE_TIMER: + rc = kstat_seq_show_timer(f, (kstat_timer_t *)p); + break; + default: + PANIC("Undefined kstat type %d\n", ksp->ks_type); + } + + return (-rc); } int @@ -333,79 +335,79 @@ kstat_default_update(kstat_t *ksp, int rw) if (rw == KSTAT_WRITE) return (EACCES); - return 0; + return (0); } static void * kstat_seq_data_addr(kstat_t *ksp, loff_t n) { - void *rc = NULL; + void *rc = NULL; switch (ksp->ks_type) { - case KSTAT_TYPE_RAW: - if (ksp->ks_raw_ops.addr) - rc = ksp->ks_raw_ops.addr(ksp, n); - else - rc = ksp->ks_data; - break; - case KSTAT_TYPE_NAMED: - rc = ksp->ks_data + n * sizeof(kstat_named_t); - break; - case KSTAT_TYPE_INTR: - rc = ksp->ks_data + n * sizeof(kstat_intr_t); - break; - case KSTAT_TYPE_IO: - rc = ksp->ks_data + n * sizeof(kstat_io_t); - break; - case KSTAT_TYPE_TIMER: - rc = ksp->ks_data + n * sizeof(kstat_timer_t); - break; - default: - PANIC("Undefined kstat type %d\n", ksp->ks_type); - } - - return (rc); + case KSTAT_TYPE_RAW: + if (ksp->ks_raw_ops.addr) + rc = ksp->ks_raw_ops.addr(ksp, n); + else + rc = ksp->ks_data; + break; + case KSTAT_TYPE_NAMED: + rc = ksp->ks_data + n * sizeof (kstat_named_t); + break; + case KSTAT_TYPE_INTR: + rc = ksp->ks_data + n * sizeof (kstat_intr_t); + break; + case KSTAT_TYPE_IO: + rc = ksp->ks_data + n * sizeof (kstat_io_t); + break; + case KSTAT_TYPE_TIMER: + rc = ksp->ks_data + n * sizeof (kstat_timer_t); + break; + default: + PANIC("Undefined kstat type %d\n", ksp->ks_type); + } + + return (rc); } static void * kstat_seq_start(struct seq_file *f, loff_t *pos) { - loff_t n = *pos; - kstat_t *ksp = (kstat_t *)f->private; - ASSERT(ksp->ks_magic == KS_MAGIC); + loff_t n = *pos; + kstat_t *ksp = (kstat_t *)f->private; + ASSERT(ksp->ks_magic == KS_MAGIC); mutex_enter(ksp->ks_lock); - if (ksp->ks_type == KSTAT_TYPE_RAW) { - ksp->ks_raw_bufsize = PAGE_SIZE; - ksp->ks_raw_buf = vmem_alloc(ksp->ks_raw_bufsize, KM_SLEEP); - } + if (ksp->ks_type == KSTAT_TYPE_RAW) { + ksp->ks_raw_bufsize = PAGE_SIZE; + ksp->ks_raw_buf = vmem_alloc(ksp->ks_raw_bufsize, KM_SLEEP); + } - /* Dynamically update kstat, on error existing kstats are used */ - (void) ksp->ks_update(ksp, KSTAT_READ); + /* Dynamically update kstat, on error existing kstats are used */ + (void) ksp->ks_update(ksp, KSTAT_READ); ksp->ks_snaptime = gethrtime(); - if (!n && kstat_seq_show_headers(f)) + if (!n && kstat_seq_show_headers(f)) return (NULL); - if (n >= ksp->ks_ndata) - return (NULL); + if (n >= ksp->ks_ndata) + return (NULL); - return (kstat_seq_data_addr(ksp, n)); + return (kstat_seq_data_addr(ksp, n)); } static void * kstat_seq_next(struct seq_file *f, void *p, loff_t *pos) { - kstat_t *ksp = (kstat_t *)f->private; - ASSERT(ksp->ks_magic == KS_MAGIC); + kstat_t *ksp = (kstat_t *)f->private; + ASSERT(ksp->ks_magic == KS_MAGIC); - ++*pos; - if (*pos >= ksp->ks_ndata) - return (NULL); + ++*pos; + if (*pos >= ksp->ks_ndata) + return (NULL); - return (kstat_seq_data_addr(ksp, *pos)); + return (kstat_seq_data_addr(ksp, *pos)); } static void @@ -421,10 +423,10 @@ kstat_seq_stop(struct seq_file *f, void *v) } static struct seq_operations kstat_seq_ops = { - .show = kstat_seq_show, - .start = kstat_seq_start, - .next = kstat_seq_next, - .stop = kstat_seq_stop, + .show = kstat_seq_show, + .start = kstat_seq_start, + .next = kstat_seq_next, + .stop = kstat_seq_stop, }; static kstat_module_t * @@ -465,28 +467,28 @@ kstat_delete_module(kstat_module_t *module) ASSERT(list_empty(&module->ksm_kstat_list)); remove_proc_entry(module->ksm_name, proc_spl_kstat); list_del(&module->ksm_module_list); - kmem_free(module, sizeof(kstat_module_t)); + kmem_free(module, sizeof (kstat_module_t)); } static int proc_kstat_open(struct inode *inode, struct file *filp) { - struct seq_file *f; - int rc; + struct seq_file *f; + int rc; - rc = seq_open(filp, &kstat_seq_ops); - if (rc) - return rc; + rc = seq_open(filp, &kstat_seq_ops); + if (rc) + return (rc); - f = filp->private_data; - f->private = PDE_DATA(inode); + f = filp->private_data; + f->private = PDE_DATA(inode); - return rc; + return (rc); } static ssize_t -proc_kstat_write(struct file *filp, const char __user *buf, - size_t len, loff_t *ppos) +proc_kstat_write(struct file *filp, const char __user *buf, size_t len, + loff_t *ppos) { struct seq_file *f = filp->private_data; kstat_t *ksp = f->private; @@ -527,8 +529,8 @@ EXPORT_SYMBOL(__kstat_set_raw_ops); kstat_t * __kstat_create(const char *ks_module, int ks_instance, const char *ks_name, - const char *ks_class, uchar_t ks_type, uint_t ks_ndata, - uchar_t ks_flags) + const char *ks_class, uchar_t ks_type, uint_t ks_ndata, + uchar_t ks_flags) { kstat_t *ksp; @@ -538,24 +540,24 @@ __kstat_create(const char *ks_module, int ks_instance, const char *ks_name, ASSERT(!(ks_flags & KSTAT_FLAG_UNSUPPORTED)); if ((ks_type == KSTAT_TYPE_INTR) || (ks_type == KSTAT_TYPE_IO)) - ASSERT(ks_ndata == 1); + ASSERT(ks_ndata == 1); - ksp = kmem_zalloc(sizeof(*ksp), KM_SLEEP); + ksp = kmem_zalloc(sizeof (*ksp), KM_SLEEP); if (ksp == NULL) - return ksp; + return (ksp); mutex_enter(&kstat_module_lock); ksp->ks_kid = kstat_id; - kstat_id++; + kstat_id++; mutex_exit(&kstat_module_lock); - ksp->ks_magic = KS_MAGIC; + ksp->ks_magic = KS_MAGIC; mutex_init(&ksp->ks_private_lock, NULL, MUTEX_DEFAULT, NULL); ksp->ks_lock = &ksp->ks_private_lock; INIT_LIST_HEAD(&ksp->ks_list); ksp->ks_crtime = gethrtime(); - ksp->ks_snaptime = ksp->ks_crtime; + ksp->ks_snaptime = ksp->ks_crtime; strncpy(ksp->ks_module, ks_module, KSTAT_STRLEN); ksp->ks_instance = ks_instance; strncpy(ksp->ks_name, ks_name, KSTAT_STRLEN); @@ -571,41 +573,41 @@ __kstat_create(const char *ks_module, int ks_instance, const char *ks_name, ksp->ks_raw_bufsize = 0; switch (ksp->ks_type) { - case KSTAT_TYPE_RAW: - ksp->ks_ndata = 1; - ksp->ks_data_size = ks_ndata; - break; - case KSTAT_TYPE_NAMED: - ksp->ks_ndata = ks_ndata; - ksp->ks_data_size = ks_ndata * sizeof(kstat_named_t); - break; - case KSTAT_TYPE_INTR: - ksp->ks_ndata = ks_ndata; - ksp->ks_data_size = ks_ndata * sizeof(kstat_intr_t); - break; - case KSTAT_TYPE_IO: - ksp->ks_ndata = ks_ndata; - ksp->ks_data_size = ks_ndata * sizeof(kstat_io_t); - break; - case KSTAT_TYPE_TIMER: - ksp->ks_ndata = ks_ndata; - ksp->ks_data_size = ks_ndata * sizeof(kstat_timer_t); - break; - default: - PANIC("Undefined kstat type %d\n", ksp->ks_type); - } + case KSTAT_TYPE_RAW: + ksp->ks_ndata = 1; + ksp->ks_data_size = ks_ndata; + break; + case KSTAT_TYPE_NAMED: + ksp->ks_ndata = ks_ndata; + ksp->ks_data_size = ks_ndata * sizeof (kstat_named_t); + break; + case KSTAT_TYPE_INTR: + ksp->ks_ndata = ks_ndata; + ksp->ks_data_size = ks_ndata * sizeof (kstat_intr_t); + break; + case KSTAT_TYPE_IO: + ksp->ks_ndata = ks_ndata; + ksp->ks_data_size = ks_ndata * sizeof (kstat_io_t); + break; + case KSTAT_TYPE_TIMER: + ksp->ks_ndata = ks_ndata; + ksp->ks_data_size = ks_ndata * sizeof (kstat_timer_t); + break; + default: + PANIC("Undefined kstat type %d\n", ksp->ks_type); + } if (ksp->ks_flags & KSTAT_FLAG_VIRTUAL) { - ksp->ks_data = NULL; - } else { - ksp->ks_data = kmem_zalloc(ksp->ks_data_size, KM_SLEEP); - if (ksp->ks_data == NULL) { - kmem_free(ksp, sizeof(*ksp)); - ksp = NULL; - } - } - - return ksp; + ksp->ks_data = NULL; + } else { + ksp->ks_data = kmem_zalloc(ksp->ks_data_size, KM_SLEEP); + if (ksp->ks_data == NULL) { + kmem_free(ksp, sizeof (*ksp)); + ksp = NULL; + } + } + + return (ksp); } EXPORT_SYMBOL(__kstat_create); @@ -706,9 +708,7 @@ __kstat_delete(kstat_t *ksp) ksp->ks_lock = NULL; mutex_destroy(&ksp->ks_private_lock); - kmem_free(ksp, sizeof(*ksp)); - - return; + kmem_free(ksp, sizeof (*ksp)); } EXPORT_SYMBOL(__kstat_delete); @@ -717,7 +717,7 @@ spl_kstat_init(void) { mutex_init(&kstat_module_lock, NULL, MUTEX_DEFAULT, NULL); INIT_LIST_HEAD(&kstat_module_list); - kstat_id = 0; + kstat_id = 0; return (0); } @@ -727,4 +727,3 @@ spl_kstat_fini(void) ASSERT(list_empty(&kstat_module_list)); mutex_destroy(&kstat_module_lock); } - diff --git a/module/spl/spl-mutex.c b/module/spl/spl-mutex.c index 9e1e103db..ba818862b 100644 --- a/module/spl/spl-mutex.c +++ b/module/spl/spl-mutex.c @@ -20,17 +20,11 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Mutex Implementation. */ #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM -#endif - -#define DEBUG_SUBSYSTEM S_MUTEX - int spl_mutex_init(void) { return 0; } void spl_mutex_fini(void) { } diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 848eebffe..f5998a06e 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Proc Implementation. */ @@ -37,7 +37,7 @@ #include #include -#if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) +#if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) typedef struct ctl_table __no_const spl_ctl_table; #else typedef struct ctl_table spl_ctl_table; @@ -55,56 +55,57 @@ static struct proc_dir_entry *proc_spl_taskq = NULL; struct proc_dir_entry *proc_spl_kstat = NULL; static int -proc_copyin_string(char *kbuffer, int kbuffer_size, - const char *ubuffer, int ubuffer_size) +proc_copyin_string(char *kbuffer, int kbuffer_size, const char *ubuffer, + int ubuffer_size) { - int size; + int size; - if (ubuffer_size > kbuffer_size) - return -EOVERFLOW; + if (ubuffer_size > kbuffer_size) + return (-EOVERFLOW); - if (copy_from_user((void *)kbuffer, (void *)ubuffer, ubuffer_size)) - return -EFAULT; + if (copy_from_user((void *)kbuffer, (void *)ubuffer, ubuffer_size)) + return (-EFAULT); - /* strip trailing whitespace */ - size = strnlen(kbuffer, ubuffer_size); - while (size-- >= 0) - if (!isspace(kbuffer[size])) - break; + /* strip trailing whitespace */ + size = strnlen(kbuffer, ubuffer_size); + while (size-- >= 0) + if (!isspace(kbuffer[size])) + break; - /* empty string */ - if (size < 0) - return -EINVAL; + /* empty string */ + if (size < 0) + return (-EINVAL); - /* no space to terminate */ - if (size == kbuffer_size) - return -EOVERFLOW; + /* no space to terminate */ + if (size == kbuffer_size) + return (-EOVERFLOW); - kbuffer[size + 1] = 0; - return 0; + kbuffer[size + 1] = 0; + return (0); } static int proc_copyout_string(char *ubuffer, int ubuffer_size, - const char *kbuffer, char *append) + const char *kbuffer, char *append) { - /* NB if 'append' != NULL, it's a single character to append to the - * copied out string - usually "\n", for /proc entries and - * (i.e. a terminating zero byte) for sysctl entries - */ - int size = MIN(strlen(kbuffer), ubuffer_size); + /* + * NB if 'append' != NULL, it's a single character to append to the + * copied out string - usually "\n", for /proc entries and + * (i.e. a terminating zero byte) for sysctl entries + */ + int size = MIN(strlen(kbuffer), ubuffer_size); - if (copy_to_user(ubuffer, kbuffer, size)) - return -EFAULT; + if (copy_to_user(ubuffer, kbuffer, size)) + return (-EFAULT); - if (append != NULL && size < ubuffer_size) { - if (copy_to_user(ubuffer + size, append, 1)) - return -EFAULT; + if (append != NULL && size < ubuffer_size) { + if (copy_to_user(ubuffer + size, append, 1)) + return (-EFAULT); - size++; - } + size++; + } - return size; + return (size); } #ifdef DEBUG_KMEM @@ -112,27 +113,27 @@ static int proc_domemused(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - int rc = 0; - unsigned long min = 0, max = ~0, val; - spl_ctl_table dummy = *table; - - dummy.data = &val; - dummy.proc_handler = &proc_dointvec; - dummy.extra1 = &min; - dummy.extra2 = &max; - - if (write) { - *ppos += *lenp; - } else { -# ifdef HAVE_ATOMIC64_T - val = atomic64_read((atomic64_t *)table->data); -# else - val = atomic_read((atomic_t *)table->data); -# endif /* HAVE_ATOMIC64_T */ - rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos); - } - - return (rc); + int rc = 0; + unsigned long min = 0, max = ~0, val; + spl_ctl_table dummy = *table; + + dummy.data = &val; + dummy.proc_handler = &proc_dointvec; + dummy.extra1 = &min; + dummy.extra2 = &max; + + if (write) { + *ppos += *lenp; + } else { +#ifdef HAVE_ATOMIC64_T + val = atomic64_read((atomic64_t *)table->data); +#else + val = atomic_read((atomic_t *)table->data); +#endif /* HAVE_ATOMIC64_T */ + rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos); + } + + return (rc); } #endif /* DEBUG_KMEM */ @@ -140,23 +141,23 @@ static int proc_doslab(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - int rc = 0; - unsigned long min = 0, max = ~0, val = 0, mask; - spl_ctl_table dummy = *table; - spl_kmem_cache_t *skc; + int rc = 0; + unsigned long min = 0, max = ~0, val = 0, mask; + spl_ctl_table dummy = *table; + spl_kmem_cache_t *skc; - dummy.data = &val; - dummy.proc_handler = &proc_dointvec; - dummy.extra1 = &min; - dummy.extra2 = &max; + dummy.data = &val; + dummy.proc_handler = &proc_dointvec; + dummy.extra1 = &min; + dummy.extra2 = &max; - if (write) { - *ppos += *lenp; - } else { - down_read(&spl_kmem_cache_sem); - mask = (unsigned long)table->data; + if (write) { + *ppos += *lenp; + } else { + down_read(&spl_kmem_cache_sem); + mask = (unsigned long)table->data; - list_for_each_entry(skc, &spl_kmem_cache_list, skc_list) { + list_for_each_entry(skc, &spl_kmem_cache_list, skc_list) { /* Only use slabs of the correct kmem/vmem type */ if (!(skc->skc_flags & mask)) @@ -165,58 +166,61 @@ proc_doslab(struct ctl_table *table, int write, /* Sum the specified field for selected slabs */ switch (mask & (KMC_TOTAL | KMC_ALLOC | KMC_MAX)) { case KMC_TOTAL: - val += skc->skc_slab_size * skc->skc_slab_total; + val += skc->skc_slab_size * skc->skc_slab_total; break; case KMC_ALLOC: - val += skc->skc_obj_size * skc->skc_obj_alloc; + val += skc->skc_obj_size * skc->skc_obj_alloc; break; case KMC_MAX: - val += skc->skc_obj_size * skc->skc_obj_max; + val += skc->skc_obj_size * skc->skc_obj_max; break; } - } + } - up_read(&spl_kmem_cache_sem); - rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos); - } + up_read(&spl_kmem_cache_sem); + rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos); + } - return (rc); + return (rc); } static int proc_dohostid(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - int len, rc = 0; - char *end, str[32]; - - if (write) { - /* We can't use proc_doulongvec_minmax() in the write - * case here because hostid while a hex value has no - * leading 0x which confuses the helper function. */ - rc = proc_copyin_string(str, sizeof(str), buffer, *lenp); - if (rc < 0) - return (rc); - - spl_hostid = simple_strtoul(str, &end, 16); - if (str == end) - return (-EINVAL); - - } else { - len = snprintf(str, sizeof(str), "%lx", + int len, rc = 0; + char *end, str[32]; + + if (write) { + /* + * We can't use proc_doulongvec_minmax() in the write + * case here because hostid while a hex value has no + * leading 0x which confuses the helper function. + */ + rc = proc_copyin_string(str, sizeof (str), buffer, *lenp); + if (rc < 0) + return (rc); + + spl_hostid = simple_strtoul(str, &end, 16); + if (str == end) + return (-EINVAL); + + } else { + len = snprintf(str, sizeof (str), "%lx", (unsigned long) zone_get_hostid(NULL)); - if (*ppos >= len) - rc = 0; - else - rc = proc_copyout_string(buffer,*lenp,str+*ppos,"\n"); - - if (rc >= 0) { - *lenp = rc; - *ppos += rc; - } - } - - return (rc); + if (*ppos >= len) + rc = 0; + else + rc = proc_copyout_string(buffer, + *lenp, str + *ppos, "\n"); + + if (rc >= 0) { + *lenp = rc; + *ppos += rc; + } + } + + return (rc); } static void @@ -229,11 +233,11 @@ taskq_seq_show_headers(struct seq_file *f) /* indices into the lheads array below */ #define LHEAD_PEND 0 -#define LHEAD_PRIO 1 -#define LHEAD_DELAY 2 -#define LHEAD_WAIT 3 -#define LHEAD_ACTIVE 4 -#define LHEAD_SIZE 5 +#define LHEAD_PRIO 1 +#define LHEAD_DELAY 2 +#define LHEAD_WAIT 3 +#define LHEAD_ACTIVE 4 +#define LHEAD_SIZE 5 static unsigned int spl_max_show_tasks = 512; module_param(spl_max_show_tasks, uint, 0644); @@ -287,7 +291,7 @@ taskq_seq_show_impl(struct seq_file *f, void *p, boolean_t allflag) spin_unlock_irqrestore(&tq->tq_wait_waitq.lock, wflags); /* show the base taskq contents */ - snprintf(name, sizeof(name), "%s/%d", tq->tq_name, tq->tq_instance); + snprintf(name, sizeof (name), "%s/%d", tq->tq_name, tq->tq_instance); seq_printf(f, "%-25s ", name); seq_printf(f, "%5d %5d %5d %5d %5d %5d %12d %5d %10x\n", tq->tq_nactive, tq->tq_nthreads, tq->tq_nspawn, @@ -299,7 +303,8 @@ taskq_seq_show_impl(struct seq_file *f, void *p, boolean_t allflag) j = 0; list_for_each_entry(tqt, &tq->tq_active_list, tqt_active_list) { if (j == 0) - seq_printf(f, "\t%s:", list_names[LHEAD_ACTIVE]); + seq_printf(f, "\t%s:", + list_names[LHEAD_ACTIVE]); else if (j == 2) { seq_printf(f, "\n\t "); j = 0; @@ -403,32 +408,32 @@ taskq_seq_next(struct seq_file *f, void *p, loff_t *pos) ++*pos; return ((tq->tq_taskqs.next == &tq_list) ? - NULL : list_entry(tq->tq_taskqs.next, taskq_t, tq_taskqs)); + NULL : list_entry(tq->tq_taskqs.next, taskq_t, tq_taskqs)); } static void slab_seq_show_headers(struct seq_file *f) { - seq_printf(f, - "--------------------- cache ----------" - "--------------------------------------------- " - "----- slab ------ " - "---- object ----- " - "--- emergency ---\n"); - seq_printf(f, - "name " - " flags size alloc slabsize objsize " - "total alloc max " - "total alloc max " - "dlock alloc max\n"); + seq_printf(f, + "--------------------- cache ----------" + "--------------------------------------------- " + "----- slab ------ " + "---- object ----- " + "--- emergency ---\n"); + seq_printf(f, + "name " + " flags size alloc slabsize objsize " + "total alloc max " + "total alloc max " + "dlock alloc max\n"); } static int slab_seq_show(struct seq_file *f, void *p) { - spl_kmem_cache_t *skc = p; + spl_kmem_cache_t *skc = p; - ASSERT(skc->skc_magic == SKC_MAGIC); + ASSERT(skc->skc_magic == SKC_MAGIC); /* * Backed by Linux slab see /proc/slabinfo. @@ -436,48 +441,48 @@ slab_seq_show(struct seq_file *f, void *p) if (skc->skc_flags & KMC_SLAB) return (0); - spin_lock(&skc->skc_lock); - seq_printf(f, "%-36s ", skc->skc_name); - seq_printf(f, "0x%05lx %9lu %9lu %8u %8u " - "%5lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu\n", - (long unsigned)skc->skc_flags, - (long unsigned)(skc->skc_slab_size * skc->skc_slab_total), - (long unsigned)(skc->skc_obj_size * skc->skc_obj_alloc), - (unsigned)skc->skc_slab_size, - (unsigned)skc->skc_obj_size, - (long unsigned)skc->skc_slab_total, - (long unsigned)skc->skc_slab_alloc, - (long unsigned)skc->skc_slab_max, - (long unsigned)skc->skc_obj_total, - (long unsigned)skc->skc_obj_alloc, - (long unsigned)skc->skc_obj_max, - (long unsigned)skc->skc_obj_deadlock, - (long unsigned)skc->skc_obj_emergency, - (long unsigned)skc->skc_obj_emergency_max); - - spin_unlock(&skc->skc_lock); - - return 0; + spin_lock(&skc->skc_lock); + seq_printf(f, "%-36s ", skc->skc_name); + seq_printf(f, "0x%05lx %9lu %9lu %8u %8u " + "%5lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu\n", + (long unsigned)skc->skc_flags, + (long unsigned)(skc->skc_slab_size * skc->skc_slab_total), + (long unsigned)(skc->skc_obj_size * skc->skc_obj_alloc), + (unsigned)skc->skc_slab_size, + (unsigned)skc->skc_obj_size, + (long unsigned)skc->skc_slab_total, + (long unsigned)skc->skc_slab_alloc, + (long unsigned)skc->skc_slab_max, + (long unsigned)skc->skc_obj_total, + (long unsigned)skc->skc_obj_alloc, + (long unsigned)skc->skc_obj_max, + (long unsigned)skc->skc_obj_deadlock, + (long unsigned)skc->skc_obj_emergency, + (long unsigned)skc->skc_obj_emergency_max); + + spin_unlock(&skc->skc_lock); + + return (0); } static void * slab_seq_start(struct seq_file *f, loff_t *pos) { - struct list_head *p; - loff_t n = *pos; + struct list_head *p; + loff_t n = *pos; down_read(&spl_kmem_cache_sem); - if (!n) - slab_seq_show_headers(f); + if (!n) + slab_seq_show_headers(f); - p = spl_kmem_cache_list.next; - while (n--) { - p = p->next; - if (p == &spl_kmem_cache_list) - return (NULL); - } + p = spl_kmem_cache_list.next; + while (n--) { + p = p->next; + if (p == &spl_kmem_cache_list) + return (NULL); + } - return (list_entry(p, spl_kmem_cache_t, skc_list)); + return (list_entry(p, spl_kmem_cache_t, skc_list)); } static void * @@ -485,9 +490,9 @@ slab_seq_next(struct seq_file *f, void *p, loff_t *pos) { spl_kmem_cache_t *skc = p; - ++*pos; - return ((skc->skc_list.next == &spl_kmem_cache_list) ? - NULL : list_entry(skc->skc_list.next,spl_kmem_cache_t,skc_list)); + ++*pos; + return ((skc->skc_list.next == &spl_kmem_cache_list) ? + NULL : list_entry(skc->skc_list.next, spl_kmem_cache_t, skc_list)); } static void @@ -497,23 +502,23 @@ slab_seq_stop(struct seq_file *f, void *v) } static struct seq_operations slab_seq_ops = { - .show = slab_seq_show, - .start = slab_seq_start, - .next = slab_seq_next, - .stop = slab_seq_stop, + .show = slab_seq_show, + .start = slab_seq_start, + .next = slab_seq_next, + .stop = slab_seq_stop, }; static int proc_slab_open(struct inode *inode, struct file *filp) { - return seq_open(filp, &slab_seq_ops); + return (seq_open(filp, &slab_seq_ops)); } static struct file_operations proc_slab_operations = { - .open = proc_slab_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, + .open = proc_slab_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, }; static void @@ -523,122 +528,122 @@ taskq_seq_stop(struct seq_file *f, void *v) } static struct seq_operations taskq_all_seq_ops = { - .show = taskq_all_seq_show, - .start = taskq_seq_start, - .next = taskq_seq_next, - .stop = taskq_seq_stop, + .show = taskq_all_seq_show, + .start = taskq_seq_start, + .next = taskq_seq_next, + .stop = taskq_seq_stop, }; static struct seq_operations taskq_seq_ops = { - .show = taskq_seq_show, - .start = taskq_seq_start, - .next = taskq_seq_next, - .stop = taskq_seq_stop, + .show = taskq_seq_show, + .start = taskq_seq_start, + .next = taskq_seq_next, + .stop = taskq_seq_stop, }; static int proc_taskq_all_open(struct inode *inode, struct file *filp) { - return seq_open(filp, &taskq_all_seq_ops); + return (seq_open(filp, &taskq_all_seq_ops)); } static int proc_taskq_open(struct inode *inode, struct file *filp) { - return seq_open(filp, &taskq_seq_ops); + return (seq_open(filp, &taskq_seq_ops)); } static struct file_operations proc_taskq_all_operations = { - .open = proc_taskq_all_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, + .open = proc_taskq_all_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, }; static struct file_operations proc_taskq_operations = { - .open = proc_taskq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, + .open = proc_taskq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, }; static struct ctl_table spl_kmem_table[] = { #ifdef DEBUG_KMEM - { - .procname = "kmem_used", - .data = &kmem_alloc_used, -# ifdef HAVE_ATOMIC64_T - .maxlen = sizeof(atomic64_t), -# else - .maxlen = sizeof(atomic_t), -# endif /* HAVE_ATOMIC64_T */ - .mode = 0444, - .proc_handler = &proc_domemused, - }, - { - .procname = "kmem_max", - .data = &kmem_alloc_max, - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doulongvec_minmax, - }, + { + .procname = "kmem_used", + .data = &kmem_alloc_used, +#ifdef HAVE_ATOMIC64_T + .maxlen = sizeof (atomic64_t), +#else + .maxlen = sizeof (atomic_t), +#endif /* HAVE_ATOMIC64_T */ + .mode = 0444, + .proc_handler = &proc_domemused, + }, + { + .procname = "kmem_max", + .data = &kmem_alloc_max, + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doulongvec_minmax, + }, #endif /* DEBUG_KMEM */ - { - .procname = "slab_kmem_total", - .data = (void *)(KMC_KMEM | KMC_TOTAL), - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doslab, - }, - { - .procname = "slab_kmem_alloc", - .data = (void *)(KMC_KMEM | KMC_ALLOC), - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doslab, - }, - { - .procname = "slab_kmem_max", - .data = (void *)(KMC_KMEM | KMC_MAX), - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doslab, - }, - { - .procname = "slab_vmem_total", - .data = (void *)(KMC_VMEM | KMC_TOTAL), - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doslab, - }, - { - .procname = "slab_vmem_alloc", - .data = (void *)(KMC_VMEM | KMC_ALLOC), - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doslab, - }, - { - .procname = "slab_vmem_max", - .data = (void *)(KMC_VMEM | KMC_MAX), - .maxlen = sizeof(unsigned long), - .extra1 = &table_min, - .extra2 = &table_max, - .mode = 0444, - .proc_handler = &proc_doslab, - }, + { + .procname = "slab_kmem_total", + .data = (void *)(KMC_KMEM | KMC_TOTAL), + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doslab, + }, + { + .procname = "slab_kmem_alloc", + .data = (void *)(KMC_KMEM | KMC_ALLOC), + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doslab, + }, + { + .procname = "slab_kmem_max", + .data = (void *)(KMC_KMEM | KMC_MAX), + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doslab, + }, + { + .procname = "slab_vmem_total", + .data = (void *)(KMC_VMEM | KMC_TOTAL), + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doslab, + }, + { + .procname = "slab_vmem_alloc", + .data = (void *)(KMC_VMEM | KMC_ALLOC), + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doslab, + }, + { + .procname = "slab_vmem_max", + .data = (void *)(KMC_VMEM | KMC_MAX), + .maxlen = sizeof (unsigned long), + .extra1 = &table_min, + .extra2 = &table_max, + .mode = 0444, + .proc_handler = &proc_doslab, + }, {}, }; @@ -647,43 +652,44 @@ static struct ctl_table spl_kstat_table[] = { }; static struct ctl_table spl_table[] = { - /* NB No .strategy entries have been provided since - * sysctl(8) prefers to go via /proc for portability. - */ - { - .procname = "version", - .data = spl_version, - .maxlen = sizeof(spl_version), - .mode = 0444, - .proc_handler = &proc_dostring, - }, - { - .procname = "hostid", - .data = &spl_hostid, - .maxlen = sizeof(unsigned long), - .mode = 0644, - .proc_handler = &proc_dohostid, - }, + /* + * NB No .strategy entries have been provided since + * sysctl(8) prefers to go via /proc for portability. + */ + { + .procname = "version", + .data = spl_version, + .maxlen = sizeof (spl_version), + .mode = 0444, + .proc_handler = &proc_dostring, + }, + { + .procname = "hostid", + .data = &spl_hostid, + .maxlen = sizeof (unsigned long), + .mode = 0644, + .proc_handler = &proc_dohostid, + }, { - .procname = "kmem", - .mode = 0555, - .child = spl_kmem_table, + .procname = "kmem", + .mode = 0555, + .child = spl_kmem_table, }, { - .procname = "kstat", - .mode = 0555, - .child = spl_kstat_table, + .procname = "kstat", + .mode = 0555, + .child = spl_kstat_table, }, - {}, + {}, }; static struct ctl_table spl_dir[] = { - { - .procname = "spl", - .mode = 0555, - .child = spl_table, - }, - {} + { + .procname = "spl", + .mode = 0555, + .child = spl_table, + }, + {} }; static struct ctl_table spl_root[] = { @@ -703,7 +709,7 @@ spl_proc_init(void) { int rc = 0; - spl_header = register_sysctl_table(spl_root); + spl_header = register_sysctl_table(spl_root); if (spl_header == NULL) return (-EUNATCH); @@ -727,48 +733,48 @@ spl_proc_init(void) goto out; } - proc_spl_kmem = proc_mkdir("kmem", proc_spl); - if (proc_spl_kmem == NULL) { - rc = -EUNATCH; + proc_spl_kmem = proc_mkdir("kmem", proc_spl); + if (proc_spl_kmem == NULL) { + rc = -EUNATCH; goto out; } proc_spl_kmem_slab = proc_create_data("slab", 0444, proc_spl_kmem, &proc_slab_operations, NULL); - if (proc_spl_kmem_slab == NULL) { + if (proc_spl_kmem_slab == NULL) { rc = -EUNATCH; goto out; } - proc_spl_kstat = proc_mkdir("kstat", proc_spl); - if (proc_spl_kstat == NULL) { - rc = -EUNATCH; + proc_spl_kstat = proc_mkdir("kstat", proc_spl); + if (proc_spl_kstat == NULL) { + rc = -EUNATCH; goto out; } out: if (rc) { remove_proc_entry("kstat", proc_spl); - remove_proc_entry("slab", proc_spl_kmem); + remove_proc_entry("slab", proc_spl_kmem); remove_proc_entry("kmem", proc_spl); remove_proc_entry("taskq-all", proc_spl); remove_proc_entry("taskq", proc_spl); remove_proc_entry("spl", NULL); - unregister_sysctl_table(spl_header); + unregister_sysctl_table(spl_header); } - return (rc); + return (rc); } void spl_proc_fini(void) { remove_proc_entry("kstat", proc_spl); - remove_proc_entry("slab", proc_spl_kmem); + remove_proc_entry("slab", proc_spl_kmem); remove_proc_entry("kmem", proc_spl); remove_proc_entry("taskq-all", proc_spl); remove_proc_entry("taskq", proc_spl); remove_proc_entry("spl", NULL); - ASSERT(spl_header != NULL); - unregister_sysctl_table(spl_header); + ASSERT(spl_header != NULL); + unregister_sysctl_table(spl_header); } diff --git a/module/spl/spl-rwlock.c b/module/spl/spl-rwlock.c index e497775e6..9a992cc3a 100644 --- a/module/spl/spl-rwlock.c +++ b/module/spl/spl-rwlock.c @@ -20,18 +20,12 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Reader/Writer Lock Implementation. */ #include -#ifdef DEBUG_SUBSYSTEM -#undef DEBUG_SUBSYSTEM -#endif - -#define DEBUG_SUBSYSTEM S_RWLOCK - #if defined(CONFIG_PREEMPT_RT_FULL) #include @@ -94,7 +88,7 @@ __rwsem_tryupgrade(struct rw_semaphore *rwsem) static int __rwsem_tryupgrade(struct rw_semaphore *rwsem) { - typeof (rwsem->count) val; + typeof(rwsem->count) val; val = cmpxchg(&rwsem->count, SPL_RWSEM_SINGLE_READER_VALUE, SPL_RWSEM_SINGLE_WRITER_VALUE); return (val == SPL_RWSEM_SINGLE_READER_VALUE); diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index ae26bdb2e..2919a942a 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -87,7 +87,7 @@ taskq_find_by_name(const char *name) list_for_each_prev(tql, &tq_list) { tq = list_entry(tql, taskq_t, tq_taskqs); if (strcmp(name, tq->tq_name) == 0) - return tq->tq_instance; + return (tq->tq_instance); } return (-1); } @@ -573,7 +573,8 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) ASSERT(tq->tq_nactive <= tq->tq_nthreads); if ((flags & TQ_NOQUEUE) && (tq->tq_nactive == tq->tq_nthreads)) { /* Dynamic taskq may be able to spawn another thread */ - if (!(tq->tq_flags & TASKQ_DYNAMIC) || taskq_thread_spawn(tq) == 0) + if (!(tq->tq_flags & TASKQ_DYNAMIC) || + taskq_thread_spawn(tq) == 0) goto out; } @@ -686,7 +687,8 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags, if ((flags & TQ_NOQUEUE) && (tq->tq_nactive == tq->tq_nthreads)) { /* Dynamic taskq may be able to spawn another thread */ - if (!(tq->tq_flags & TASKQ_DYNAMIC) || taskq_thread_spawn(tq) == 0) + if (!(tq->tq_flags & TASKQ_DYNAMIC) || + taskq_thread_spawn(tq) == 0) goto out2; flags |= TQ_FRONT; } @@ -786,7 +788,8 @@ taskq_thread_spawn_task(void *arg) if (taskq_thread_create(tq) == NULL) { /* restore spawning count if failed */ - spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class); + spin_lock_irqsave_nested(&tq->tq_lock, flags, + tq->tq_lock_class); tq->tq_nspawn--; spin_unlock_irqrestore(&tq->tq_lock, flags); } @@ -1146,7 +1149,8 @@ taskq_destroy(taskq_t *tq) while (tq->tq_nspawn) { spin_unlock_irqrestore(&tq->tq_lock, flags); schedule_timeout_interruptible(1); - spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class); + spin_lock_irqsave_nested(&tq->tq_lock, flags, + tq->tq_lock_class); } /* @@ -1239,16 +1243,16 @@ param_set_taskq_kick(const char *val, struct kernel_param *kp) #ifdef module_param_cb static const struct kernel_param_ops param_ops_taskq_kick = { - .set = param_set_taskq_kick, - .get = param_get_uint, + .set = param_set_taskq_kick, + .get = param_get_uint, }; module_param_cb(spl_taskq_kick, ¶m_ops_taskq_kick, &spl_taskq_kick, 0644); #else module_param_call(spl_taskq_kick, param_set_taskq_kick, param_get_uint, - &spl_taskq_kick, 0644); + &spl_taskq_kick, 0644); #endif MODULE_PARM_DESC(spl_taskq_kick, - "Write nonzero to kick stuck taskqs to spawn more threads"); + "Write nonzero to kick stuck taskqs to spawn more threads"); int spl_taskq_init(void) diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index 92eba42ba..9ad044161 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Thread Implementation. */ @@ -33,8 +33,8 @@ */ typedef struct thread_priv_s { unsigned long tp_magic; /* Magic */ - int tp_name_size; /* Name size */ - char *tp_name; /* Name (without _thread suffix) */ + int tp_name_size; /* Name size */ + char *tp_name; /* Name (without _thread suffix) */ void (*tp_func)(void *); /* Registered function */ void *tp_args; /* Args to be passed to function */ size_t tp_len; /* Len to be passed to function */ @@ -55,12 +55,12 @@ thread_generic_wrapper(void *arg) set_current_state(tp->tp_state); set_user_nice((kthread_t *)current, PRIO_TO_NICE(tp->tp_pri)); kmem_free(tp->tp_name, tp->tp_name_size); - kmem_free(tp, sizeof(thread_priv_t)); + kmem_free(tp, sizeof (thread_priv_t)); if (func) func(args); - return 0; + return (0); } void @@ -72,9 +72,11 @@ __thread_exit(void) } EXPORT_SYMBOL(__thread_exit); -/* thread_create() may block forever if it cannot create a thread or +/* + * thread_create() may block forever if it cannot create a thread or * allocate memory. This is preferable to returning a NULL which Solaris - * style callers likely never check for... since it can't fail. */ + * style callers likely never check for... since it can't fail. + */ kthread_t * __thread_create(caddr_t stk, size_t stksize, thread_func_t func, const char *name, void *args, size_t len, proc_t *pp, @@ -88,7 +90,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, /* Variable stack size unsupported */ ASSERT(stk == NULL); - tp = kmem_alloc(sizeof(thread_priv_t), KM_PUSHPAGE); + tp = kmem_alloc(sizeof (thread_priv_t), KM_PUSHPAGE); if (tp == NULL) return (NULL); @@ -96,14 +98,15 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tp->tp_name_size = strlen(name) + 1; tp->tp_name = kmem_alloc(tp->tp_name_size, KM_PUSHPAGE); - if (tp->tp_name == NULL) { - kmem_free(tp, sizeof(thread_priv_t)); + if (tp->tp_name == NULL) { + kmem_free(tp, sizeof (thread_priv_t)); return (NULL); } strncpy(tp->tp_name, name, tp->tp_name_size); - /* Strip trailing "_thread" from passed name which will be the func + /* + * Strip trailing "_thread" from passed name which will be the func * name since the exposed API has no parameter for passing a name. */ p = strstr(tp->tp_name, "_thread"); @@ -117,7 +120,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, tp->tp_pri = pri; tsk = spl_kthread_create(thread_generic_wrapper, (void *)tp, - "%s", tp->tp_name); + "%s", tp->tp_name); if (IS_ERR(tsk)) return (NULL); @@ -139,7 +142,7 @@ spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...) char name[TASK_COMM_LEN]; va_start(args, namefmt); - vsnprintf(name, sizeof(name), namefmt, args); + vsnprintf(name, sizeof (name), namefmt, args); va_end(args); do { tsk = kthread_create(func, data, "%s", name); diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 19b3b76cd..f019a0877 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) Vnode Implementation. */ @@ -43,27 +43,27 @@ vtype_t vn_mode_to_vtype(mode_t mode) { if (S_ISREG(mode)) - return VREG; + return (VREG); if (S_ISDIR(mode)) - return VDIR; + return (VDIR); if (S_ISCHR(mode)) - return VCHR; + return (VCHR); if (S_ISBLK(mode)) - return VBLK; + return (VBLK); if (S_ISFIFO(mode)) - return VFIFO; + return (VFIFO); if (S_ISLNK(mode)) - return VLNK; + return (VLNK); if (S_ISSOCK(mode)) - return VSOCK; + return (VSOCK); - return VNON; + return (VNON); } /* vn_mode_to_vtype() */ EXPORT_SYMBOL(vn_mode_to_vtype); @@ -71,27 +71,27 @@ mode_t vn_vtype_to_mode(vtype_t vtype) { if (vtype == VREG) - return S_IFREG; + return (S_IFREG); if (vtype == VDIR) - return S_IFDIR; + return (S_IFDIR); if (vtype == VCHR) - return S_IFCHR; + return (S_IFCHR); if (vtype == VBLK) - return S_IFBLK; + return (S_IFBLK); if (vtype == VFIFO) - return S_IFIFO; + return (S_IFIFO); if (vtype == VLNK) - return S_IFLNK; + return (S_IFLNK); if (vtype == VSOCK) - return S_IFSOCK; + return (S_IFSOCK); - return VNON; + return (VNON); } /* vn_vtype_to_mode() */ EXPORT_SYMBOL(vn_vtype_to_mode); @@ -135,7 +135,8 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, if (!(flags & FCREAT) && (flags & FWRITE)) flags |= FEXCL; - /* Note for filp_open() the two low bits must be remapped to mean: + /* + * Note for filp_open() the two low bits must be remapped to mean: * 01 - read-only -> 00 read-only * 10 - write-only -> 01 write-only * 11 - read-write -> 10 read-write @@ -148,7 +149,7 @@ vn_open(const char *path, uio_seg_t seg, int flags, int mode, fp = filp_open(path, flags, mode); if (flags & FCREAT) - (void)xchg(¤t->fs->umask, saved_umask); + (void) xchg(¤t->fs->umask, saved_umask); if (IS_ERR(fp)) return (-PTR_ERR(fp)); @@ -187,7 +188,7 @@ EXPORT_SYMBOL(vn_open); int vn_openat(const char *path, uio_seg_t seg, int flags, int mode, - vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd) + vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd) { char *realpath; int len, rc; @@ -199,7 +200,7 @@ vn_openat(const char *path, uio_seg_t seg, int flags, int mode, if (!realpath) return (ENOMEM); - (void)snprintf(realpath, len, "/%s", path); + (void) snprintf(realpath, len, "/%s", path); rc = vn_open(realpath, seg, flags, mode, vpp, x1, x2); kfree(realpath); @@ -259,9 +260,11 @@ vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4) } /* vn_close() */ EXPORT_SYMBOL(vn_close); -/* vn_seek() does not actually seek it only performs bounds checking on the +/* + * vn_seek() does not actually seek it only performs bounds checking on the * proposed seek. We perform minimal checking and allow vn_rdwr() to catch - * anything more serious. */ + * anything more serious. + */ int vn_seek(vnode_t *vp, offset_t ooff, offset_t *noffp, void *ct) { @@ -293,26 +296,27 @@ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4) if (rc) return (-rc); - vap->va_type = vn_mode_to_vtype(stat.mode); - vap->va_mode = stat.mode; - vap->va_uid = KUID_TO_SUID(stat.uid); - vap->va_gid = KGID_TO_SGID(stat.gid); - vap->va_fsid = 0; - vap->va_nodeid = stat.ino; - vap->va_nlink = stat.nlink; - vap->va_size = stat.size; - vap->va_blksize = stat.blksize; - vap->va_atime = stat.atime; - vap->va_mtime = stat.mtime; - vap->va_ctime = stat.ctime; - vap->va_rdev = stat.rdev; - vap->va_nblocks = stat.blocks; + vap->va_type = vn_mode_to_vtype(stat.mode); + vap->va_mode = stat.mode; + vap->va_uid = KUID_TO_SUID(stat.uid); + vap->va_gid = KGID_TO_SGID(stat.gid); + vap->va_fsid = 0; + vap->va_nodeid = stat.ino; + vap->va_nlink = stat.nlink; + vap->va_size = stat.size; + vap->va_blksize = stat.blksize; + vap->va_atime = stat.atime; + vap->va_mtime = stat.mtime; + vap->va_ctime = stat.ctime; + vap->va_rdev = stat.rdev; + vap->va_nblocks = stat.blocks; return (0); } EXPORT_SYMBOL(vn_getattr); -int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4) +int +vn_fsync(vnode_t *vp, int flags, void *x3, void *x4) { int datasync = 0; int error; @@ -412,22 +416,22 @@ EXPORT_SYMBOL(vn_space); static file_t * file_find(int fd, struct task_struct *task) { - file_t *fp; + file_t *fp; - list_for_each_entry(fp, &vn_file_list, f_list) { + list_for_each_entry(fp, &vn_file_list, f_list) { if (fd == fp->f_fd && fp->f_task == task) { ASSERT(atomic_read(&fp->f_ref) != 0); - return fp; + return (fp); } } - return NULL; + return (NULL); } /* file_find() */ file_t * vn_getf(int fd) { - struct kstat stat; + struct kstat stat; struct file *lfp; file_t *fp; vnode_t *vp; @@ -482,13 +486,14 @@ vn_getf(int fd) goto out_fget; #if defined(HAVE_4ARGS_VFS_GETATTR) - rc = vfs_getattr(&lfp->f_path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT); + rc = vfs_getattr(&lfp->f_path, &stat, STATX_TYPE, + AT_STATX_SYNC_AS_STAT); #elif defined(HAVE_2ARGS_VFS_GETATTR) rc = vfs_getattr(&lfp->f_path, &stat); #else rc = vfs_getattr(lfp->f_path.mnt, lfp->f_dentry, &stat); #endif - if (rc) + if (rc) goto out_vnode; mutex_enter(&vp->v_lock); @@ -515,7 +520,7 @@ out_mutex: mutex_exit(&fp->f_lock); kmem_cache_free(vn_file_cache, fp); out: - return (NULL); + return (NULL); } /* getf() */ EXPORT_SYMBOL(getf); @@ -556,12 +561,10 @@ vn_areleasef(int fd, uf_info_t *fip) return; } - list_del(&fp->f_list); + list_del(&fp->f_list); releasef_locked(fp); } spin_unlock(&vn_file_lock); - - return; } /* releasef() */ EXPORT_SYMBOL(areleasef); @@ -596,34 +599,34 @@ vn_set_fs_pwd(struct fs_struct *fs, struct path *path) int vn_set_pwd(const char *filename) { - struct path path; - mm_segment_t saved_fs; - int rc; - - /* - * user_path_dir() and __user_walk() both expect 'filename' to be - * a user space address so we must briefly increase the data segment - * size to ensure strncpy_from_user() does not fail with -EFAULT. - */ - saved_fs = get_fs(); - set_fs(get_ds()); - - rc = user_path_dir(filename, &path); - if (rc) + struct path path; + mm_segment_t saved_fs; + int rc; + + /* + * user_path_dir() and __user_walk() both expect 'filename' to be + * a user space address so we must briefly increase the data segment + * size to ensure strncpy_from_user() does not fail with -EFAULT. + */ + saved_fs = get_fs(); + set_fs(get_ds()); + + rc = user_path_dir(filename, &path); + if (rc) goto out; - rc = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); - if (rc) + rc = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); + if (rc) goto dput_and_out; - vn_set_fs_pwd(current->fs, &path); + vn_set_fs_pwd(current->fs, &path); dput_and_out: - path_put(&path); + path_put(&path); out: set_fs(saved_fs); - return (-rc); + return (-rc); } /* vn_set_pwd() */ EXPORT_SYMBOL(vn_set_pwd); @@ -651,10 +654,10 @@ vn_file_cache_constructor(void *buf, void *cdrarg, int kmflags) file_t *fp = buf; atomic_set(&fp->f_ref, 0); - mutex_init(&fp->f_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&fp->f_lock, NULL, MUTEX_DEFAULT, NULL); INIT_LIST_HEAD(&fp->f_list); - return (0); + return (0); } /* file_cache_constructor() */ static void @@ -669,29 +672,26 @@ int spl_vn_init(void) { vn_cache = kmem_cache_create("spl_vn_cache", - sizeof(struct vnode), 64, - vn_cache_constructor, - vn_cache_destructor, - NULL, NULL, NULL, 0); + sizeof (struct vnode), 64, vn_cache_constructor, + vn_cache_destructor, NULL, NULL, NULL, 0); vn_file_cache = kmem_cache_create("spl_vn_file_cache", - sizeof(file_t), 64, - vn_file_cache_constructor, - vn_file_cache_destructor, - NULL, NULL, NULL, 0); + sizeof (file_t), 64, vn_file_cache_constructor, + vn_file_cache_destructor, NULL, NULL, NULL, 0); + return (0); } /* vn_init() */ void spl_vn_fini(void) { - file_t *fp, *next_fp; + file_t *fp, *next_fp; int leaked = 0; spin_lock(&vn_file_lock); - list_for_each_entry_safe(fp, next_fp, &vn_file_list, f_list) { - list_del(&fp->f_list); + list_for_each_entry_safe(fp, next_fp, &vn_file_list, f_list) { + list_del(&fp->f_list); releasef_locked(fp); leaked++; } @@ -703,6 +703,4 @@ spl_vn_fini(void) kmem_cache_destroy(vn_file_cache); kmem_cache_destroy(vn_cache); - - return; } /* vn_fini() */ diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index 04a337c2b..c582913f1 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * * Solaris Porting Layer (SPL) XDR Implementation. */ @@ -163,12 +163,12 @@ xdrmem_control(XDR *xdrs, int req, void *info) struct xdr_bytesrec *rec = (struct xdr_bytesrec *) info; if (req != XDR_GET_BYTES_AVAIL) - return FALSE; + return (FALSE); rec->xc_is_last_record = TRUE; /* always TRUE in xdrmem streams */ rec->xc_num_avail = xdrs->x_addr_end - xdrs->x_addr; - return TRUE; + return (TRUE); } static bool_t @@ -178,13 +178,13 @@ xdrmem_enc_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt) uint_t pad; if (size < cnt) - return FALSE; /* Integer overflow */ + return (FALSE); /* Integer overflow */ if (xdrs->x_addr > xdrs->x_addr_end) - return FALSE; + return (FALSE); if (xdrs->x_addr_end - xdrs->x_addr < size) - return FALSE; + return (FALSE); memcpy(xdrs->x_addr, cp, cnt); @@ -196,7 +196,7 @@ xdrmem_enc_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt) xdrs->x_addr += pad; } - return TRUE; + return (TRUE); } static bool_t @@ -207,13 +207,13 @@ xdrmem_dec_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt) uint_t pad; if (size < cnt) - return FALSE; /* Integer overflow */ + return (FALSE); /* Integer overflow */ if (xdrs->x_addr > xdrs->x_addr_end) - return FALSE; + return (FALSE); if (xdrs->x_addr_end - xdrs->x_addr < size) - return FALSE; + return (FALSE); memcpy(cp, xdrs->x_addr, cnt); xdrs->x_addr += cnt; @@ -222,38 +222,38 @@ xdrmem_dec_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt) if (pad > 0) { /* An inverted memchr() would be useful here... */ if (memcmp(&zero, xdrs->x_addr, pad) != 0) - return FALSE; + return (FALSE); xdrs->x_addr += pad; } - return TRUE; + return (TRUE); } static bool_t xdrmem_enc_uint32(XDR *xdrs, uint32_t val) { - if (xdrs->x_addr + sizeof(uint32_t) > xdrs->x_addr_end) - return FALSE; + if (xdrs->x_addr + sizeof (uint32_t) > xdrs->x_addr_end) + return (FALSE); *((uint32_t *) xdrs->x_addr) = cpu_to_be32(val); - xdrs->x_addr += sizeof(uint32_t); + xdrs->x_addr += sizeof (uint32_t); - return TRUE; + return (TRUE); } static bool_t xdrmem_dec_uint32(XDR *xdrs, uint32_t *val) { - if (xdrs->x_addr + sizeof(uint32_t) > xdrs->x_addr_end) - return FALSE; + if (xdrs->x_addr + sizeof (uint32_t) > xdrs->x_addr_end) + return (FALSE); *val = be32_to_cpu(*((uint32_t *) xdrs->x_addr)); - xdrs->x_addr += sizeof(uint32_t); + xdrs->x_addr += sizeof (uint32_t); - return TRUE; + return (TRUE); } static bool_t @@ -261,10 +261,10 @@ xdrmem_enc_char(XDR *xdrs, char *cp) { uint32_t val; - BUILD_BUG_ON(sizeof(char) != 1); + BUILD_BUG_ON(sizeof (char) != 1); val = *((unsigned char *) cp); - return xdrmem_enc_uint32(xdrs, val); + return (xdrmem_enc_uint32(xdrs, val)); } static bool_t @@ -272,10 +272,10 @@ xdrmem_dec_char(XDR *xdrs, char *cp) { uint32_t val; - BUILD_BUG_ON(sizeof(char) != 1); + BUILD_BUG_ON(sizeof (char) != 1); if (!xdrmem_dec_uint32(xdrs, &val)) - return FALSE; + return (FALSE); /* * If any of the 3 other bytes are non-zero then val will be greater @@ -283,19 +283,19 @@ xdrmem_dec_char(XDR *xdrs, char *cp) * not have a char encoded in it. */ if (val > 0xff) - return FALSE; + return (FALSE); *((unsigned char *) cp) = val; - return TRUE; + return (TRUE); } static bool_t xdrmem_enc_ushort(XDR *xdrs, unsigned short *usp) { - BUILD_BUG_ON(sizeof(unsigned short) != 2); + BUILD_BUG_ON(sizeof (unsigned short) != 2); - return xdrmem_enc_uint32(xdrs, *usp); + return (xdrmem_enc_uint32(xdrs, *usp)); } static bool_t @@ -303,48 +303,48 @@ xdrmem_dec_ushort(XDR *xdrs, unsigned short *usp) { uint32_t val; - BUILD_BUG_ON(sizeof(unsigned short) != 2); + BUILD_BUG_ON(sizeof (unsigned short) != 2); if (!xdrmem_dec_uint32(xdrs, &val)) - return FALSE; + return (FALSE); /* * Short ints are not in the RFC, but we assume similar logic as in * xdrmem_dec_char(). */ if (val > 0xffff) - return FALSE; + return (FALSE); *usp = val; - return TRUE; + return (TRUE); } static bool_t xdrmem_enc_uint(XDR *xdrs, unsigned *up) { - BUILD_BUG_ON(sizeof(unsigned) != 4); + BUILD_BUG_ON(sizeof (unsigned) != 4); - return xdrmem_enc_uint32(xdrs, *up); + return (xdrmem_enc_uint32(xdrs, *up)); } static bool_t xdrmem_dec_uint(XDR *xdrs, unsigned *up) { - BUILD_BUG_ON(sizeof(unsigned) != 4); + BUILD_BUG_ON(sizeof (unsigned) != 4); - return xdrmem_dec_uint32(xdrs, (uint32_t *) up); + return (xdrmem_dec_uint32(xdrs, (uint32_t *) up)); } static bool_t xdrmem_enc_ulonglong(XDR *xdrs, u_longlong_t *ullp) { - BUILD_BUG_ON(sizeof(u_longlong_t) != 8); + BUILD_BUG_ON(sizeof (u_longlong_t) != 8); if (!xdrmem_enc_uint32(xdrs, *ullp >> 32)) - return FALSE; + return (FALSE); - return xdrmem_enc_uint32(xdrs, *ullp & 0xffffffff); + return (xdrmem_enc_uint32(xdrs, *ullp & 0xffffffff)); } static bool_t @@ -352,16 +352,16 @@ xdrmem_dec_ulonglong(XDR *xdrs, u_longlong_t *ullp) { uint32_t low, high; - BUILD_BUG_ON(sizeof(u_longlong_t) != 8); + BUILD_BUG_ON(sizeof (u_longlong_t) != 8); if (!xdrmem_dec_uint32(xdrs, &high)) - return FALSE; + return (FALSE); if (!xdrmem_dec_uint32(xdrs, &low)) - return FALSE; + return (FALSE); *ullp = ((u_longlong_t) high << 32) | low; - return TRUE; + return (TRUE); } static bool_t @@ -372,18 +372,18 @@ xdr_enc_array(XDR *xdrs, caddr_t *arrp, uint_t *sizep, const uint_t maxsize, caddr_t addr = *arrp; if (*sizep > maxsize || *sizep > UINT_MAX / elsize) - return FALSE; + return (FALSE); if (!xdrmem_enc_uint(xdrs, sizep)) - return FALSE; + return (FALSE); for (i = 0; i < *sizep; i++) { if (!elproc(xdrs, addr)) - return FALSE; + return (FALSE); addr += elsize; } - return TRUE; + return (TRUE); } static bool_t @@ -395,23 +395,23 @@ xdr_dec_array(XDR *xdrs, caddr_t *arrp, uint_t *sizep, const uint_t maxsize, caddr_t addr; if (!xdrmem_dec_uint(xdrs, sizep)) - return FALSE; + return (FALSE); size = *sizep; if (size > maxsize || size > UINT_MAX / elsize) - return FALSE; + return (FALSE); /* * The Solaris man page says: "If *arrp is NULL when decoding, * xdr_array() allocates memory and *arrp points to it". */ if (*arrp == NULL) { - BUILD_BUG_ON(sizeof(uint_t) > sizeof(size_t)); + BUILD_BUG_ON(sizeof (uint_t) > sizeof (size_t)); *arrp = kmem_alloc(size * elsize, KM_NOSLEEP); if (*arrp == NULL) - return FALSE; + return (FALSE); alloc = TRUE; } @@ -422,12 +422,12 @@ xdr_dec_array(XDR *xdrs, caddr_t *arrp, uint_t *sizep, const uint_t maxsize, if (!elproc(xdrs, addr)) { if (alloc) kmem_free(*arrp, size * elsize); - return FALSE; + return (FALSE); } addr += elsize; } - return TRUE; + return (TRUE); } static bool_t @@ -437,14 +437,14 @@ xdr_enc_string(XDR *xdrs, char **sp, const uint_t maxsize) uint_t len; if (slen > maxsize) - return FALSE; + return (FALSE); len = slen; if (!xdrmem_enc_uint(xdrs, &len)) - return FALSE; + return (FALSE); - return xdrmem_enc_bytes(xdrs, *sp, len); + return (xdrmem_enc_bytes(xdrs, *sp, len)); } static bool_t @@ -454,21 +454,21 @@ xdr_dec_string(XDR *xdrs, char **sp, const uint_t maxsize) bool_t alloc = FALSE; if (!xdrmem_dec_uint(xdrs, &size)) - return FALSE; + return (FALSE); if (size > maxsize || size > UINT_MAX - 1) - return FALSE; + return (FALSE); /* * Solaris man page: "If *sp is NULL when decoding, xdr_string() * allocates memory and *sp points to it". */ if (*sp == NULL) { - BUILD_BUG_ON(sizeof(uint_t) > sizeof(size_t)); + BUILD_BUG_ON(sizeof (uint_t) > sizeof (size_t)); *sp = kmem_alloc(size + 1, KM_NOSLEEP); if (*sp == NULL) - return FALSE; + return (FALSE); alloc = TRUE; } @@ -481,34 +481,33 @@ xdr_dec_string(XDR *xdrs, char **sp, const uint_t maxsize) (*sp)[size] = '\0'; - return TRUE; + return (TRUE); fail: if (alloc) kmem_free(*sp, size + 1); - return FALSE; + return (FALSE); } static struct xdr_ops xdrmem_encode_ops = { - .xdr_control = xdrmem_control, - .xdr_char = xdrmem_enc_char, - .xdr_u_short = xdrmem_enc_ushort, - .xdr_u_int = xdrmem_enc_uint, - .xdr_u_longlong_t = xdrmem_enc_ulonglong, - .xdr_opaque = xdrmem_enc_bytes, - .xdr_string = xdr_enc_string, - .xdr_array = xdr_enc_array + .xdr_control = xdrmem_control, + .xdr_char = xdrmem_enc_char, + .xdr_u_short = xdrmem_enc_ushort, + .xdr_u_int = xdrmem_enc_uint, + .xdr_u_longlong_t = xdrmem_enc_ulonglong, + .xdr_opaque = xdrmem_enc_bytes, + .xdr_string = xdr_enc_string, + .xdr_array = xdr_enc_array }; static struct xdr_ops xdrmem_decode_ops = { - .xdr_control = xdrmem_control, - .xdr_char = xdrmem_dec_char, - .xdr_u_short = xdrmem_dec_ushort, - .xdr_u_int = xdrmem_dec_uint, - .xdr_u_longlong_t = xdrmem_dec_ulonglong, - .xdr_opaque = xdrmem_dec_bytes, - .xdr_string = xdr_dec_string, - .xdr_array = xdr_dec_array + .xdr_control = xdrmem_control, + .xdr_char = xdrmem_dec_char, + .xdr_u_short = xdrmem_dec_ushort, + .xdr_u_int = xdrmem_dec_uint, + .xdr_u_longlong_t = xdrmem_dec_ulonglong, + .xdr_opaque = xdrmem_dec_bytes, + .xdr_string = xdr_dec_string, + .xdr_array = xdr_dec_array }; - diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c index 609bf5048..177a626df 100644 --- a/module/spl/spl-zlib.c +++ b/module/spl/spl-zlib.c @@ -20,7 +20,8 @@ * * You should have received a copy of the GNU General Public License along * with the SPL. If not, see . - ***************************************************************************** + * + * * z_compress_level/z_uncompress are nearly identical copies of the * compress2/uncompress functions provided by the official zlib package * available at http://zlib.net/. The only changes made we to slightly @@ -72,7 +73,7 @@ static spl_kmem_cache_t *zlib_workspace_cache; static void * zlib_workspace_alloc(int flags) { - return kmem_cache_alloc(zlib_workspace_cache, flags & ~(__GFP_FS)); + return (kmem_cache_alloc(zlib_workspace_cache, flags & ~(__GFP_FS))); } static void @@ -94,7 +95,7 @@ zlib_workspace_free(void *workspace) */ int z_compress_level(void *dest, size_t *destLen, const void *source, - size_t sourceLen, int level) + size_t sourceLen, int level) { z_stream stream; int err; @@ -105,30 +106,30 @@ z_compress_level(void *dest, size_t *destLen, const void *source, stream.avail_out = (uInt)*destLen; if ((size_t)stream.avail_out != *destLen) - return Z_BUF_ERROR; + return (Z_BUF_ERROR); stream.workspace = zlib_workspace_alloc(KM_SLEEP); if (!stream.workspace) - return Z_MEM_ERROR; + return (Z_MEM_ERROR); err = zlib_deflateInit(&stream, level); if (err != Z_OK) { zlib_workspace_free(stream.workspace); - return err; + return (err); } err = zlib_deflate(&stream, Z_FINISH); if (err != Z_STREAM_END) { zlib_deflateEnd(&stream); zlib_workspace_free(stream.workspace); - return err == Z_OK ? Z_BUF_ERROR : err; + return (err == Z_OK ? Z_BUF_ERROR : err); } *destLen = stream.total_out; err = zlib_deflateEnd(&stream); zlib_workspace_free(stream.workspace); - return err; + return (err); } EXPORT_SYMBOL(z_compress_level); @@ -159,16 +160,16 @@ z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen) stream.avail_out = (uInt)*destLen; if ((size_t)stream.avail_out != *destLen) - return Z_BUF_ERROR; + return (Z_BUF_ERROR); stream.workspace = zlib_workspace_alloc(KM_SLEEP); if (!stream.workspace) - return Z_MEM_ERROR; + return (Z_MEM_ERROR); err = zlib_inflateInit(&stream); if (err != Z_OK) { zlib_workspace_free(stream.workspace); - return err; + return (err); } err = zlib_inflate(&stream, Z_FINISH); @@ -177,17 +178,17 @@ z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen) zlib_workspace_free(stream.workspace); if (err == Z_NEED_DICT || - (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; + (err == Z_BUF_ERROR && stream.avail_in == 0)) + return (Z_DATA_ERROR); - return err; + return (err); } *destLen = stream.total_out; err = zlib_inflateEnd(&stream); zlib_workspace_free(stream.workspace); - return err; + return (err); } EXPORT_SYMBOL(z_uncompress); @@ -203,15 +204,15 @@ spl_zlib_init(void) "spl_zlib_workspace_cache", size, 0, NULL, NULL, NULL, NULL, NULL, KMC_VMEM | KMC_NOEMERGENCY); - if (!zlib_workspace_cache) + if (!zlib_workspace_cache) return (1); - return (0); + return (0); } void spl_zlib_fini(void) { kmem_cache_destroy(zlib_workspace_cache); - zlib_workspace_cache = NULL; + zlib_workspace_cache = NULL; } -- cgit v1.2.3 From 3673d032850c3b54b8b2cc74cf1782a75cc9b2a9 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sat, 24 Feb 2018 10:05:37 -0800 Subject: Fix more cstyle warnings This patch contains no functional changes. It is solely intended to resolve cstyle warnings in order to facilitate moving the spl source code in to the zfs repository. Reviewed-by: Giuseppe Di Natale Reviewed by: George Melikov Signed-off-by: Brian Behlendorf Closes #687 --- module/spl/spl-err.c | 5 ++++- module/spl/spl-generic.c | 11 ++++++++--- module/spl/spl-kmem-cache.c | 5 ++++- module/spl/spl-kmem.c | 5 ++++- module/spl/spl-kstat.c | 17 ++++++++++------- module/spl/spl-proc.c | 18 ++++++++++-------- module/spl/spl-thread.c | 3 +-- module/spl/spl-vnode.c | 11 +++++------ module/spl/spl-xdr.c | 10 +++++----- 9 files changed, 51 insertions(+), 34 deletions(-) (limited to 'module/spl/spl-err.c') diff --git a/module/spl/spl-err.c b/module/spl/spl-err.c index 33a8df898..6b71296e8 100644 --- a/module/spl/spl-err.c +++ b/module/spl/spl-err.c @@ -34,9 +34,11 @@ * analysis and other such goodies. * But we would still default to the current default of not to do that. */ +/* BEGIN CSTYLED */ unsigned int spl_panic_halt; module_param(spl_panic_halt, uint, 0644); MODULE_PARM_DESC(spl_panic_halt, "Cause kernel panic on assertion failures"); +/* END CSTYLED */ /* * Limit the number of stack traces dumped to not more than 5 every @@ -55,7 +57,8 @@ spl_dumpstack(void) EXPORT_SYMBOL(spl_dumpstack); int -spl_panic(const char *file, const char *func, int line, const char *fmt, ...) { +spl_panic(const char *file, const char *func, int line, const char *fmt, ...) +{ const char *newfile; char msg[MAXMSGLEN]; va_list ap; diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index efd901094..2a8972691 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -50,10 +50,12 @@ char spl_version[32] = "SPL v" SPL_META_VERSION "-" SPL_META_RELEASE; EXPORT_SYMBOL(spl_version); +/* BEGIN CSTYLED */ unsigned long spl_hostid = 0; EXPORT_SYMBOL(spl_hostid); module_param(spl_hostid, ulong, 0644); MODULE_PARM_DESC(spl_hostid, "The system hostid."); +/* END CSTYLED */ proc_t p0; EXPORT_SYMBOL(p0); @@ -98,7 +100,8 @@ static DEFINE_PER_CPU(uint64_t[2], spl_pseudo_entropy); */ static inline uint64_t -spl_rand_next(uint64_t *s) { +spl_rand_next(uint64_t *s) +{ uint64_t s1 = s[0]; const uint64_t s0 = s[1]; s[0] = s0; @@ -108,7 +111,8 @@ spl_rand_next(uint64_t *s) { } static inline void -spl_rand_jump(uint64_t *s) { +spl_rand_jump(uint64_t *s) +{ static const uint64_t JUMP[] = { 0x8a5cd789635d2dff, 0x121fd2155c472f96 }; @@ -184,7 +188,8 @@ EXPORT_SYMBOL(random_get_pseudo_bytes); * Calculate number of leading of zeros for a 64-bit value. */ static int -nlz64(uint64_t x) { +nlz64(uint64_t x) +{ register int n = 0; if (x == 0) diff --git a/module/spl/spl-kmem-cache.c b/module/spl/spl-kmem-cache.c index e4bcdd825..c73a2fdc2 100644 --- a/module/spl/spl-kmem-cache.c +++ b/module/spl/spl-kmem-cache.c @@ -66,6 +66,7 @@ * because it has been shown to improve responsiveness on low memory systems. * This policy may be changed by setting KMC_EXPIRE_AGE or KMC_EXPIRE_MEM. */ +/* BEGIN CSTYLED */ unsigned int spl_kmem_cache_expire = KMC_EXPIRE_MEM; EXPORT_SYMBOL(spl_kmem_cache_expire); module_param(spl_kmem_cache_expire, uint, 0644); @@ -148,6 +149,7 @@ unsigned int spl_kmem_cache_kmem_threads = 4; module_param(spl_kmem_cache_kmem_threads, uint, 0444); MODULE_PARM_DESC(spl_kmem_cache_kmem_threads, "Number of spl_kmem_cache threads"); +/* END CSTYLED */ /* * Slab allocation interfaces @@ -356,8 +358,9 @@ out: if (rc) { if (skc->skc_flags & KMC_OFFSLAB) list_for_each_entry_safe(sko, - n, &sks->sks_free_list, sko_list) + n, &sks->sks_free_list, sko_list) { kv_free(skc, sko->sko_addr, offslab_size); + } kv_free(skc, base, skc->skc_slab_size); sks = NULL; diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index bf9c6b179..e0d551041 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -44,6 +44,7 @@ * allocations are quickly caught. These warnings may be disabled by setting * the threshold to zero. */ +/* BEGIN CSTYLED */ unsigned int spl_kmem_alloc_warn = MIN(16 * PAGE_SIZE, 64 * 1024); module_param(spl_kmem_alloc_warn, uint, 0644); MODULE_PARM_DESC(spl_kmem_alloc_warn, @@ -64,6 +65,7 @@ module_param(spl_kmem_alloc_max, uint, 0644); MODULE_PARM_DESC(spl_kmem_alloc_max, "Maximum size in bytes for a kmem_alloc()"); EXPORT_SYMBOL(spl_kmem_alloc_max); +/* END CSTYLED */ int kmem_debugging(void) @@ -520,10 +522,11 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock) printk(KERN_WARNING "%-16s %-5s %-16s %s:%s\n", "address", "size", "data", "func", "line"); - list_for_each_entry(kd, list, kd_list) + list_for_each_entry(kd, list, kd_list) { printk(KERN_WARNING "%p %-5d %-16s %s:%d\n", kd->kd_addr, (int)kd->kd_size, spl_sprintf_addr(kd, str, 17, 8), kd->kd_func, kd->kd_line); + } spin_unlock_irqrestore(lock, flags); } diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 405ece0ad..10e93f318 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -305,7 +305,7 @@ restart: } else { ASSERT(ksp->ks_ndata == 1); rc = kstat_seq_show_raw(f, ksp->ks_data, - ksp->ks_data_size); + ksp->ks_data_size); } break; case KSTAT_TYPE_NAMED: @@ -434,9 +434,10 @@ kstat_find_module(char *name) { kstat_module_t *module; - list_for_each_entry(module, &kstat_module_list, ksm_module_list) + list_for_each_entry(module, &kstat_module_list, ksm_module_list) { if (strncmp(name, module->ksm_name, KSTAT_STRLEN) == 0) return (module); + } return (NULL); } @@ -517,9 +518,9 @@ static struct file_operations proc_kstat_operations = { void __kstat_set_raw_ops(kstat_t *ksp, - int (*headers)(char *buf, size_t size), - int (*data)(char *buf, size_t size, void *data), - void *(*addr)(kstat_t *ksp, loff_t index)) + int (*headers)(char *buf, size_t size), + int (*data)(char *buf, size_t size, void *data), + void *(*addr)(kstat_t *ksp, loff_t index)) { ksp->ks_raw_ops.headers = headers; ksp->ks_raw_ops.data = data; @@ -628,11 +629,12 @@ kstat_detect_collision(kstat_t *ksp) cp[0] = '\0'; if ((module = kstat_find_module(parent)) != NULL) { - list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) + list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) { if (strncmp(tmp->ks_name, cp+1, KSTAT_STRLEN) == 0) { strfree(parent); return (EEXIST); } + } } strfree(parent); @@ -665,9 +667,10 @@ __kstat_install(kstat_t *ksp) * Only one entry by this name per-module, on failure the module * shouldn't be deleted because we know it has at least one entry. */ - list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) + list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) { if (strncmp(tmp->ks_name, ksp->ks_name, KSTAT_STRLEN) == 0) goto out; + } list_add_tail(&ksp->ks_list, &module->ksm_kstat_list); diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index f5998a06e..796f69e48 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -85,8 +85,8 @@ proc_copyin_string(char *kbuffer, int kbuffer_size, const char *ubuffer, } static int -proc_copyout_string(char *ubuffer, int ubuffer_size, - const char *kbuffer, char *append) +proc_copyout_string(char *ubuffer, int ubuffer_size, const char *kbuffer, + char *append) { /* * NB if 'append' != NULL, it's a single character to append to the @@ -239,9 +239,11 @@ taskq_seq_show_headers(struct seq_file *f) #define LHEAD_ACTIVE 4 #define LHEAD_SIZE 5 +/* BEGIN CSTYLED */ static unsigned int spl_max_show_tasks = 512; module_param(spl_max_show_tasks, uint, 0644); MODULE_PARM_DESC(spl_max_show_tasks, "Max number of tasks shown in taskq proc"); +/* END CSTYLED */ static int taskq_seq_show_impl(struct seq_file *f, void *p, boolean_t allflag) @@ -719,15 +721,15 @@ spl_proc_init(void) goto out; } - proc_spl_taskq_all = proc_create_data("taskq-all", 0444, - proc_spl, &proc_taskq_all_operations, NULL); + proc_spl_taskq_all = proc_create_data("taskq-all", 0444, proc_spl, + &proc_taskq_all_operations, NULL); if (proc_spl_taskq_all == NULL) { rc = -EUNATCH; goto out; } - proc_spl_taskq = proc_create_data("taskq", 0444, - proc_spl, &proc_taskq_operations, NULL); + proc_spl_taskq = proc_create_data("taskq", 0444, proc_spl, + &proc_taskq_operations, NULL); if (proc_spl_taskq == NULL) { rc = -EUNATCH; goto out; @@ -739,8 +741,8 @@ spl_proc_init(void) goto out; } - proc_spl_kmem_slab = proc_create_data("slab", 0444, - proc_spl_kmem, &proc_slab_operations, NULL); + proc_spl_kmem_slab = proc_create_data("slab", 0444, proc_spl_kmem, + &proc_slab_operations, NULL); if (proc_spl_kmem_slab == NULL) { rc = -EUNATCH; goto out; diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index 9ad044161..d441ad65f 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -79,8 +79,7 @@ EXPORT_SYMBOL(__thread_exit); */ kthread_t * __thread_create(caddr_t stk, size_t stksize, thread_func_t func, - const char *name, void *args, size_t len, proc_t *pp, - int state, pri_t pri) + const char *name, void *args, size_t len, proc_t *pp, int state, pri_t pri) { thread_priv_t *tp; struct task_struct *tsk; diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 79ca89ee0..a371fb966 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -118,8 +118,8 @@ vn_free(vnode_t *vp) EXPORT_SYMBOL(vn_free); int -vn_open(const char *path, uio_seg_t seg, int flags, int mode, - vnode_t **vpp, int x1, void *x2) +vn_open(const char *path, uio_seg_t seg, int flags, int mode, vnode_t **vpp, + int x1, void *x2) { struct file *fp; struct kstat stat; @@ -210,7 +210,7 @@ EXPORT_SYMBOL(vn_openat); int vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off, - uio_seg_t seg, int ioflag, rlim64_t x2, void *x3, ssize_t *residp) + uio_seg_t seg, int ioflag, rlim64_t x2, void *x3, ssize_t *residp) { struct file *fp = vp->v_file; loff_t offset = off; @@ -401,9 +401,8 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag, --end; vp->v_file->f_dentry->d_inode->i_op->truncate_range( - vp->v_file->f_dentry->d_inode, - bfp->l_start, end - ); + vp->v_file->f_dentry->d_inode, bfp->l_start, end); + return (0); } #endif diff --git a/module/spl/spl-xdr.c b/module/spl/spl-xdr.c index c582913f1..4055921b4 100644 --- a/module/spl/spl-xdr.c +++ b/module/spl/spl-xdr.c @@ -160,7 +160,7 @@ EXPORT_SYMBOL(xdrmem_create); static bool_t xdrmem_control(XDR *xdrs, int req, void *info) { - struct xdr_bytesrec *rec = (struct xdr_bytesrec *) info; + struct xdr_bytesrec *rec = (struct xdr_bytesrec *)info; if (req != XDR_GET_BYTES_AVAIL) return (FALSE); @@ -236,7 +236,7 @@ xdrmem_enc_uint32(XDR *xdrs, uint32_t val) if (xdrs->x_addr + sizeof (uint32_t) > xdrs->x_addr_end) return (FALSE); - *((uint32_t *) xdrs->x_addr) = cpu_to_be32(val); + *((uint32_t *)xdrs->x_addr) = cpu_to_be32(val); xdrs->x_addr += sizeof (uint32_t); @@ -249,7 +249,7 @@ xdrmem_dec_uint32(XDR *xdrs, uint32_t *val) if (xdrs->x_addr + sizeof (uint32_t) > xdrs->x_addr_end) return (FALSE); - *val = be32_to_cpu(*((uint32_t *) xdrs->x_addr)); + *val = be32_to_cpu(*((uint32_t *)xdrs->x_addr)); xdrs->x_addr += sizeof (uint32_t); @@ -333,7 +333,7 @@ xdrmem_dec_uint(XDR *xdrs, unsigned *up) { BUILD_BUG_ON(sizeof (unsigned) != 4); - return (xdrmem_dec_uint32(xdrs, (uint32_t *) up)); + return (xdrmem_dec_uint32(xdrs, (uint32_t *)up)); } static bool_t @@ -359,7 +359,7 @@ xdrmem_dec_ulonglong(XDR *xdrs, u_longlong_t *ullp) if (!xdrmem_dec_uint32(xdrs, &low)) return (FALSE); - *ullp = ((u_longlong_t) high << 32) | low; + *ullp = ((u_longlong_t)high << 32) | low; return (TRUE); } -- cgit v1.2.3