From owner-cvs-src@FreeBSD.ORG Fri Oct 29 10:15:56 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0FC216A4CE; Fri, 29 Oct 2004 10:15:56 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A401643D49; Fri, 29 Oct 2004 10:15:56 +0000 (GMT) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9TAFuFO057803; Fri, 29 Oct 2004 10:15:56 GMT (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9TAFu8j057802; Fri, 29 Oct 2004 10:15:56 GMT (envelope-from phk) Message-Id: <200410291015.i9TAFu8j057802@repoman.freebsd.org> From: Poul-Henning Kamp Date: Fri, 29 Oct 2004 10:15:56 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/ufs/ffs ffs_alloc.c ffs_extern.h ffs_rawread.c ffs_snapshot.c ffs_softdep.c ffs_vfsops.c ffs_vnops.c src/sys/ufs/ufs inode.h ufs_vnops.c ufsmount.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 10:15:57 -0000 phk 2004-10-29 10:15:56 UTC FreeBSD src repository Modified files: sys/ufs/ffs ffs_alloc.c ffs_extern.h ffs_rawread.c ffs_snapshot.c ffs_softdep.c ffs_vfsops.c ffs_vnops.c sys/ufs/ufs inode.h ufs_vnops.c ufsmount.h Log: Move UFS from DEVFS backing to GEOM backing. This eliminates a bunch of vnode overhead (approx 1-2 % speed improvement) and gives us more control over the access to the storage device. Access counts on the underlying device are not correctly tracked and therefore it is possible to read-only mount the same disk device multiple times: syv# mount -p /dev/md0 /var ufs rw 2 2 /dev/ad0 /mnt ufs ro 1 1 /dev/ad0 /mnt2 ufs ro 1 1 /dev/ad0 /mnt3 ufs ro 1 1 Since UFS/FFS is not a synchrousely consistent filesystem (ie: it caches things in RAM) this is not possible with read-write mounts, and the system will correctly reject this. Details: Add a geom consumer and a bufobj pointer to ufsmount. Eliminate the vnode argument from softdep_disk_prewrite(). Pick the vnode out of bp->b_vp for now. Eventually we should find it through bp->b_bufobj->b_private. In the mountcode, use g_vfs_open() once we have used VOP_ACCESS() to check permissions. When upgrading and downgrading between r/o and r/w do the right thing with GEOM access counts. Remove all the workarounds for not being able to do this with VOP_OPEN(). If we are the root mount, drop the exclusive access count until we upgrade to r/w. This allows fsck of the root filesystem and the MNT_RELOAD to work correctly. Set bo_private to the GEOM consumer on the device bufobj. Change the ffs_ops->strategy function to call g_vfs_strategy() In ufs_strategy() directly call the strategy on the disk bufobj. Same in rawread. In ffs_fsync() we will no longer see VCHR device nodes, so remove code which synced the filesystem mounted on it, in case we came there. I'm not sure this code made sense in the first place since we would have taken the specfs route on such a vnode. Redo the highly bogus readblock() function in the snapshot code to something slightly less bogus: Constructing an uio and using physio was really quite a detour. Instead just fill in a bio and ship it down. Revision Changes Path 1.126 +0 -3 src/sys/ufs/ffs/ffs_alloc.c 1.61 +1 -1 src/sys/ufs/ffs/ffs_extern.h 1.18 +1 -5 src/sys/ufs/ffs/ffs_rawread.c 1.89 +17 -13 src/sys/ufs/ffs/ffs_snapshot.c 1.163 +6 -24 src/sys/ufs/ffs/ffs_softdep.c 1.250 +63 -60 src/sys/ufs/ffs/ffs_vfsops.c 1.141 +2 -11 src/sys/ufs/ffs/ffs_vnops.c 1.47 +1 -0 src/sys/ufs/ufs/inode.h 1.249 +3 -7 src/sys/ufs/ufs/ufs_vnops.c 1.32 +2 -0 src/sys/ufs/ufs/ufsmount.h