udv_attach() and uvn_attach() are called directly, not via any generic
dispatch table mechanism, so there's no point in specifying that they
accept "void *" instead of the underlying types they actually expect.
ok?
Index: share/man/man9/uvm.9
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/share/man/man9/uvm.9,v
retrieving revision 1.55
diff -u -p -r1.55 uvm.9
--- share/man/man9/uvm.9 30 Jun 2014 21:48:09 -0000 1.55
+++ share/man/man9/uvm.9 1 Jul 2014 19:57:54 -0000
@@ -439,7 +439,7 @@ returns a standard errno.
.Sh MEMORY MAPPING FILES AND DEVICES
.nr nS 1
.Ft struct uvm_object *
-.Fn uvn_attach "void *arg" "vm_prot_t accessprot"
+.Fn uvn_attach "struct vnode *vp" "vm_prot_t accessprot"
.Ft void
.Fn uvm_vnp_setsize "struct vnode *vp" "voff_t newsize"
.Ft void
@@ -453,7 +453,7 @@ returns a standard errno.
The
.Fn uvn_attach
function attaches a UVM object to vnode
-.Fa arg ,
+.Fa vp ,
creating the object if necessary.
The object is returned.
.Pp
Index: sys/kern/exec_subr.c
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/kern/exec_subr.c,v
retrieving revision 1.33
diff -u -p -r1.33 exec_subr.c
--- sys/kern/exec_subr.c 29 May 2014 05:05:34 -0000 1.33
+++ sys/kern/exec_subr.c 1 Jul 2014 19:54:15 -0000
@@ -187,7 +187,7 @@ vmcmd_map_pagedvn(struct proc *p, struct
* first, attach to the object
*/
- uobj = uvn_attach((void *)cmd->ev_vp, VM_PROT_READ|VM_PROT_EXECUTE);
+ uobj = uvn_attach(cmd->ev_vp, VM_PROT_READ|VM_PROT_EXECUTE);
if (uobj == NULL)
return (ENOMEM);
Index: sys/uvm/uvm_vnode.c
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/uvm/uvm_vnode.c,v
retrieving revision 1.82
diff -u -p -r1.82 uvm_vnode.c
--- sys/uvm/uvm_vnode.c 8 May 2014 20:08:50 -0000 1.82
+++ sys/uvm/uvm_vnode.c 1 Jul 2014 19:53:41 -0000
@@ -139,9 +139,8 @@ uvn_init(void)
* pointers are equiv.
*/
struct uvm_object *
-uvn_attach(void *arg, vm_prot_t accessprot)
+uvn_attach(struct vnode *vp, vm_prot_t accessprot)
{
- struct vnode *vp = arg;
struct uvm_vnode *uvn = &vp->v_uvm;
struct vattr vattr;
int oldflags, result;
Index: sys/uvm/uvm_vnode.h
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/uvm/uvm_vnode.h,v
retrieving revision 1.12
diff -u -p -r1.12 uvm_vnode.h
--- sys/uvm/uvm_vnode.h 14 Mar 2002 01:27:19 -0000 1.12
+++ sys/uvm/uvm_vnode.h 1 Jul 2014 19:53:54 -0000
@@ -102,7 +102,7 @@ struct uvm_vnode {
* include sys/vnode.h, and files that include sys/vnode.h don't know
* what a vm_prot_t is.
*/
-struct uvm_object *uvn_attach(void *, vm_prot_t);
+struct uvm_object *uvn_attach(struct vnode *, vm_prot_t);
#endif
#endif /* _KERNEL */
Index: sys/uvm/uvm_device.c
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/uvm/uvm_device.c,v
retrieving revision 1.45
diff -u -p -r1.45 uvm_device.c
--- sys/uvm/uvm_device.c 13 Apr 2014 23:14:15 -0000 1.45
+++ sys/uvm/uvm_device.c 1 Jul 2014 19:56:09 -0000
@@ -97,9 +97,8 @@ struct uvm_pagerops uvm_deviceops = {
* The last two arguments (off and size) are only used for access checking.
*/
struct uvm_object *
-udv_attach(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size)
+udv_attach(dev_t device, vm_prot_t accessprot, voff_t off, vsize_t size)
{
- dev_t device = *((dev_t *)arg);
struct uvm_device *udv, *lcv;
paddr_t (*mapfn)(dev_t, off_t, int);
#if NDRM > 0
@@ -118,7 +117,7 @@ udv_attach(void *arg, vm_prot_t accesspr
return(NULL);
#if NDRM > 0
- obj = udv_attach_drm(arg, accessprot, off, size);
+ obj = udv_attach_drm(device, accessprot, off, size);
if (obj)
return(obj);
#endif
Index: sys/uvm/uvm_device.h
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/uvm/uvm_device.h,v
retrieving revision 1.9
diff -u -p -r1.9 uvm_device.h
--- sys/uvm/uvm_device.h 7 Jun 2013 20:46:14 -0000 1.9
+++ sys/uvm/uvm_device.h 1 Jul 2014 19:55:42 -0000
@@ -70,8 +70,8 @@ struct uvm_device {
* prototypes
*/
-struct uvm_object *udv_attach(void *, vm_prot_t, voff_t, vsize_t);
-struct uvm_object *udv_attach_drm(void *, vm_prot_t, voff_t, vsize_t);
+struct uvm_object *udv_attach(dev_t, vm_prot_t, voff_t, vsize_t);
+struct uvm_object *udv_attach_drm(dev_t, vm_prot_t, voff_t, vsize_t);
#endif /* _KERNEL */
Index: sys/uvm/uvm_extern.h
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/uvm/uvm_extern.h,v
retrieving revision 1.116
diff -u -p -r1.116 uvm_extern.h
--- sys/uvm/uvm_extern.h 13 Jun 2014 01:48:52 -0000 1.116
+++ sys/uvm/uvm_extern.h 1 Jul 2014 19:54:02 -0000
@@ -739,7 +739,7 @@ void uvm_vnp_sync(struct mount *);
void uvm_vnp_terminate(struct vnode *);
/* terminate a uvm/uvn object */
boolean_t uvm_vnp_uncache(struct vnode *);
-struct uvm_object *uvn_attach(void *, vm_prot_t);
+struct uvm_object *uvn_attach(struct vnode *, vm_prot_t);
/* kern_malloc.c */
void kmeminit_nkmempages(void);
Index: sys/uvm/uvm_mmap.c
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/uvm/uvm_mmap.c,v
retrieving revision 1.95
diff -u -p -r1.95 uvm_mmap.c
--- sys/uvm/uvm_mmap.c 27 Jun 2014 20:50:43 -0000 1.95
+++ sys/uvm/uvm_mmap.c 1 Jul 2014 19:59:21 -0000
@@ -949,7 +949,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vs
} else {
vp = (struct vnode *) handle; /* get vnode */
if (vp->v_type != VCHR) {
- uobj = uvn_attach((void *) vp, (flags & MAP_SHARED) ?
+ uobj = uvn_attach(vp, (flags & MAP_SHARED) ?
maxprot : (maxprot & ~VM_PROT_WRITE));
#ifndef UBC
@@ -987,7 +987,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vs
vref(vp);
#endif
} else {
- uobj = udv_attach((void *) &vp->v_rdev,
+ uobj = udv_attach(vp->v_rdev,
(flags & MAP_SHARED) ? maxprot :
(maxprot & ~VM_PROT_WRITE), foff, size);
/*
@@ -997,7 +997,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vs
*/
if (uobj == NULL && (prot & PROT_EXEC) == 0) {
maxprot &= ~VM_PROT_EXECUTE;
- uobj = udv_attach((void *) &vp->v_rdev,
+ uobj = udv_attach(vp->v_rdev,
(flags & MAP_SHARED) ? maxprot :
(maxprot & ~VM_PROT_WRITE), foff, size);
}
Index: sys/dev/pci/drm/drm_drv.c
===================================================================
RCS file: /home/matthew/cvs-mirror/cvs/src/sys/dev/pci/drm/drm_drv.c,v
retrieving revision 1.127
diff -u -p -r1.127 drm_drv.c
--- sys/dev/pci/drm/drm_drv.c 7 Apr 2014 06:43:11 -0000 1.127
+++ sys/dev/pci/drm/drm_drv.c 1 Jul 2014 19:56:45 -0000
@@ -1691,9 +1691,8 @@ out_free_list:
}
struct uvm_object *
-udv_attach_drm(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size)
+udv_attach_drm(dev_t device, vm_prot_t accessprot, voff_t off, vsize_t size)
{
- dev_t device = *((dev_t *)arg);
struct drm_device *dev = drm_get_device_from_kdev(device);
struct drm_local_map *map;
struct drm_gem_object *obj;