summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index e7e077d..e19750c 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -427,7 +427,6 @@ vm_object_vndeallocate(vm_object_t object)
{
struct vnode *vp = (struct vnode *) object->handle;
- VFS_ASSERT_GIANT(vp->v_mount);
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
KASSERT(object->type == OBJT_VNODE,
("vm_object_vndeallocate: not a vnode object"));
@@ -480,38 +479,11 @@ vm_object_deallocate(vm_object_t object)
vm_object_t temp;
while (object != NULL) {
- int vfslocked;
-
- vfslocked = 0;
- restart:
VM_OBJECT_LOCK(object);
if (object->type == OBJT_VNODE) {
- struct vnode *vp = (struct vnode *) object->handle;
-
- /*
- * Conditionally acquire Giant for a vnode-backed
- * object. We have to be careful since the type of
- * a vnode object can change while the object is
- * unlocked.
- */
- if (VFS_NEEDSGIANT(vp->v_mount) && !vfslocked) {
- vfslocked = 1;
- if (!mtx_trylock(&Giant)) {
- VM_OBJECT_UNLOCK(object);
- mtx_lock(&Giant);
- goto restart;
- }
- }
vm_object_vndeallocate(object);
- VFS_UNLOCK_GIANT(vfslocked);
return;
- } else
- /*
- * This is to handle the case that the object
- * changed type while we dropped its lock to
- * obtain Giant.
- */
- VFS_UNLOCK_GIANT(vfslocked);
+ }
KASSERT(object->ref_count != 0,
("vm_object_deallocate: object deallocated too many times: %d", object->type));
@@ -987,11 +959,9 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size,
*/
if (object->type == OBJT_VNODE &&
(object->flags & OBJ_MIGHTBEDIRTY) != 0) {
- int vfslocked;
vp = object->handle;
VM_OBJECT_UNLOCK(object);
(void) vn_start_write(vp, &mp, V_WAIT);
- vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
if (syncio && !invalidate && offset == 0 &&
OFF_TO_IDX(size) == object->size) {
@@ -1015,7 +985,6 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size,
if (fsync_after)
error = VOP_FSYNC(vp, MNT_WAIT, curthread);
VOP_UNLOCK(vp, 0);
- VFS_UNLOCK_GIANT(vfslocked);
vn_finished_write(mp);
if (error != 0)
res = FALSE;
OpenPOWER on IntegriCloud