summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-01-11 12:35:16 +0000
committerkib <kib@FreeBSD.org>2010-01-11 12:35:16 +0000
commitb7b14148894fa479cb54bcf4a9b24b2020f97956 (patch)
tree9cbce5723fdfcd3c0985fbf6c9d7311c55347b08 /sys/vm
parentadd842460cedb0a6af3206ce2359520e6bad359c (diff)
downloadFreeBSD-src-b7b14148894fa479cb54bcf4a9b24b2020f97956.zip
FreeBSD-src-b7b14148894fa479cb54bcf4a9b24b2020f97956.tar.gz
MFC r200770:
Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for vnode-backed vm objects.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c26
-rw-r--r--sys/vm/vm_object.h2
2 files changed, 6 insertions, 22 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index d7a6e97..399cb10 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -773,9 +773,9 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int
int curgeneration;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
- if (object->type != OBJT_VNODE ||
- (object->flags & OBJ_MIGHTBEDIRTY) == 0)
+ if ((object->flags & OBJ_MIGHTBEDIRTY) == 0)
return;
+ KASSERT(object->type == OBJT_VNODE, ("Not a vnode object"));
pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) ? VM_PAGER_PUT_SYNC : VM_PAGER_CLUSTER_OK;
pagerflags |= (flags & OBJPC_INVAL) ? VM_PAGER_PUT_INVAL : 0;
@@ -875,18 +875,8 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int
pmap_remove_write(p);
}
- if (clearobjflags && (tstart == 0) && (tend == object->size)) {
- struct vnode *vp;
-
+ if (clearobjflags && (tstart == 0) && (tend == object->size))
vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY);
- if (object->type == OBJT_VNODE &&
- (vp = (struct vnode *)object->handle) != NULL) {
- VI_LOCK(vp);
- if (vp->v_iflag & VI_OBJDIRTY)
- vp->v_iflag &= ~VI_OBJDIRTY;
- VI_UNLOCK(vp);
- }
- }
rescan:
curgeneration = object->generation;
@@ -2148,18 +2138,12 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset_t prev_offset,
void
vm_object_set_writeable_dirty(vm_object_t object)
{
- struct vnode *vp;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
- if ((object->flags & OBJ_MIGHTBEDIRTY) != 0)
+ if (object->type != OBJT_VNODE ||
+ (object->flags & OBJ_MIGHTBEDIRTY) != 0)
return;
vm_object_set_flag(object, OBJ_MIGHTBEDIRTY);
- if (object->type == OBJT_VNODE &&
- (vp = (struct vnode *)object->handle) != NULL) {
- VI_LOCK(vp);
- vp->v_iflag |= VI_OBJDIRTY;
- VI_UNLOCK(vp);
- }
}
#include "opt_ddb.h"
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 0b06fed..6a9f129 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -154,7 +154,7 @@ struct vm_object {
#define OBJ_DEAD 0x0008 /* dead objects (during rundown) */
#define OBJ_NOSPLIT 0x0010 /* dont split this object */
#define OBJ_PIPWNT 0x0040 /* paging in progress wanted */
-#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty */
+#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty, only for vnode */
#define OBJ_CLEANING 0x0200
#define OBJ_COLORED 0x1000 /* pg_color is defined */
#define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */
OpenPOWER on IntegriCloud