git: c75a5bc2f679 - stable/13 - vm_object: Use the vm_object_(set|clear)_flag() helpers

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 21 Jun 2022 13:02:38 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=c75a5bc2f679d4d4b9324640ea0dfbd716530137

commit c75a5bc2f679d4d4b9324640ea0dfbd716530137
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-06-14 15:35:20 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-06-21 12:53:24 +0000

    vm_object: Use the vm_object_(set|clear)_flag() helpers
    
    ... rather than setting and clearing flags inline.  No functional change
    intended.
    
    Reviewed by:    alc, kib
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 630f633f2a7618e7726ceb6ff4bff1c442919250)
---
 sys/kern/kern_umtx.c | 2 +-
 sys/vm/vm_object.c   | 7 ++++---
 sys/vm/vm_object.h   | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index f847bd771a84..513b084ea489 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -4332,7 +4332,7 @@ umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force)
 	if (force) {
 		object = reg->ushm_obj->shm_object;
 		VM_OBJECT_WLOCK(object);
-		object->flags |= OBJ_UMTXDEAD;
+		vm_object_set_flag(object, OBJ_UMTXDEAD);
 		VM_OBJECT_WUNLOCK(object);
 	}
 	mtx_lock(&umtx_shm_lock);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 94f9bed3d9b8..efd646cf52e0 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -744,7 +744,7 @@ vm_object_backing_remove_locked(vm_object_t object)
 	vm_object_sub_shadow(backing_object);
 	if ((object->flags & OBJ_SHADOWLIST) != 0) {
 		LIST_REMOVE(object, shadow_list);
-		object->flags &= ~OBJ_SHADOWLIST;
+		vm_object_clear_flag(object, OBJ_SHADOWLIST);
 	}
 	object->backing_object = NULL;
 }
@@ -778,7 +778,7 @@ vm_object_backing_insert_locked(vm_object_t object, vm_object_t backing_object)
 		VM_OBJECT_ASSERT_WLOCKED(backing_object);
 		LIST_INSERT_HEAD(&backing_object->shadow_head, object,
 		    shadow_list);
-		object->flags |= OBJ_SHADOWLIST;
+		vm_object_set_flag(object, OBJ_SHADOWLIST);
 	}
 	object->backing_object = backing_object;
 }
@@ -1498,7 +1498,8 @@ vm_object_shadow(vm_object_t *object, vm_ooffset_t *offset, vm_size_t length,
 			vm_object_backing_insert(result, source);
 			result->domain = source->domain;
 #if VM_NRESERVLEVEL > 0
-			result->flags |= source->flags & OBJ_COLORED;
+			vm_object_set_flag(result,
+			    (source->flags & OBJ_COLORED));
 			result->pg_color = (source->pg_color +
 			    OFF_TO_IDX(*offset)) & ((1 << (VM_NFREEORDER -
 			    1)) - 1);
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 903c85261254..4a3c27514eb6 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -317,7 +317,7 @@ vm_object_color(vm_object_t object, u_short color)
 
 	if ((object->flags & OBJ_COLORED) == 0) {
 		object->pg_color = color;
-		object->flags |= OBJ_COLORED;
+		vm_object_set_flag(object, OBJ_COLORED);
 	}
 }