Deleted Added
full compact
spa_errlog.c (219089) spa_errlog.c (249195)
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

--- 6 unchanged lines hidden (view full) ---

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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
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

--- 6 unchanged lines hidden (view full) ---

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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
23 */
24
25/*
26 * Routines to manage the on-disk persistent error log.
27 *
28 * Each pool stores a log of all logical data errors seen during normal
29 * operation. This is actually the union of two distinct logs: the last log,
30 * and the current log. All errors seen are logged to the current log. When a

--- 139 unchanged lines hidden (view full) ---

170 return (0);
171
172 for (zap_cursor_init(&zc, spa->spa_meta_objset, obj);
173 zap_cursor_retrieve(&zc, &za) == 0;
174 zap_cursor_advance(&zc)) {
175
176 if (*count == 0) {
177 zap_cursor_fini(&zc);
24 */
25
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

--- 139 unchanged lines hidden (view full) ---

171 return (0);
172
173 for (zap_cursor_init(&zc, spa->spa_meta_objset, obj);
174 zap_cursor_retrieve(&zc, &za) == 0;
175 zap_cursor_advance(&zc)) {
176
177 if (*count == 0) {
178 zap_cursor_fini(&zc);
178 return (ENOMEM);
179 return (SET_ERROR(ENOMEM));
179 }
180
181 name_to_bookmark(za.za_name, &zb);
182
183 if (copyout(&zb, (char *)addr +
184 (*count - 1) * sizeof (zbookmark_t),
185 sizeof (zbookmark_t)) != 0)
180 }
181
182 name_to_bookmark(za.za_name, &zb);
183
184 if (copyout(&zb, (char *)addr +
185 (*count - 1) * sizeof (zbookmark_t),
186 sizeof (zbookmark_t)) != 0)
186 return (EFAULT);
187 return (SET_ERROR(EFAULT));
187
188 *count -= 1;
189 }
190
191 zap_cursor_fini(&zc);
192
193 return (0);
194}
195
196static int
197process_error_list(avl_tree_t *list, void *addr, size_t *count)
198{
199 spa_error_entry_t *se;
200
201 for (se = avl_first(list); se != NULL; se = AVL_NEXT(list, se)) {
202
203 if (*count == 0)
188
189 *count -= 1;
190 }
191
192 zap_cursor_fini(&zc);
193
194 return (0);
195}
196
197static int
198process_error_list(avl_tree_t *list, void *addr, size_t *count)
199{
200 spa_error_entry_t *se;
201
202 for (se = avl_first(list); se != NULL; se = AVL_NEXT(list, se)) {
203
204 if (*count == 0)
204 return (ENOMEM);
205 return (SET_ERROR(ENOMEM));
205
206 if (copyout(&se->se_bookmark, (char *)addr +
207 (*count - 1) * sizeof (zbookmark_t),
208 sizeof (zbookmark_t)) != 0)
206
207 if (copyout(&se->se_bookmark, (char *)addr +
208 (*count - 1) * sizeof (zbookmark_t),
209 sizeof (zbookmark_t)) != 0)
209 return (EFAULT);
210 return (SET_ERROR(EFAULT));
210
211 *count -= 1;
212 }
213
214 return (0);
215}
216#endif
217

--- 186 unchanged lines hidden ---
211
212 *count -= 1;
213 }
214
215 return (0);
216}
217#endif
218

--- 186 unchanged lines hidden ---