b90b7ce477
Add an io_locked TAILQ to each channel, which hold IO that will write to a currently locked region. Also add a new step to the locking process per channel. Each channel needs to wait until all existing outstanding writes to the newly locked range have been completed. Only the channel that locked an LBA range may submit write I/O to it. It must use the same cb_arg for the write I/O as the cb_arg used when locking the LBA range. This ensures that only the specific I/O operations needing the lock will bypass the lock. When a range is unlocked, we will just blindly try to resubmit all IO in the io_locked tailq. This could be made more efficient in the future, but we don't expect this path to occur very often, so going for simplicity in the first pass. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ibdc992144dfaffe7c05471a5b3c020cedd8cdfc3 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478226 Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>