Skip to content

Instantly share code, notes, and snippets.

@lucperkins
Created September 21, 2022 16:13
Show Gist options
  • Save lucperkins/25cbe8a25d69fce6bfa937a6657dfce1 to your computer and use it in GitHub Desktop.
Save lucperkins/25cbe8a25d69fce6bfa937a6657dfce1 to your computer and use it in GitHub Desktop.
static V9fsFidState *coroutine_fn get_fid(V9fsPDU *pdu, int32_t fid)
{
int err;
V9fsFidState *f;
V9fsState *s = pdu->s;
// Blog note: I've omitted some parts that are irrelevant to performance here.
QSIMPLEQ_FOREACH(f, &s->fid_list, next) {
if (f->fid == fid) {
return f;
}
}
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment