From 063b8917f2cb6a041f16c02ed902756ef7313642 Mon Sep 17 00:00:00 2001 From: mm Date: Wed, 12 Sep 2012 18:05:43 +0000 Subject: Merge recent zfs vendor changes, sync code and adjust userland DEBUG. Illumos issued covered: 1884 Empty "used" field for zfs *space commands 3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero 3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID 3048 zfs {user,group}space [-s|-S] is broken 3049 zfs {user,group}space -t doesn't really filter the results 3060 zfs {user,group}space -H output isn't tab-delimited 3061 zfs {user,group}space -o doesn't use specified fields order 3064 usr/src/cmd/zpool/zpool_main.c misspells "successful" 3093 zfs {user,group}space's -i is noop 3098 zfs userspace/groupspace fail without saying why when run as non-root References: https://www.illumos.org/issues/ + [issue_id] Obtained from: illumos (vendor/illumos, vendor/illumos-sys) MFC after: 2 weeks --- sys/cddl/compat/opensolaris/sys/assfail.h | 36 ++++++++++++++++++++++++++ sys/cddl/compat/opensolaris/sys/debug.h | 42 +++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 sys/cddl/compat/opensolaris/sys/debug.h (limited to 'sys/cddl/compat') diff --git a/sys/cddl/compat/opensolaris/sys/assfail.h b/sys/cddl/compat/opensolaris/sys/assfail.h index 2397880..e6ff258 100644 --- a/sys/cddl/compat/opensolaris/sys/assfail.h +++ b/sys/cddl/compat/opensolaris/sys/assfail.h @@ -30,14 +30,50 @@ #define _OPENSOLARIS_SYS_ASSFAIL_H_ #include +#ifndef _KERNEL +#include +#include +#endif #ifdef __cplusplus extern "C" { #endif +#ifdef _KERNEL int assfail(const char *, const char *, int); void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *, int); +#else /* !defined(_KERNEL) */ + +#ifndef HAVE_ASSFAIL +static __inline int +__assfail(const char *expr, const char *file, int line) +{ + + (void)fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n", + expr, file, line); + abort(); + /* NOTREACHED */ + return (0); +} +#define assfail __assfail +#endif + +#ifndef HAVE_ASSFAIL3 +static __inline void +__assfail3(const char *expr, uintmax_t lv, const char *op, uintmax_t rv, + const char *file, int line) { + + (void)fprintf(stderr, + "Assertion failed: %s (0x%jx %s 0x%jx), file %s, line %d.\n", + expr, lv, op, rv, file, line); + abort(); + /* NOTREACHED */ +} +#define assfail3 __assfail3 +#endif + +#endif /* !defined(_KERNEL) */ #ifdef __cplusplus } diff --git a/sys/cddl/compat/opensolaris/sys/debug.h b/sys/cddl/compat/opensolaris/sys/debug.h new file mode 100644 index 0000000..eb344f8 --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/debug.h @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_DEBUG_H_ +#define _OPENSOLARIS_SYS_DEBUG_H_ + +#ifdef _KERNEL +#include + +#include_next +#else /* !_KERNEL */ + +#include_next +#include +#endif /* _KERNEL */ + +#endif /* _OPENSOLARIS_SYS_DEBUG_H_ */ -- cgit v1.1