git: 300d034b3c29 - releng/14.2 - device_pager: rename the un_pager.devp.dev field to handle

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 13 Nov 2024 18:06:50 UTC
The branch releng/14.2 has been updated by kib:

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

commit 300d034b3c29972c7f9e073c322a95dff510e89b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-04 22:10:06 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-13 18:06:28 +0000

    device_pager: rename the un_pager.devp.dev field to handle
    
    (cherry picked from commit f0c07fe3d0007a4499f81583a99598cd0a74d45b)
    (cherry picked from commit c57dc755fa1a8bb0a4190f60df02b2bce5b8033c)
    
    Approved by:    re (cperciva)
---
 sys/kern/kern_proc.c  |  2 +-
 sys/vm/device_pager.c | 20 ++++++++++----------
 sys/vm/vm_object.c    |  2 +-
 sys/vm/vm_object.h    |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index b8bc1a7e5dfe..18302bb8abae 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -2720,7 +2720,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags)
 			kve->kve_shadow_count = obj->shadow_count;
 			if (obj->type == OBJT_DEVICE ||
 			    obj->type == OBJT_MGTDEVICE) {
-				cdev = obj->un_pager.devp.dev;
+				cdev = obj->un_pager.devp.handle;
 				if (cdev != NULL) {
 					csw = dev_refthread(cdev, &ref);
 					if (csw != NULL) {
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index cb3b0e522d9a..bceff38a41c3 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -121,8 +121,8 @@ cdev_pager_lookup(void *handle)
 again:
 	mtx_lock(&dev_pager_mtx);
 	object = vm_pager_object_lookup(&dev_pager_object_list, handle);
-	if (object != NULL && object->un_pager.devp.dev == NULL) {
-		msleep(&object->un_pager.devp.dev, &dev_pager_mtx,
+	if (object != NULL && object->un_pager.devp.handle == NULL) {
+		msleep(&object->un_pager.devp.handle, &dev_pager_mtx,
 		    PVM | PDROP, "cdplkp", 0);
 		vm_object_deallocate(object);
 		goto again;
@@ -186,8 +186,8 @@ again:
 			object1->type = OBJT_DEAD;
 			vm_object_deallocate(object1);
 			object1 = NULL;
-			if (object->un_pager.devp.dev == NULL) {
-				msleep(&object->un_pager.devp.dev,
+			if (object->un_pager.devp.handle == NULL) {
+				msleep(&object->un_pager.devp.handle,
 				    &dev_pager_mtx, PVM | PDROP, "cdplkp", 0);
 				vm_object_deallocate(object);
 				goto again;
@@ -221,7 +221,7 @@ again:
 				mtx_lock(&dev_pager_mtx);
 				TAILQ_REMOVE(&dev_pager_object_list, object,
 				    pager_object_list);
-				wakeup(&object->un_pager.devp.dev);
+				wakeup(&object->un_pager.devp.handle);
 				mtx_unlock(&dev_pager_mtx);
 				object->type = OBJT_DEAD;
 				vm_object_deallocate(object);
@@ -231,14 +231,14 @@ again:
 				mtx_lock(&dev_pager_mtx);
 				object->flags |= OBJ_COLORED;
 				object->pg_color = color;
-				object->un_pager.devp.dev = handle;
-				wakeup(&object->un_pager.devp.dev);
+				object->un_pager.devp.handle = handle;
+				wakeup(&object->un_pager.devp.handle);
 			}
 		}
 		MPASS(object1 == NULL);
 	} else {
-		if (object->un_pager.devp.dev == NULL) {
-			msleep(&object->un_pager.devp.dev,
+		if (object->un_pager.devp.handle == NULL) {
+			msleep(&object->un_pager.devp.handle,
 			    &dev_pager_mtx, PVM | PDROP, "cdplkp", 0);
 			vm_object_deallocate(object);
 			goto again;
@@ -292,7 +292,7 @@ dev_pager_dealloc(vm_object_t object)
 	vm_page_t m;
 
 	VM_OBJECT_WUNLOCK(object);
-	object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev);
+	object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.handle);
 
 	mtx_lock(&dev_pager_mtx);
 	TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 06dae7de3baa..5933b2c1d4bd 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2611,7 +2611,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only)
 			kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp;
 		}
 		if (obj->type == OBJT_DEVICE || obj->type == OBJT_MGTDEVICE) {
-			cdev = obj->un_pager.devp.dev;
+			cdev = obj->un_pager.devp.handle;
 			if (cdev != NULL) {
 				csw = dev_refthread(cdev, &ref);
 				if (csw != NULL) {
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 9921f1130e8c..16ee3544b658 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -139,7 +139,7 @@ struct vm_object {
 		struct {
 			TAILQ_HEAD(, vm_page) devp_pglist;
 			const struct cdev_pager_ops *ops;
-			struct cdev *dev;
+			void *handle;
 		} devp;
 
 		/*