git: f0c07fe3d000 - main - device_pager: rename the un_pager.devp.dev field to handle

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 06 Nov 2024 00:23:47 UTC
The branch main has been updated by kib:

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

commit f0c07fe3d0007a4499f81583a99598cd0a74d45b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-04 22:10:06 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-06 00:10:59 +0000

    device_pager: rename the un_pager.devp.dev field to handle
    
    because it is not neccessary struct cdev *.
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D47443
---
 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 f3ecaf4e2547..0d5b9a93d704 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -2719,7 +2719,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 a5be05efc6d9..a5fffbf629bd 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -118,8 +118,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;
@@ -183,8 +183,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;
@@ -218,7 +218,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);
@@ -228,14 +228,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;
@@ -301,7 +301,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 996f7557ea9b..6d29ddf71f19 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2516,7 +2516,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 c7f0dd0943ba..596f67b46e6f 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -137,7 +137,7 @@ struct vm_object {
 		struct {
 			TAILQ_HEAD(, vm_page) devp_pglist;
 			const struct cdev_pager_ops *ops;
-			struct cdev *dev;
+			void *handle;
 		} devp;
 
 		/*