From owner-svn-src-projects@FreeBSD.ORG Mon Dec 1 15:11:30 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80F4F849; Mon, 1 Dec 2014 15:11:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6BA0DB62; Mon, 1 Dec 2014 15:11:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1FBUmh090141; Mon, 1 Dec 2014 15:11:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1FBT8B090136; Mon, 1 Dec 2014 15:11:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412011511.sB1FBT8B090136@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 1 Dec 2014 15:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r275367 - in projects/clang350-import: contrib/libc++/include sys/cam/ctl X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:11:30 -0000 Author: dim Date: Mon Dec 1 15:11:29 2014 New Revision: 275367 URL: https://svnweb.freebsd.org/changeset/base/275367 Log: Merge ^/head r274961 through r275366. Modified: projects/clang350-import/contrib/libc++/include/type_traits projects/clang350-import/sys/cam/ctl/scsi_ctl.c Directory Properties: projects/clang350-import/ (props changed) projects/clang350-import/contrib/libc++/ (props changed) projects/clang350-import/sys/ (props changed) Modified: projects/clang350-import/contrib/libc++/include/type_traits ============================================================================== --- projects/clang350-import/contrib/libc++/include/type_traits Mon Dec 1 15:02:49 2014 (r275366) +++ projects/clang350-import/contrib/libc++/include/type_traits Mon Dec 1 15:11:29 2014 (r275367) @@ -439,8 +439,26 @@ template struct _LIBCPP_TYPE // is_member_function_pointer -template struct __libcpp_is_member_function_pointer : public false_type {}; -template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// template struct __libcpp_is_member_function_pointer : public false_type {}; +// template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// + +template +struct __member_pointer_traits_imp +{ // forward declaration; specializations later +}; + + +namespace __libcpp_is_member_function_pointer_imp { + template + char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *); + + template + std::__two __test(...); +}; + +template struct __libcpp_is_member_function_pointer + : public integral_constant(nullptr)) == 1> {}; template struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer : public __libcpp_is_member_function_pointer::type> {}; @@ -1593,11 +1611,6 @@ __decay_copy(const _Tp& __t) #endif -template -struct __member_pointer_traits_imp -{ -}; - #ifndef _LIBCPP_HAS_NO_VARIADICS template @@ -1605,6 +1618,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1612,6 +1626,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1619,6 +1634,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1626,6 +1642,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #if __has_feature(cxx_reference_qualified_functions) @@ -1635,6 +1652,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1642,6 +1660,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1649,6 +1668,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1656,6 +1676,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1663,6 +1684,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1670,6 +1692,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1677,6 +1700,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1684,6 +1708,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #endif // __has_feature(cxx_reference_qualified_functions) @@ -1695,6 +1720,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1702,6 +1728,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1709,6 +1736,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1716,6 +1744,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1723,6 +1752,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1730,6 +1760,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1737,6 +1768,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1744,6 +1776,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1751,6 +1784,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1758,6 +1792,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1765,6 +1800,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1772,6 +1808,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1779,6 +1816,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1786,6 +1824,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1793,6 +1832,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1800,6 +1840,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; #endif // _LIBCPP_HAS_NO_VARIADICS @@ -1819,6 +1860,7 @@ struct __member_pointer_traits { // typedef ... _ClassType; // typedef ... _ReturnType; +// typedef ... _FnType; }; // result_of @@ -2526,6 +2568,15 @@ template struct _LIBCPP_TYPE // is_nothrow_constructible +#if 0 +template +struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible + : public integral_constant +{ +}; + +#else + #ifndef _LIBCPP_HAS_NO_VARIADICS #if __has_feature(cxx_noexcept) @@ -2664,6 +2715,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_ }; #endif // _LIBCPP_HAS_NO_VARIADICS +#endif // __has_feature(is_nothrow_constructible) // is_nothrow_default_constructible Modified: projects/clang350-import/sys/cam/ctl/scsi_ctl.c ============================================================================== --- projects/clang350-import/sys/cam/ctl/scsi_ctl.c Mon Dec 1 15:02:49 2014 (r275366) +++ projects/clang350-import/sys/cam/ctl/scsi_ctl.c Mon Dec 1 15:11:29 2014 (r275367) @@ -622,6 +622,9 @@ ctlferegister(struct cam_periph *periph, "notify CCBs, status 0x%x\n", __func__, status); return (CAM_REQ_CMP_ERR); } + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); return (CAM_REQ_CMP); } @@ -1573,12 +1576,7 @@ ctlfe_onoffline(void *arg, int online) printf("%s: unable to create path!\n", __func__); return; } - ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO); - if (ccb == NULL) { - printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); - return; - } + ccb = xpt_alloc_ccb(); xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); /* @@ -1711,10 +1709,7 @@ ctlfe_onoffline(void *arg, int online) } xpt_free_path(path); - - free(ccb, M_TEMP); - - return; + xpt_free_ccb(ccb); } static void @@ -1740,14 +1735,7 @@ ctlfe_online(void *arg) return; } - lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, - M_NOWAIT | M_ZERO); - if (lun_softc == NULL) { - xpt_print(path, "%s: unable to allocate softc for " - "wildcard periph\n", __func__); - xpt_free_path(path); - return; - } + lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, M_WAITOK | M_ZERO); xpt_path_lock(path); periph = cam_periph_find(path, "ctl"); @@ -1780,14 +1768,10 @@ ctlfe_online(void *arg) "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(lun_softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); - ctlfe_onoffline(arg, /*online*/ 1); } xpt_path_unlock(path); + ctlfe_onoffline(arg, /*online*/ 1); xpt_free_path(path); } @@ -1801,6 +1785,8 @@ ctlfe_offline(void *arg) bus_softc = (struct ctlfe_softc *)arg; + ctlfe_onoffline(arg, /*online*/ 0); + /* * Disable the wildcard LUN for this port now that we have taken * the port offline. @@ -1813,14 +1799,9 @@ ctlfe_offline(void *arg) __func__); return; } - xpt_path_lock(path); - - ctlfe_onoffline(arg, /*online*/ 0); - if ((periph = cam_periph_find(path, "ctl")) != NULL) cam_periph_invalidate(periph); - xpt_path_unlock(path); xpt_free_path(path); } @@ -1881,10 +1862,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); } xpt_path_unlock(path);