From owner-svn-src-head@freebsd.org Sun Jun 12 11:13:39 2016 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 3E121AF0811; Sun, 12 Jun 2016 11:13:39 +0000 (UTC) (envelope-from kib@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 0F6922FAD; Sun, 12 Jun 2016 11:13:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5CBDcSu036535; Sun, 12 Jun 2016 11:13:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5CBDceu036534; Sun, 12 Jun 2016 11:13:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606121113.u5CBDceu036534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Jun 2016 11:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301838 - head/sys/compat/linprocfs 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.22 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: Sun, 12 Jun 2016 11:13:39 -0000 Author: kib Date: Sun Jun 12 11:13:38 2016 New Revision: 301838 URL: https://svnweb.freebsd.org/changeset/base/301838 Log: swap_dev_info() does not require Giant, so Giant locking around the loop in linprocfs_doswaps() is useless. List of the registered filesystems is protected by vfsconf_sx, not by the Giant. Adjust linprocfs_dofilesystems() correspondingly. Approved by: re (delphij), des (linprocfs maintainer) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Jun 12 08:32:39 2016 (r301837) +++ head/sys/compat/linprocfs/linprocfs.c Sun Jun 12 11:13:38 2016 (r301838) @@ -490,7 +490,6 @@ linprocfs_doswaps(PFS_FILL_ARGS) char devname[SPECNAMELEN + 1]; sbuf_printf(sb, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); - mtx_lock(&Giant); for (n = 0; ; n++) { if (swap_dev_info(n, &xsw, devname, sizeof(devname)) != 0) break; @@ -504,7 +503,6 @@ linprocfs_doswaps(PFS_FILL_ARGS) sbuf_printf(sb, "/dev/%-34s unknown\t\t%jd\t%jd\t-1\n", devname, total, used); } - mtx_unlock(&Giant); return (0); } @@ -1326,13 +1324,13 @@ linprocfs_dofilesystems(PFS_FILL_ARGS) { struct vfsconf *vfsp; - mtx_lock(&Giant); + vfsconf_slock(); TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { if (vfsp->vfc_flags & VFCF_SYNTHETIC) sbuf_printf(sb, "nodev"); sbuf_printf(sb, "\t%s\n", vfsp->vfc_name); } - mtx_unlock(&Giant); + vfsconf_sunlock(); return(0); }