Code Cleanup to remove sema
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2874 Build 2898: arc lint + arc unit
Event Timeline
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | ||
---|---|---|
625 | Which resource need to be protected by this lock? |
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | ||
---|---|---|
625 | It's to make the msleep() usages work. | |
996 | I assume you've checked it's OK to remove the M_ZERO. However, I found the "retries" field of hv_storvsc_request may be used before proper initialization: grep 'retries = ' dev/hyperv/storvsc/ -nrdev/hyperv/storvsc/hv_storvsc_drv_freebsd.c:2027: reqp->retries = 0; We can see it's only initialized once in storvsc_io_done(), but in this function, it's also tested before the initialization. | |
1007 | Why is it removed? reqp->softc is used in several places. |
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | ||
---|---|---|
625 | typo.. "required" -> "acquired". |
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | ||
---|---|---|
625 | Yes. This is due to avoid race condition between sleep and wakeup. In our case, it is not possible but WITNESS requires it anyhow. | |
996 | This is actual a pre-allocate buf pool. every time, grab one from the pool, we will call bzero to initialize it. so it is not needed to zero it here. | |
1007 | it will bzero when grab it from the pool. and set softc again. |