X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fspa_errlog.c;h=3fab1922c0c60135ce095228cc5af8a51c509ec5;hb=b4f7f105275d996fbcb6abd65760307d2153a89b;hp=ac0a20aaf074ab7ea512b1cfed0a348ce7d12359;hpb=9babb37438b58e77bad04e820d5702e15b79e6a6;p=zfs.git diff --git a/module/zfs/spa_errlog.c b/module/zfs/spa_errlog.c index ac0a20a..3fab192 100644 --- a/module/zfs/spa_errlog.c +++ b/module/zfs/spa_errlog.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -54,38 +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 -uint64_t -strtonum(const 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++; - } - - if (nptr) - *nptr = (char *)str; - - return (val); -} -#endif /* * Convert a bookmark to a string. @@ -134,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); @@ -434,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