]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Eliminate xpt_copy_path.
authorimp <imp@FreeBSD.org>
Tue, 10 Mar 2020 23:59:58 +0000 (23:59 +0000)
committerimp <imp@FreeBSD.org>
Tue, 10 Mar 2020 23:59:58 +0000 (23:59 +0000)
commitab1675c743a8b418d5a439a863b98da63f2125c1
treeea66d9555f450b7af6f563b13b2cc6e61b40cb3d
parent4d16468fee68486bd3cf81c0d597c1160ceac8e4
Eliminate xpt_copy_path.

It's used in exactly one place. In that place it's used so we can hold the lock
on the device associated with the path (since we do a xpt_path_lock and unlock
pair around the callback). Instead, inline taking and dropping the reference to
the device so we can ensure we can unlock the mutex after the callback finishes
if the path in the ccb that's queued to be processed by xpt_scanner_thread is
destroyed while being processed. We don't actually need the path itself for
anything other than dereferencing it to get the device to do the lock and
unlock.

This also makes the locking / use model for cam_path a little cleaner by
eliminating a case where we needlessly copy the object.

Reviewed by: chuck, chs, ken
Differential Revision: https://reviews.freebsd.org/D24008
sys/cam/cam_xpt.c
sys/cam/cam_xpt.h