spa_errlog.c (185029) | spa_errlog.c (209962) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. 24 */ 25 | 23 * Use is subject to license terms. 24 */ 25 |
26#pragma ident "%Z%%M% %I% %E% SMI" 27 | |
28/* 29 * Routines to manage the on-disk persistent error log. 30 * 31 * Each pool stores a log of all logical data errors seen during normal 32 * operation. This is actually the union of two distinct logs: the last log, 33 * and the current log. All errors seen are logged to the current log. When a 34 * scrub completes, the current log becomes the last log, the last log is thrown 35 * out, and the current log is reinitialized. This way, if an error is somehow --- 20 unchanged lines hidden (view full) --- 56#include <sys/zap.h> 57#include <sys/zio.h> 58 59/* 60 * This is a stripped-down version of strtoull, suitable only for converting 61 * lowercase hexidecimal numbers that don't overflow. 62 */ 63#ifdef _KERNEL | 26/* 27 * Routines to manage the on-disk persistent error log. 28 * 29 * Each pool stores a log of all logical data errors seen during normal 30 * operation. This is actually the union of two distinct logs: the last log, 31 * and the current log. All errors seen are logged to the current log. When a 32 * scrub completes, the current log becomes the last log, the last log is thrown 33 * out, and the current log is reinitialized. This way, if an error is somehow --- 20 unchanged lines hidden (view full) --- 54#include <sys/zap.h> 55#include <sys/zio.h> 56 57/* 58 * This is a stripped-down version of strtoull, suitable only for converting 59 * lowercase hexidecimal numbers that don't overflow. 60 */ 61#ifdef _KERNEL |
64static uint64_t 65_strtonum(char *str, char **nptr) | 62uint64_t 63_strtonum(const char *str, char **nptr) |
66{ 67 uint64_t val = 0; 68 char c; 69 int digit; 70 71 while ((c = *str) != '\0') { 72 if (c >= '0' && c <= '9') 73 digit = c - '0'; 74 else if (c >= 'a' && c <= 'f') 75 digit = 10 + c - 'a'; 76 else 77 break; 78 79 val *= 16; 80 val += digit; 81 82 str++; 83 } 84 | 64{ 65 uint64_t val = 0; 66 char c; 67 int digit; 68 69 while ((c = *str) != '\0') { 70 if (c >= '0' && c <= '9') 71 digit = c - '0'; 72 else if (c >= 'a' && c <= 'f') 73 digit = 10 + c - 'a'; 74 else 75 break; 76 77 val *= 16; 78 val += digit; 79 80 str++; 81 } 82 |
85 *nptr = str; | 83 if (nptr) 84 *nptr = (char *)str; |
86 87 return (val); 88} 89#endif 90 91/* 92 * Convert a bookmark to a string. 93 */ --- 344 unchanged lines hidden --- | 85 86 return (val); 87} 88#endif 89 90/* 91 * Convert a bookmark to a string. 92 */ --- 344 unchanged lines hidden --- |