From owner-svn-src-all@freebsd.org Wed Aug 10 12:34:51 2016 Return-Path: Delivered-To: svn-src-all@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 71B78BB343F; Wed, 10 Aug 2016 12:34:51 +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 4CB851D5A; Wed, 10 Aug 2016 12:34:51 +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 u7ACYo5U049883; Wed, 10 Aug 2016 12:34:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ACYoSh049879; Wed, 10 Aug 2016 12:34:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608101234.u7ACYoSh049879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Aug 2016 12:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303906 - stable/11/sys/fs/pseudofs X-SVN-Group: stable-11 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.22 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: Wed, 10 Aug 2016 12:34:51 -0000 Author: kib Date: Wed Aug 10 12:34:49 2016 New Revision: 303906 URL: https://svnweb.freebsd.org/changeset/base/303906 Log: MFC r303704: Some style changes. Fix a typo in comment. MFC r303705: Remove Giant asserts. Update comment. Approved by: re (gjb) Modified: stable/11/sys/fs/pseudofs/pseudofs.c stable/11/sys/fs/pseudofs/pseudofs.h stable/11/sys/fs/pseudofs/pseudofs_fileno.c stable/11/sys/fs/pseudofs/pseudofs_vncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/pseudofs/pseudofs.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs.c Wed Aug 10 12:11:11 2016 (r303905) +++ stable/11/sys/fs/pseudofs/pseudofs.c Wed Aug 10 12:34:49 2016 (r303906) @@ -383,11 +383,9 @@ pfs_init(struct pfs_info *pi, struct vfs struct pfs_node *root; int error; - mtx_assert(&Giant, MA_OWNED); - pfs_fileno_init(pi); - /* set up the root diretory */ + /* set up the root directory */ root = pfs_alloc_node(pi, "/", pfstype_root); pi->pi_root = root; pfs_fileno_alloc(root); @@ -414,8 +412,6 @@ pfs_uninit(struct pfs_info *pi, struct v { int error; - mtx_assert(&Giant, MA_OWNED); - pfs_destroy(pi->pi_root); pi->pi_root = NULL; pfs_fileno_uninit(pi); Modified: stable/11/sys/fs/pseudofs/pseudofs.h ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs.h Wed Aug 10 12:11:11 2016 (r303905) +++ stable/11/sys/fs/pseudofs/pseudofs.h Wed Aug 10 12:34:49 2016 (r303906) @@ -189,16 +189,16 @@ typedef int (*pfs_destroy_t)(PFS_DESTROY /* * pfs_info: describes a pseudofs instance * - * The pi_mutex is only used to avoid using the global subr_unit lock for - * unrhdr. The rest of struct pfs_info is only modified while Giant is - * held (during vfs_init() and vfs_uninit()). + * The pi_mutex is only used to avoid using the global subr_unit lock + * for unrhdr. The rest of struct pfs_info is only modified during + * vfs_init() and vfs_uninit() of the consumer filesystem. */ struct pfs_info { char pi_name[PFS_FSNAMELEN]; pfs_init_t pi_init; pfs_init_t pi_uninit; - /* members below this line are initialized at run time*/ + /* members below this line are initialized at run time */ struct pfs_node *pi_root; struct mtx pi_mutex; struct unrhdr *pi_unrhdr; @@ -285,17 +285,17 @@ static int \ _##name##_mount(struct mount *mp) { \ if (jflag && !prison_allow(curthread->td_ucred, jflag)) \ return (EPERM); \ - return pfs_mount(&name##_info, mp); \ + return (pfs_mount(&name##_info, mp)); \ } \ \ static int \ _##name##_init(struct vfsconf *vfc) { \ - return pfs_init(&name##_info, vfc); \ + return (pfs_init(&name##_info, vfc)); \ } \ \ static int \ _##name##_uninit(struct vfsconf *vfc) { \ - return pfs_uninit(&name##_info, vfc); \ + return (pfs_uninit(&name##_info, vfc)); \ } \ \ static struct vfsops name##_vfsops = { \ Modified: stable/11/sys/fs/pseudofs/pseudofs_fileno.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs_fileno.c Wed Aug 10 12:11:11 2016 (r303905) +++ stable/11/sys/fs/pseudofs/pseudofs_fileno.c Wed Aug 10 12:34:49 2016 (r303906) @@ -52,7 +52,6 @@ void pfs_fileno_init(struct pfs_info *pi) { - mtx_assert(&Giant, MA_OWNED); mtx_init(&pi->pi_mutex, "pfs_fileno", NULL, MTX_DEF); pi->pi_unrhdr = new_unrhdr(3, INT_MAX / NO_PID, &pi->pi_mutex); } @@ -64,7 +63,6 @@ void pfs_fileno_uninit(struct pfs_info *pi) { - mtx_assert(&Giant, MA_OWNED); delete_unrhdr(pi->pi_unrhdr); pi->pi_unrhdr = NULL; mtx_destroy(&pi->pi_mutex); Modified: stable/11/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs_vncache.c Wed Aug 10 12:11:11 2016 (r303905) +++ stable/11/sys/fs/pseudofs/pseudofs_vncache.c Wed Aug 10 12:34:49 2016 (r303906) @@ -84,7 +84,6 @@ void pfs_vncache_load(void) { - mtx_assert(&Giant, MA_OWNED); mtx_init(&pfs_vncache_mutex, "pfs_vncache", NULL, MTX_DEF); pfs_exit_tag = EVENTHANDLER_REGISTER(process_exit, pfs_exit, NULL, EVENTHANDLER_PRI_ANY); @@ -97,7 +96,6 @@ void pfs_vncache_unload(void) { - mtx_assert(&Giant, MA_OWNED); EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); KASSERT(pfs_vncache_entries == 0, ("%d vncache entries remaining", pfs_vncache_entries));