X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fspa_errlog.c;h=3fab1922c0c60135ce095228cc5af8a51c509ec5;hb=570d6edf1d94917aab49c5755027d05b3c7bcd43;hp=c642bd768b4976e2a47ad238795c8a47fc2d6e50;hpb=172bb4bd5e4afef721dd4d2972d8680d983f144b;p=zfs.git diff --git a/module/zfs/spa_errlog.c b/module/zfs/spa_errlog.c index c642bd7..3fab192 100644 --- a/module/zfs/spa_errlog.c +++ b/module/zfs/spa_errlog.c @@ -19,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines to manage the on-disk persistent error log. * @@ -56,37 +53,6 @@ #include #include -/* - * This is a stripped-down version of strtoull, suitable only for converting - * lowercase hexidecimal numbers that don't overflow. - */ -#ifdef _KERNEL -static uint64_t -strtonum(char *str, char **nptr) -{ - uint64_t val = 0; - char c; - int digit; - - while ((c = *str) != '\0') { - if (c >= '0' && c <= '9') - digit = c - '0'; - else if (c >= 'a' && c <= 'f') - digit = 10 + c - 'a'; - else - break; - - val *= 16; - val += digit; - - str++; - } - - *nptr = str; - - return (val); -} -#endif /* * Convert a bookmark to a string. @@ -135,7 +101,7 @@ spa_log_error(spa_t *spa, zio_t *zio) * If we are trying to import a pool, ignore any errors, as we won't be * writing to the pool any time soon. */ - if (spa->spa_load_state == SPA_LOAD_TRYIMPORT) + if (spa_load_state(spa) == SPA_LOAD_TRYIMPORT) return; mutex_enter(&spa->spa_errlist_lock); @@ -435,3 +401,14 @@ spa_errlog_sync(spa_t *spa, uint64_t txg) mutex_exit(&spa->spa_errlog_lock); } + +#if defined(_KERNEL) && defined(HAVE_SPL) +/* error handling */ +EXPORT_SYMBOL(spa_log_error); +EXPORT_SYMBOL(spa_get_errlog_size); +EXPORT_SYMBOL(spa_get_errlog); +EXPORT_SYMBOL(spa_errlog_rotate); +EXPORT_SYMBOL(spa_errlog_drain); +EXPORT_SYMBOL(spa_errlog_sync); +EXPORT_SYMBOL(spa_get_errlists); +#endif