MCPcopy Create free account
hub / github.com/F-Stack/f-stack / process_error_log

Function process_error_log

freebsd/contrib/openzfs/module/zfs/spa_errlog.c:162–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160
161#ifdef _KERNEL
162static int
163process_error_log(spa_t *spa, uint64_t obj, void *addr, size_t *count)
164{
165 zap_cursor_t zc;
166 zap_attribute_t za;
167 zbookmark_phys_t zb;
168
169 if (obj == 0)
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);
178 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_phys_t),
185 sizeof (zbookmark_phys_t)) != 0) {
186 zap_cursor_fini(&zc);
187 return (SET_ERROR(EFAULT));
188 }
189
190 *count -= 1;
191 }
192
193 zap_cursor_fini(&zc);
194
195 return (0);
196}
197
198static int
199process_error_list(avl_tree_t *list, void *addr, size_t *count)

Callers 1

spa_get_errlogFunction · 0.85

Calls 6

zap_cursor_initFunction · 0.85
zap_cursor_retrieveFunction · 0.85
zap_cursor_advanceFunction · 0.85
zap_cursor_finiFunction · 0.85
name_to_bookmarkFunction · 0.85
copyoutFunction · 0.50

Tested by

no test coverage detected