From owner-svn-src-head@FreeBSD.ORG Mon Nov 3 20:00:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06CE10656D7; Mon, 3 Nov 2008 20:00:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE4558FC1E; Mon, 3 Nov 2008 20:00:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3K0Zt6074804; Mon, 3 Nov 2008 20:00:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3K0Zok074801; Mon, 3 Nov 2008 20:00:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200811032000.mA3K0Zok074801@svn.freebsd.org> From: Attilio Rao Date: Mon, 3 Nov 2008 20:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184599 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 03 Nov 2008 20:00:35 -0000 Author: attilio Date: Mon Nov 3 20:00:35 2008 New Revision: 184599 URL: http://svn.freebsd.org/changeset/base/184599 Log: Remove the mnt_holdcnt and mnt_holdcntwaiters because they are useless. Really, the concept of holdcnt in the struct mount is rappresented by the mnt_ref (which prevents the type-stable structure from being "recycled) handled through vfs_ref() and vfs_rel(). On this optic, switch the holdcnt acquisition into an emulated vfs_ref() (and subsequent release into vfs_rel()). Discussed with: kib Tested by: pho Modified: head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Nov 3 19:57:40 2008 (r184598) +++ head/sys/kern/vfs_mount.c Mon Nov 3 20:00:35 2008 (r184599) @@ -509,16 +509,6 @@ vfs_mount_destroy(struct mount *mp) MNT_ILOCK(mp); while (mp->mnt_ref) msleep(mp, MNT_MTX(mp), PVFS, "mntref", 0); - if (mp->mnt_holdcnt != 0) { - printf("Waiting for mount point to be unheld\n"); - while (mp->mnt_holdcnt != 0) { - mp->mnt_holdcntwaiters++; - msleep(&mp->mnt_holdcnt, MNT_MTX(mp), - PZERO, "mntdestroy", 0); - mp->mnt_holdcntwaiters--; - } - printf("mount point unheld\n"); - } if (mp->mnt_writeopcount > 0) { printf("Waiting for mount point write ops\n"); while (mp->mnt_writeopcount > 0) { @@ -2062,7 +2052,7 @@ __mnt_vnode_first(struct vnode **mvp, st *mvp = NULL; return (NULL); } - mp->mnt_holdcnt++; + MNT_REF(mp); MNT_IUNLOCK(mp); *mvp = (struct vnode *) malloc(sizeof(struct vnode), M_VNODE_MARKER, @@ -2080,9 +2070,7 @@ __mnt_vnode_first(struct vnode **mvp, st free(*mvp, M_VNODE_MARKER); MNT_ILOCK(mp); *mvp = NULL; - mp->mnt_holdcnt--; - if (mp->mnt_holdcnt == 0 && mp->mnt_holdcntwaiters != 0) - wakeup(&mp->mnt_holdcnt); + MNT_REL(mp); return (NULL); } (*mvp)->v_mount = mp; @@ -2106,10 +2094,7 @@ __mnt_vnode_markerfree(struct vnode **mv free(*mvp, M_VNODE_MARKER); MNT_ILOCK(mp); *mvp = NULL; - - mp->mnt_holdcnt--; - if (mp->mnt_holdcnt == 0 && mp->mnt_holdcntwaiters != 0) - wakeup(&mp->mnt_holdcnt); + MNT_REL(mp); } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 3 19:57:40 2008 (r184598) +++ head/sys/kern/vfs_subr.c Mon Nov 3 20:00:35 2008 (r184599) @@ -2838,8 +2838,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); - db_printf(" mnt_holdcnt = %d\n", mp->mnt_holdcnt); - db_printf(" mnt_holdcntwaiters = %d\n", mp->mnt_holdcntwaiters); db_printf(" mnt_secondary_writes = %d\n", mp->mnt_secondary_writes); db_printf(" mnt_secondary_accwrites = %d\n", mp->mnt_secondary_accwrites); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Nov 3 19:57:40 2008 (r184598) +++ head/sys/sys/mount.h Mon Nov 3 20:00:35 2008 (r184599) @@ -174,8 +174,6 @@ struct mount { struct label *mnt_label; /* MAC label for the fs */ u_int mnt_hashseed; /* Random seed for vfs_hash */ int mnt_lockref; /* (i) Lock reference count */ - int mnt_holdcnt; /* hold count */ - int mnt_holdcntwaiters; /* waits on hold count */ int mnt_secondary_writes; /* (i) # of secondary writes */ int mnt_secondary_accwrites;/* (i) secondary wr. starts */ struct thread *mnt_susp_owner; /* (i) thread owning suspension */