From owner-svn-src-head@freebsd.org Tue Mar 21 09:24:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19504D14CBC; Tue, 21 Mar 2017 09:24:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD3DCB6C; Tue, 21 Mar 2017 09:24:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2L9O8n4027361; Tue, 21 Mar 2017 09:24:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2L9O7WA027360; Tue, 21 Mar 2017 09:24:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703210924.v2L9O7WA027360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 21 Mar 2017 09:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315674 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 09:24:09 -0000 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; }