From owner-svn-src-head@freebsd.org Fri Jul 21 23:53:49 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 9AF5AC0AC9E; Fri, 21 Jul 2017 23:53:49 +0000 (UTC) (envelope-from markj@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 68CFA3580; Fri, 21 Jul 2017 23:53:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6LNrmwN092258; Fri, 21 Jul 2017 23:53:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6LNrmYA092257; Fri, 21 Jul 2017 23:53:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707212353.v6LNrmYA092257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 21 Jul 2017 23:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321356 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 321356 X-SVN-Commit-Repository: base 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: Fri, 21 Jul 2017 23:53:49 -0000 Author: markj Date: Fri Jul 21 23:53:48 2017 New Revision: 321356 URL: https://svnweb.freebsd.org/changeset/base/321356 Log: Fix top(1) output when zfs.ko is loaded but ZFS is not in use. Reviewed by: allanjude MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11693 Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jul 21 23:08:13 2017 (r321355) +++ head/usr.bin/top/machine.c Fri Jul 21 23:53:48 2017 (r321356) @@ -328,14 +328,15 @@ machine_init(struct statics *statics, char do_unames) size != sizeof(smpmode)) smpmode = 0; - size = sizeof(carc_en); - if (sysctlbyname("vfs.zfs.compressed_arc_enabled", &carc_en, &size, - NULL, 0) == 0 && carc_en == 1) - carc_enabled = 1; size = sizeof(arc_size); if (sysctlbyname("kstat.zfs.misc.arcstats.size", &arc_size, &size, NULL, 0) == 0 && arc_size != 0) arc_enabled = 1; + size = sizeof(carc_en); + if (arc_enabled && + sysctlbyname("vfs.zfs.compressed_arc_enabled", &carc_en, &size, + NULL, 0) == 0 && carc_en == 1) + carc_enabled = 1; if (do_unames) { while ((pw = getpwent()) != NULL) {