Code Cleanup to remove sema
- rS FreeBSD src repository - subversion
No Test Coverage
- Build Status
Buildable 2874 Build 2898: arc lint + arc unit
Which resource need to be protected by this lock?
It's to make the msleep() usages work.
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/ -nr
dev/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.
Why is it removed? reqp->softc is used in several places.
Yes. This is due to avoid race condition between sleep and wakeup. In our case, it is not possible but WITNESS requires it anyhow.
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.
it will bzero when grab it from the pool. and set softc again.