From owner-svn-src-head@FreeBSD.ORG Tue Mar 27 20:36:04 2012 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 72BAE1065672; Tue, 27 Mar 2012 20:36:04 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44EC18FC12; Tue, 27 Mar 2012 20:36:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2RKa4DG002756; Tue, 27 Mar 2012 20:36:04 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2RKa4Wb002754; Tue, 27 Mar 2012 20:36:04 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201203272036.q2RKa4Wb002754@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 27 Mar 2012 20:36:04 +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: r233575 - head/sys/gnu/fs/reiserfs 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: Tue, 27 Mar 2012 20:36:04 -0000 Author: dumbbell Date: Tue Mar 27 20:36:03 2012 New Revision: 233575 URL: http://svn.freebsd.org/changeset/base/233575 Log: Make ReiserFS MPSAFE Most functions seemed to be already fine w.r.t. what's done in msdosfs. MFC after: 1 month Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Mar 27 20:10:13 2012 (r233574) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Mar 27 20:36:03 2012 (r233575) @@ -231,6 +231,7 @@ reiserfs_unmount(struct mount *mp, int m g_topology_unlock(); PICKUP_GIANT(); vrele(rmp->rm_devvp); + dev_rel(rmp->rm_dev); if (sbi) { reiserfs_log(LOG_DEBUG, "free sbi\n"); @@ -430,21 +431,25 @@ reiserfs_mountfs(struct vnode *devvp, st struct reiserfs_mount *rmp; struct reiserfs_sb_info *sbi; struct reiserfs_super_block *rs; - struct cdev *dev = devvp->v_rdev; + struct cdev *dev; struct g_consumer *cp; struct bufobj *bo; //ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "reiserfs", /* read-only */ 0); g_topology_unlock(); PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); - if (error) + if (error) { + dev_rel(dev); return (error); + } bo = &devvp->v_bufobj; bo->bo_private = cp; @@ -575,6 +580,7 @@ reiserfs_mountfs(struct vnode *devvp, st mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); #if defined(si_mountpoint) devvp->v_rdev->si_mountpoint = mp; @@ -590,7 +596,8 @@ out: for (i = 0; i < SB_BMAP_NR(sbi); i++) { if (!SB_AP_BITMAP(sbi)[i].bp_data) break; - free(SB_AP_BITMAP(sbi)[i].bp_data, M_REISERFSMNT); + free(SB_AP_BITMAP(sbi)[i].bp_data, + M_REISERFSMNT); } free(SB_AP_BITMAP(sbi), M_REISERFSMNT); } @@ -613,6 +620,7 @@ out: free(sbi, M_REISERFSMNT); if (rmp) free(rmp, M_REISERFSMNT); + dev_rel(dev); return (error); }