summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-02-11 09:02:21 +0000
committerkib <kib@FreeBSD.org>2015-02-11 09:02:21 +0000
commit7ca5c317aee117a4f147780b44663907203afc11 (patch)
tree544d9b4141cc31e9d2012916d768135800fbd2ca /sys/vm
parentf5a4512544e1004f761b474f350ae4ebd61bb09c (diff)
downloadFreeBSD-src-7ca5c317aee117a4f147780b44663907203afc11.zip
FreeBSD-src-7ca5c317aee117a4f147780b44663907203afc11.tar.gz
MFC r277828:
Update mtime for tmpfs files modified through memory mapping. MFC r277969: Update both ctime and mtime for writes to tmpfs files. MFC r277972: Remove single-use boolean. MFC r278151: Remove duplicated assignment.
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 3f3c62b..dfbc2bd 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 40fcad6..9324fb2 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2200,8 +2200,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 48ba743..8f65b42 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