static int out(struct sm_metadata *smm) { int r = 0; /* * If we're not recursing then very bad things are happening. */ if (!smm->recursion_count) { DMERR("lost track of recursion depth"); return -ENOMEM; } if (smm->recursion_count == 1) { while (!brb_empty(&smm->uncommitted)) { struct block_op bop; r = brb_pop(&smm->uncommitted, &bop); if (r) { DMERR("bug in bop ring buffer"); break; } r = commit_bop(smm, &bop); if (r) break; } } smm->recursion_count--; return r; }
static int apply_bops(struct sm_metadata *smm) { int r = 0; while (!brb_empty(&smm->uncommitted)) { struct block_op bop; r = brb_pop(&smm->uncommitted, &bop); if (r) { DMERR("bug in bop ring buffer"); break; } r = commit_bop(smm, &bop); if (r) break; } return r; }