summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_fault.c6
-rw-r--r--sys/vm/vm_object.c7
-rw-r--r--sys/vm/vm_object.h1
3 files changed, 11 insertions, 3 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index e62410b..71c6d84 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -358,11 +358,13 @@ RetryFault:;
(fault_flags & (VM_FAULT_CHANGE_WIRING | VM_FAULT_DIRTY)) == 0 &&
/* avoid calling vm_object_set_writeable_dirty() */
((prot & VM_PROT_WRITE) == 0 ||
- fs.first_object->type != OBJT_VNODE ||
+ (fs.first_object->type != OBJT_VNODE &&
+ (fs.first_object->flags & OBJ_TMPFS_NODE) == 0) ||
(fs.first_object->flags & OBJ_MIGHTBEDIRTY) != 0)) {
VM_OBJECT_RLOCK(fs.first_object);
if ((prot & VM_PROT_WRITE) != 0 &&
- fs.first_object->type == OBJT_VNODE &&
+ (fs.first_object->type == OBJT_VNODE ||
+ (fs.first_object->flags & OBJ_TMPFS_NODE) != 0) &&
(fs.first_object->flags & OBJ_MIGHTBEDIRTY) == 0)
goto fast_failed;
m = vm_page_lookup(fs.first_object, fs.first_pindex);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 21c15dc..63127c0 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2199,8 +2199,13 @@ vm_object_set_writeable_dirty(vm_object_t object)
{
VM_OBJECT_ASSERT_WLOCKED(object);
- if (object->type != OBJT_VNODE)
+ if (object->type != OBJT_VNODE) {
+ if ((object->flags & OBJ_TMPFS_NODE) != 0) {
+ KASSERT(object->type == OBJT_SWAP, ("non-swap tmpfs"));
+ vm_object_set_flag(object, OBJ_TMPFS_DIRTY);
+ }
return;
+ }
object->generation++;
if ((object->flags & OBJ_MIGHTBEDIRTY) != 0)
return;
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index ab3c7d3..d80b1d8 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -187,6 +187,7 @@ struct vm_object {
#define OBJ_PIPWNT 0x0040 /* paging in progress wanted */
#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty, only for vnode */
#define OBJ_TMPFS_NODE 0x0200 /* object belongs to tmpfs VREG node */
+#define OBJ_TMPFS_DIRTY 0x0400 /* dirty tmpfs obj */
#define OBJ_COLORED 0x1000 /* pg_color is defined */
#define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */
#define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */
OpenPOWER on IntegriCloud