From owner-svn-src-head@freebsd.org Mon Jan 2 15:12:12 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 E0430C9B832; Mon, 2 Jan 2017 15:12:12 +0000 (UTC) (envelope-from pfg@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 7DC461AB6; Mon, 2 Jan 2017 15:12:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v02FCBlt047668; Mon, 2 Jan 2017 15:12:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v02FCBr8047665; Mon, 2 Jan 2017 15:12:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701021512.v02FCBr8047665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 Jan 2017 15:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311101 - head/lib/libkvm 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: Mon, 02 Jan 2017 15:12:13 -0000 Author: pfg Date: Mon Jan 2 15:12:11 2017 New Revision: 311101 URL: https://svnweb.freebsd.org/changeset/base/311101 Log: libkvm - extend a bit the swap statistics field. Change ksw_used and ksw_total to unsigned, which increases the maximum total swap that can be displayed properly from ~8TB to ~16TB. Obtained from: DragonflyBSD (ecc2e461) MFC after: 2 weeks Modified: head/lib/libkvm/kvm.h head/lib/libkvm/kvm_getswapinfo.3 head/lib/libkvm/kvm_getswapinfo.c Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Mon Jan 2 12:54:12 2017 (r311100) +++ head/lib/libkvm/kvm.h Mon Jan 2 15:12:11 2017 (r311101) @@ -66,11 +66,11 @@ struct proc; struct kvm_swap { char ksw_devname[32]; - int ksw_used; - int ksw_total; + u_int ksw_used; + u_int ksw_total; int ksw_flags; - int ksw_reserved1; - int ksw_reserved2; + u_int ksw_reserved1; + u_int ksw_reserved2; }; #define SWIF_DEV_PREFIX 0x0002 Modified: head/lib/libkvm/kvm_getswapinfo.3 ============================================================================== --- head/lib/libkvm/kvm_getswapinfo.3 Mon Jan 2 12:54:12 2017 (r311100) +++ head/lib/libkvm/kvm_getswapinfo.3 Mon Jan 2 15:12:11 2017 (r311101) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 1999 +.Dd January 2, 2017 .Dt KVM_SWAPINFO 3 .Os .Sh NAME @@ -78,9 +78,9 @@ This structure contains the following fi .It .Va char ksw_devname[] ; .It -.Va int ksw_total ; +.Va u_int ksw_total ; .It -.Va int ksw_used ; +.Va u_int ksw_used ; .It .Va int ksw_flags ; .El Modified: head/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- head/lib/libkvm/kvm_getswapinfo.c Mon Jan 2 12:54:12 2017 (r311100) +++ head/lib/libkvm/kvm_getswapinfo.c Mon Jan 2 15:12:11 2017 (r311101) @@ -112,7 +112,8 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i, ttl; + int i; + swblk_t ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -163,7 +164,8 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti, ttl; + int ti; + swblk_t ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd;