From owner-svn-src-all@freebsd.org Sat May 21 10:13:26 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 9CF9AB44500; Sat, 21 May 2016 10:13:26 +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 799391472; Sat, 21 May 2016 10:13:26 +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 u4LADPPC091775; Sat, 21 May 2016 10:13:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LADPA3091774; Sat, 21 May 2016 10:13:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605211013.u4LADPA3091774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 May 2016 10:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300366 - head/sys/ufs/ffs X-SVN-Group: head 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: Sat, 21 May 2016 10:13:26 -0000 Author: kib Date: Sat May 21 10:13:25 2016 New Revision: 300366 URL: https://svnweb.freebsd.org/changeset/base/300366 Log: Stop dropping and reacquiring Giant around geom calls in UFS. Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat May 21 09:55:32 2016 (r300365) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat May 21 10:13:25 2016 (r300366) @@ -239,14 +239,12 @@ ffs_mount(struct mount *mp) if ((error = ffs_flushfiles(mp, WRITECLOSE, td)) != 0 || (error = ffs_sbupdate(ump, MNT_WAIT, 0)) != 0) return (error); - DROP_GIANT(); g_topology_lock(); /* * Return to normal read-only mode. */ error = g_access(ump->um_cp, 0, -1, 0); g_topology_unlock(); - PICKUP_GIANT(); ump->um_fsckpid = 0; } if (fs->fs_ronly == 0 && @@ -294,14 +292,12 @@ ffs_mount(struct mount *mp) } if (MOUNTEDSOFTDEP(mp)) softdep_unmount(mp); - DROP_GIANT(); g_topology_lock(); /* * Drop our write and exclusive access. */ g_access(ump->um_cp, 0, -1, -1); g_topology_unlock(); - PICKUP_GIANT(); fs->fs_ronly = 1; MNT_ILOCK(mp); mp->mnt_flag |= MNT_RDONLY; @@ -359,14 +355,12 @@ ffs_mount(struct mount *mp) return (EPERM); } } - DROP_GIANT(); g_topology_lock(); /* * Request exclusive write access. */ error = g_access(ump->um_cp, 0, 1, 1); g_topology_unlock(); - PICKUP_GIANT(); if (error) return (error); if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0) @@ -433,14 +427,12 @@ ffs_mount(struct mount *mp) } KASSERT(MOUNTEDSOFTDEP(mp) == 0, ("soft updates enabled on read-only file system")); - DROP_GIANT(); g_topology_lock(); /* * Request write access. */ error = g_access(ump->um_cp, 0, 1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) { vfs_mount_error(mp, "Checker activation failed on %s", @@ -523,14 +515,12 @@ ffs_mount(struct mount *mp) ("soft updates enabled on read-only file system")); ump = VFSTOUFS(mp); fs = ump->um_fs; - DROP_GIANT(); g_topology_lock(); /* * Request write access. */ error = g_access(ump->um_cp, 0, 1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) { printf("WARNING: %s: Checker activation " "failed\n", fs->fs_fsmnt); @@ -771,11 +761,9 @@ ffs_mountfs(devvp, mp, td) VOP_UNLOCK(devvp, 0); return (EBUSY); } - DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "ffs", ronly ? 0 : 1); g_topology_unlock(); - PICKUP_GIANT(); if (error != 0) { atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); VOP_UNLOCK(devvp, 0); @@ -1090,11 +1078,9 @@ out: if (bp) brelse(bp); if (cp != NULL) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); } if (ump) { mtx_destroy(UFS_MTX(ump)); @@ -1280,7 +1266,6 @@ ffs_unmount(mp, mntflags) taskqueue_drain_all(ump->um_trim_tq); taskqueue_free(ump->um_trim_tq); } - DROP_GIANT(); g_topology_lock(); if (ump->um_fsckpid > 0) { /* @@ -1291,7 +1276,6 @@ ffs_unmount(mp, mntflags) } g_vfs_close(ump->um_cp); g_topology_unlock(); - PICKUP_GIANT(); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); vrele(ump->um_devvp); dev_rel(ump->um_dev);