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

Function space_map_load_length

freebsd/contrib/openzfs/module/zfs/space_map.c:419–440  ·  view source on GitHub ↗

* Load the spacemap into the rangetree, like space_map_load. But only * read the first 'length' bytes of the spacemap. */

Source from the content-addressed store, hash-verified

417 * read the first 'length' bytes of the spacemap.
418 */
419int
420space_map_load_length(space_map_t *sm, range_tree_t *rt, maptype_t maptype,
421 uint64_t length)
422{
423 space_map_load_arg_t smla;
424
425 VERIFY0(range_tree_space(rt));
426
427 if (maptype == SM_FREE)
428 range_tree_add(rt, sm->sm_start, sm->sm_size);
429
430 smla.smla_rt = rt;
431 smla.smla_sm = sm;
432 smla.smla_type = maptype;
433 int err = space_map_iterate(sm, length,
434 space_map_load_callback, &smla);
435
436 if (err != 0)
437 range_tree_vacate(rt, NULL, NULL);
438
439 return (err);
440}
441
442/*
443 * Load the space map disk into the specified range tree. Segments of maptype

Callers 2

metaslab_load_implFunction · 0.85
space_map_loadFunction · 0.85

Calls 4

range_tree_spaceFunction · 0.85
range_tree_addFunction · 0.85
space_map_iterateFunction · 0.85
range_tree_vacateFunction · 0.85

Tested by

no test coverage detected