Skip to content

Instantly share code, notes, and snippets.

@Fabian-Gruenbichler
Last active October 4, 2017 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fabian-Gruenbichler/8632d82204237a6219ba40c1258d261d to your computer and use it in GitHub Desktop.
Save Fabian-Gruenbichler/8632d82204237a6219ba40c1258d261d to your computer and use it in GitHub Desktop.
variant with goto
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)
goto next;
else if (free_err != 0)
break;
free_err = dmu_free_long_object(rwa->os, obj);
if (free_err != 0)
break;
next:
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