Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2012 20:36:04 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233575 - head/sys/gnu/fs/reiserfs
Message-ID:  <201203272036.q2RKa4Wb002754@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203272036.q2RKa4Wb002754>