summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-10-22 17:50:54 +0000
committerkib <kib@FreeBSD.org>2012-10-22 17:50:54 +0000
commit560aa751e0f5cfef868bdf3fab01cdbc5169ef82 (patch)
tree6e9ef0a47c5e91d26227820c50c9767e84550821 /sys/geom
parentca71b68ea40c83f641d6485e027368568f244197 (diff)
downloadFreeBSD-src-560aa751e0f5cfef868bdf3fab01cdbc5169ef82.zip
FreeBSD-src-560aa751e0f5cfef868bdf3fab01cdbc5169ef82.tar.gz
Remove the support for using non-mpsafe filesystem modules.
In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_vfs.c12
-rw-r--r--sys/geom/journal/g_journal.c10
2 files changed, 4 insertions, 18 deletions
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c
index ade1790..afc6549 100644
--- a/sys/geom/geom_vfs.c
+++ b/sys/geom/geom_vfs.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/vnode.h>
-#include <sys/mount.h> /* XXX Temporary for VFS_LOCK_GIANT */
+#include <sys/mount.h>
#include <geom/geom.h>
#include <geom/geom_vfs.h>
@@ -94,7 +94,7 @@ g_vfs_done(struct bio *bip)
struct g_consumer *cp;
struct g_vfs_softc *sc;
struct buf *bp;
- int vfslocked, destroy;
+ int destroy;
struct mount *mp;
struct vnode *vp;
struct cdev *cdevp;
@@ -158,9 +158,7 @@ g_vfs_done(struct bio *bip)
if (destroy)
g_post_event(g_vfs_destroy, cp, M_WAITOK, NULL);
- vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL));
bufdone(bp);
- VFS_UNLOCK_GIANT(vfslocked);
}
void
@@ -169,7 +167,6 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp)
struct g_vfs_softc *sc;
struct g_consumer *cp;
struct bio *bip;
- int vfslocked;
cp = bo->bo_private;
sc = cp->geom->softc;
@@ -182,9 +179,7 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp)
mtx_unlock(&sc->sc_mtx);
bp->b_error = ENXIO;
bp->b_ioflags |= BIO_ERROR;
- vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL));
bufdone(bp);
- VFS_UNLOCK_GIANT(vfslocked);
return;
}
sc->sc_active++;
@@ -234,7 +229,6 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr
struct g_consumer *cp;
struct g_vfs_softc *sc;
struct bufobj *bo;
- int vfslocked;
int error;
g_topology_assert();
@@ -259,9 +253,7 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr
g_wither_geom(gp, ENXIO);
return (error);
}
- vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vnode_create_vobject(vp, pp->mediasize, curthread);
- VFS_UNLOCK_GIANT(vfslocked);
*cpp = cp;
cp->private = vp;
bo->bo_ops = g_vfs_bufops;
diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
index a31f590..4581430 100644
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -2870,7 +2870,7 @@ g_journal_do_switch(struct g_class *classp)
struct mount *mp;
struct bintime bt;
char *mountpoint;
- int error, save, vfslocked;
+ int error, save;
DROP_GIANT();
g_topology_lock();
@@ -2922,11 +2922,8 @@ g_journal_do_switch(struct g_class *classp)
mountpoint = mp->mnt_stat.f_mntonname;
- vfslocked = VFS_LOCK_GIANT(mp);
-
error = vn_start_write(NULL, &mp, V_WAIT);
if (error != 0) {
- VFS_UNLOCK_GIANT(vfslocked);
GJ_DEBUG(0, "vn_start_write(%s) failed (error=%d).",
mountpoint, error);
goto next;
@@ -2951,10 +2948,8 @@ g_journal_do_switch(struct g_class *classp)
vn_finished_write(mp);
- if (error != 0) {
- VFS_UNLOCK_GIANT(vfslocked);
+ if (error != 0)
goto next;
- }
/*
* Send BIO_FLUSH before freezing the file system, so it can be
@@ -2966,7 +2961,6 @@ g_journal_do_switch(struct g_class *classp)
GJ_TIMER_START(1, &bt);
error = vfs_write_suspend(mp);
- VFS_UNLOCK_GIANT(vfslocked);
GJ_TIMER_STOP(1, &bt, "Suspend time of %s", mountpoint);
if (error != 0) {
GJ_DEBUG(0, "Cannot suspend file system %s (error=%d).",
OpenPOWER on IntegriCloud