From owner-svn-src-head@freebsd.org Wed Jan 25 02:05:10 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 1E4BACBE9E6; Wed, 25 Jan 2017 02:05:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id D453D11EB; Wed, 25 Jan 2017 02:05:09 +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 v0P258MO044639; Wed, 25 Jan 2017 02:05:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0P2581U044638; Wed, 25 Jan 2017 02:05:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201701250205.v0P2581U044638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 25 Jan 2017 02:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312732 - 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: Wed, 25 Jan 2017 02:05:10 -0000 Author: imp Date: Wed Jan 25 02:05:08 2017 New Revision: 312732 URL: https://svnweb.freebsd.org/changeset/base/312732 Log: Preening pass to fix up trailing white space and other minor style(9) nits (though I'm sure others remain). MFC After: 3 days Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Jan 25 01:16:10 2017 (r312731) +++ head/sys/cam/cam_iosched.c Wed Jan 25 02:05:08 2017 (r312732) @@ -112,7 +112,7 @@ typedef enum { bandwidth, /* Limit bandwidth to the drive */ limiter_max } io_limiter; - + static const char *cam_iosched_limiter_names[] = { "none", "queue_depth", "iops", "bandwidth" }; @@ -131,7 +131,7 @@ typedef int l_tick_t(struct iop_stats *) * Called to see if the limiter thinks this IOP can be allowed to * proceed. If so, the limiter assumes that the while IOP proceeded * and makes any accounting of it that's needed. - */ + */ typedef int l_iop_t(struct iop_stats *, struct bio *); /* @@ -157,8 +157,7 @@ static l_tick_t cam_iosched_bw_tick; static l_iop_t cam_iosched_bw_caniop; static l_iop_t cam_iosched_bw_iop; -struct limswitch -{ +struct limswitch { l_init_t *l_init; l_tick_t *l_tick; l_iop_t *l_iop; @@ -195,8 +194,7 @@ struct limswitch }, }; -struct iop_stats -{ +struct iop_stats { /* * sysctl state for this subnode. */ @@ -212,7 +210,6 @@ struct iop_stats int current; /* Current rate limiter */ int l_value1; /* per-limiter scratch value 1. */ int l_value2; /* per-limiter scratch value 2. */ - /* * Debug information about counts of I/Os that have gone through the @@ -223,7 +220,7 @@ struct iop_stats int total; /* Total for all time -- wraps */ int in; /* number queued all time -- wraps */ int out; /* number completed all time -- wraps */ - + /* * Statistics on different bits of the process. */ @@ -251,8 +248,7 @@ typedef enum { static const char *cam_iosched_control_type_names[] = { "set_max", "read_latency" }; -struct control_loop -{ +struct control_loop { /* * sysctl state for this subnode. */ @@ -272,8 +268,7 @@ struct control_loop #endif -struct cam_iosched_softc -{ +struct cam_iosched_softc { struct bio_queue_head bio_queue; struct bio_queue_head trim_queue; /* scheduler flags < 16, user flags >= 16 */ @@ -385,7 +380,7 @@ cam_iosched_limiter_iodone(struct iop_st static int cam_iosched_qd_iop(struct iop_stats *ios, struct bio *bp) { - + if (ios->current <= 0 || ios->pending < ios->current) return 0; @@ -395,7 +390,7 @@ cam_iosched_qd_iop(struct iop_stats *ios static int cam_iosched_qd_caniop(struct iop_stats *ios, struct bio *bp) { - + if (ios->current <= 0 || ios->pending < ios->current) return 0; @@ -405,7 +400,7 @@ cam_iosched_qd_caniop(struct iop_stats * static int cam_iosched_qd_iodone(struct iop_stats *ios, struct bio *bp) { - + if (ios->current <= 0 || ios->pending != ios->current) return 0; @@ -773,7 +768,7 @@ cam_iosched_limiter_sysctl(SYSCTL_HANDLE struct cam_iosched_softc *isc; int value, i, error; const char *p; - + ios = arg1; isc = ios->softc; value = ios->limiter; @@ -781,7 +776,7 @@ cam_iosched_limiter_sysctl(SYSCTL_HANDLE p = "UNKNOWN"; else p = cam_iosched_limiter_names[value]; - + strlcpy(buf, p, sizeof(buf)); error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) @@ -819,7 +814,7 @@ cam_iosched_control_type_sysctl(SYSCTL_H struct cam_iosched_softc *isc; int value, i, error; const char *p; - + clp = arg1; isc = clp->softc; value = clp->type; @@ -827,7 +822,7 @@ cam_iosched_control_type_sysctl(SYSCTL_H p = "UNKNOWN"; else p = cam_iosched_control_type_names[value]; - + strlcpy(buf, p, sizeof(buf)); error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) @@ -852,7 +847,7 @@ cam_iosched_sbintime_sysctl(SYSCTL_HANDL sbintime_t value; int error; uint64_t us; - + value = *(sbintime_t *)arg1; us = (uint64_t)value / SBT_1US; snprintf(buf, sizeof(buf), "%ju", (intmax_t)us); @@ -969,7 +964,7 @@ cam_iosched_cl_sysctl_init(struct cam_io struct sysctl_oid_list *n; struct sysctl_ctx_list *ctx; struct control_loop *clp; - + clp = &isc->cl; clp->sysctl_tree = SYSCTL_ADD_NODE(&isc->sysctl_ctx, SYSCTL_CHILDREN(isc->sysctl_tree), OID_AUTO, "control", @@ -1007,7 +1002,7 @@ cam_iosched_cl_sysctl_fini(struct contro printf("can't remove iosched sysctl control loop context\n"); } #endif - + /* * Allocate the iosched structure. This also insulates callers from knowing * sizeof struct cam_iosched_softc. @@ -1069,7 +1064,6 @@ cam_iosched_fini(struct cam_iosched_soft callout_drain(&isc->ticker); isc->flags &= ~ CAM_IOSCHED_FLAG_CALLOUT_ACTIVE; } - #endif free(isc, M_CAMSCHED); } @@ -1328,7 +1322,7 @@ cam_iosched_next_bio(struct cam_iosched_ #endif return bp; } - + /* * Driver has been given some work to do by the block layer. Tell the * scheduler about it and have it queue the work up. The scheduler module @@ -1385,7 +1379,7 @@ cam_iosched_queue_work(struct cam_iosche } } -/* +/* * If we have work, get it scheduled. Called with the periph lock held. */ void @@ -1525,7 +1519,7 @@ isqrt64(uint64_t val) res >>= 1; bit >>= 2; } - + return res; } @@ -1707,7 +1701,7 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_ db_printf("Current Q len %d\n", biolen(&isc->trim_queue)); db_printf("read_bias: %d\n", isc->read_bias); db_printf("current_read_bias: %d\n", isc->current_read_bias); - db_printf("Trim active? %s\n", + db_printf("Trim active? %s\n", (isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) ? "yes" : "no"); } #endif