Skip to content

Instantly share code, notes, and snippets.

@Fabian-Gruenbichler
Last active October 4, 2017 08:14
Show Gist options
  • Save Fabian-Gruenbichler/6234f96c6a33397561541f75889a7d3b to your computer and use it in GitHub Desktop.
Save Fabian-Gruenbichler/6234f96c6a33397561541f75889a7d3b to your computer and use it in GitHub Desktop.
variant with duplicate dmu_object_next
uint64_t obj = rwa->last_touched_object + 1;
int free_err = 0, next_err = 0;
while (next_err == 0) {
dmu_object_info_t doi;
free_err = dmu_object_info(rwa->os, obj, &doi);
if (free_err == ENOENT) {
next_err = dmu_object_next(rwa->os, &obj, FALSE, 0);
continue;
} else if (free_err != 0)
break;
free_err = dmu_free_long_object(rwa->os, obj);
if (free_err != 0)
break;
next_err = dmu_object_next(rwa->os, &obj, FALSE, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment