From owner-svn-src-all@freebsd.org Fri Feb 23 16:06:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A21BBF0288A; Fri, 23 Feb 2018 16:06:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5722187F87; Fri, 23 Feb 2018 16:06:55 +0000 (UTC) (envelope-from imp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BEE718B1A; Fri, 23 Feb 2018 16:06:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1NG6t3d013920; Fri, 23 Feb 2018 16:06:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1NG6t45013919; Fri, 23 Feb 2018 16:06:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802231606.w1NG6t45013919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 23 Feb 2018 16:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329866 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 329866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 16:06:55 -0000 Author: imp Date: Fri Feb 23 16:06:54 2018 New Revision: 329866 URL: https://svnweb.freebsd.org/changeset/base/329866 Log: Use bool instead of int for predicate functions relating to work available. Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Fri Feb 23 16:04:44 2018 (r329865) +++ head/sys/cam/cam_iosched.c Fri Feb 23 16:06:54 2018 (r329866) @@ -718,22 +718,22 @@ cam_iosched_io_metric_update(struct cam_iosched_softc sbintime_t sim_latency, int cmd, size_t size); #endif -static inline int +static inline bool cam_iosched_has_flagged_work(struct cam_iosched_softc *isc) { return !!(isc->flags & CAM_IOSCHED_FLAG_WORK_FLAGS); } -static inline int +static inline bool cam_iosched_has_io(struct cam_iosched_softc *isc) { #ifdef CAM_IOSCHED_DYNAMIC if (do_dynamic_iosched) { struct bio *rbp = bioq_first(&isc->bio_queue); struct bio *wbp = bioq_first(&isc->write_queue); - int can_write = wbp != NULL && + bool can_write = wbp != NULL && cam_iosched_limiter_caniop(&isc->write_stats, wbp) == 0; - int can_read = rbp != NULL && + bool can_read = rbp != NULL && cam_iosched_limiter_caniop(&isc->read_stats, rbp) == 0; if (iosched_debug > 2) { printf("can write %d: pending_writes %d max_writes %d\n", can_write, isc->write_stats.pending, isc->write_stats.max); @@ -746,7 +746,7 @@ cam_iosched_has_io(struct cam_iosched_softc *isc) return bioq_first(&isc->bio_queue) != NULL; } -static inline int +static inline bool cam_iosched_has_more_trim(struct cam_iosched_softc *isc) { return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && @@ -757,7 +757,7 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *is (isc)->sort_io_queue : cam_sort_io_queues) -static inline int +static inline bool cam_iosched_has_work(struct cam_iosched_softc *isc) { #ifdef CAM_IOSCHED_DYNAMIC