HomeFreeBSD

Improve vdsk_open():

Description

Improve vdsk_open():

  1. Use calloc(3) instead of malloc(3) so that the user context is always pre-initialized.
  2. Wrap the sequence of steps in a `do { ... } while (0)' block so that we can use break to exit. Introduce ctx as the variable to return and use it to determine success or failure.

With a single entry and a single exit, we can more easily add some
kind of tracing or logging in the future.

Details

Provenance
marcelAuthored on
Parents
rS274808: Make sure struct vdsk is a multiple of 16 bytes so that the user
Branches
Unknown
Tags
Unknown

Event Timeline