Date: Tue, 21 Mar 2017 09:24:07 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315674 - head/sys/cam Message-ID: <201703210924.v2L9O7WA027360@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Mar 21 09:24:07 2017 New Revision: 315674 URL: https://svnweb.freebsd.org/changeset/base/315674 Log: Minor cosmetic addition to r315673. Now CAM_SIM_LOCK() macros are not used and may be removed later. MFC after: 2 weeks Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Mar 21 09:12:41 2017 (r315673) +++ head/sys/cam/cam_xpt.c Tue Mar 21 09:24:07 2017 (r315674) @@ -4241,7 +4241,7 @@ xpt_async_bcast(struct async_list *async struct cam_path *path, void *async_arg) { struct async_node *cur_entry; - int lock; + struct mtx *mtx; cur_entry = SLIST_FIRST(async_head); while (cur_entry != NULL) { @@ -4253,14 +4253,15 @@ xpt_async_bcast(struct async_list *async */ next_entry = SLIST_NEXT(cur_entry, links); if ((cur_entry->event_enable & async_code) != 0) { - lock = cur_entry->event_lock; - if (lock) - CAM_SIM_LOCK(path->device->sim); + mtx = cur_entry->event_lock ? + path->device->sim->mtx : NULL; + if (mtx) + mtx_lock(mtx); cur_entry->callback(cur_entry->callback_arg, async_code, path, async_arg); - if (lock) - CAM_SIM_UNLOCK(path->device->sim); + if (mtx) + mtx_unlock(mtx); } cur_entry = next_entry; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703210924.v2L9O7WA027360>