disk_destroy() only works on disks that have proceeded through
disk_create(). Creating disks is a multi-step process. There are times
that we may need to free nascent disks that have been allocated, but not
created. disk_free() will free the memory allocated with disk_alloc()
when the creation of the disk needs to be aborted before it can proceed
to disk_create() for whatever reason.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 37721 Build 34610: arc lint + arc unit
Event Timeline
sys/geom/geom_disk.c | ||
---|---|---|
837 | I would call disk_free(dp) here, to benefit from the KASSERT()s, and to make it abundantly clear that disk_free() is always the final destination of memory from disk_alloc(). |
Comment Actions
On second thought, I'm going to abandon this approach and schedule the cam register routine into a taskqueue so we can sleep. There's no good retry mechanism here, and adding one would make things more complicated. We can switch to waiting for memory to have a more robust system with simpler code. This also matches at least some of the feedback I've received privately (thanks Chuck). I'll post that review when I have it done.
sys/geom/geom_disk.c | ||
---|---|---|
837 | Not a bad idea... I'll shuffle and regen. |