From 5d3c44687b2e85f65228a2386d84f916ff779427 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 14 Dec 2005 00:49:52 +0000 Subject: Eradicate caddr_t from the VFS API. --- sys/fs/nullfs/null_vfsops.c | 2 +- sys/fs/nwfs/nwfs_vfsops.c | 4 ++-- sys/fs/smbfs/smbfs_vfsops.c | 4 ++-- sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c | 2 +- sys/kern/vfs_default.c | 2 +- sys/kern/vfs_vnops.c | 8 ++++---- sys/kern/vnode_if.src | 4 ++-- sys/sys/mount.h | 2 +- sys/sys/vnode.h | 4 ++-- sys/tools/vnode_if.awk | 4 ++-- sys/ufs/ufs/quota.h | 8 ++++---- sys/ufs/ufs/ufs_quota.c | 20 ++++++++++---------- sys/ufs/ufs/ufs_vfsops.c | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index bb5e8b7..28d24e1 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -259,7 +259,7 @@ nullfs_quotactl(mp, cmd, uid, arg, td) struct mount *mp; int cmd; uid_t uid; - caddr_t arg; + void *arg; struct thread *td; { return VFS_QUOTACTL(MOUNTTONULLMOUNT(mp)->nullm_vfs, cmd, uid, arg, td); diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c index 4a10c2e..e1e4997 100644 --- a/sys/fs/nwfs/nwfs_vfsops.c +++ b/sys/fs/nwfs/nwfs_vfsops.c @@ -135,7 +135,7 @@ static int nwfs_cmount(struct mntarg *ma, void *data, int flags, struct nwfs_args args; /* will hold data from mount request */ int error; - error = copyin(data, (caddr_t)&args, sizeof(struct nwfs_args)); + error = copyin(data, &args, sizeof(struct nwfs_args)); if (error) return (error); @@ -373,7 +373,7 @@ nwfs_quotactl(mp, cmd, uid, arg, td) struct mount *mp; int cmd; uid_t uid; - caddr_t arg; + void *arg; struct thread *td; { NCPVODEBUG("return EOPNOTSUPP\n"); diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index aa9a8e1..f64c125 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -108,7 +108,7 @@ smbfs_cmount(struct mntarg *ma, void * data, int flags, struct thread *td) struct smbfs_args args; int error; - error = copyin(data, (caddr_t)&args, sizeof(struct smbfs_args)); + error = copyin(data, &args, sizeof(struct smbfs_args)); if (error) return error; @@ -366,7 +366,7 @@ smbfs_quotactl(mp, cmd, uid, arg, td) struct mount *mp; int cmd; uid_t uid; - caddr_t arg; + void *arg; struct thread *td; { SMBVDEBUG("return EOPNOTSUPP\n"); diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c b/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c index 78a091f..008a852 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c @@ -260,7 +260,7 @@ _xfs_quotactl(mp, cmd, uid, arg, td) struct mount *mp; int cmd; uid_t uid; - caddr_t arg; + void *arg; struct thread *td; { printf("xfs_quotactl\n"); diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 0ac6c11..d8adf7c 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -532,7 +532,7 @@ vfs_stdquotactl (mp, cmds, uid, arg, td) struct mount *mp; int cmds; uid_t uid; - caddr_t arg; + void *arg; struct thread *td; { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index d8c00fd..fda74f1 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -327,7 +327,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, aresid, td) enum uio_rw rw; struct vnode *vp; - caddr_t base; + void *base; int len; off_t offset; enum uio_seg segflg; @@ -420,7 +420,7 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, aresid, td) enum uio_rw rw; struct vnode *vp; - caddr_t base; + void *base; size_t len; off_t offset; enum uio_seg segflg; @@ -457,7 +457,7 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, active_cred, if (error) break; offset += chunk; - base += chunk; + base = (char *)base + chunk; uio_yield(); } while (len); if (aresid) @@ -844,7 +844,7 @@ vn_closefile(fp, td) lf.l_start = 0; lf.l_len = 0; lf.l_type = F_UNLCK; - (void) VOP_ADVLOCK(vp, (caddr_t)fp, F_UNLCK, &lf, F_FLOCK); + (void) VOP_ADVLOCK(vp, fp, F_UNLCK, &lf, F_FLOCK); } fp->f_ops = &badfileops; diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 19780a5..8117f0b 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -215,7 +215,7 @@ vop_lease { vop_ioctl { IN struct vnode *vp; IN u_long command; - IN caddr_t data; + IN void *data; IN int fflag; IN struct ucred *cred; IN struct thread *td; @@ -440,7 +440,7 @@ vop_pathconf { # vop_advlock { IN struct vnode *vp; - IN caddr_t id; + IN void *id; IN int op; IN struct flock *fl; IN int flags; diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 8e410b3..2ceab16 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -472,7 +472,7 @@ typedef int vfs_unmount_t(struct mount *mp, int mntflags, struct thread *td); typedef int vfs_root_t(struct mount *mp, int flags, struct vnode **vpp, struct thread *td); typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid, - caddr_t arg, struct thread *td); + void *arg, struct thread *td); typedef int vfs_statfs_t(struct mount *mp, struct statfs *sbp, struct thread *td); typedef int vfs_sync_t(struct mount *mp, int waitfor, struct thread *td); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 7b9edad..6c93439 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -608,11 +608,11 @@ int vn_open(struct nameidata *ndp, int *flagp, int cmode, int fdidx); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, struct ucred *cred, int fdidx); int vn_pollrecord(struct vnode *vp, struct thread *p, int events); -int vn_rdwr(enum uio_rw rw, struct vnode *vp, caddr_t base, +int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, int *aresid, struct thread *td); -int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, caddr_t base, +int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base, size_t len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, size_t *aresid, struct thread *td); diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 845f36b..9691b85 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -178,7 +178,7 @@ if (cfile) { "struct vnodeop_desc vop_default_desc = {\n" \ " \"default\",\n" \ " 0,\n" \ - " (void *)(uintptr_t)vop_panic,\n" \ + " (vop_bypass_t *)vop_panic,\n" \ " NULL,\n" \ " VDESC_NO_OFFSET,\n" \ " VDESC_NO_OFFSET,\n" \ @@ -400,7 +400,7 @@ while ((getline < srcfile) > 0) { printc("\t" releflags vppwillrele ","); # function to call - printc("\t(void*)(uintptr_t)" uname "_AP,"); + printc("\t(vop_bypass_t *)" uname "_AP,"); # vp offsets printc("\t" name "_vp_offsets,"); # vpp (if any) diff --git a/sys/ufs/ufs/quota.h b/sys/ufs/ufs/quota.h index 1b6b80d..8fb9eb2 100644 --- a/sys/ufs/ufs/quota.h +++ b/sys/ufs/ufs/quota.h @@ -179,12 +179,12 @@ void dqinit(void); void dqrele(struct vnode *, struct dquot *); void dquninit(void); int getinoquota(struct inode *); -int getquota(struct thread *, struct mount *, u_long, int, caddr_t); +int getquota(struct thread *, struct mount *, u_long, int, void *); int qsync(struct mount *mp); int quotaoff(struct thread *td, struct mount *, int); -int quotaon(struct thread *td, struct mount *, int, caddr_t); -int setquota(struct thread *, struct mount *, u_long, int, caddr_t); -int setuse(struct thread *, struct mount *, u_long, int, caddr_t); +int quotaon(struct thread *td, struct mount *, int, void *); +int setquota(struct thread *, struct mount *, u_long, int, void *); +int setuse(struct thread *, struct mount *, u_long, int, void *); vfs_quotactl_t ufs_quotactl; #else /* !_KERNEL */ diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 837d0c4..2ba8d1a 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -399,7 +399,7 @@ quotaon(td, mp, type, fname) struct thread *td; struct mount *mp; int type; - caddr_t fname; + void *fname; { struct ufsmount *ump = VFSTOUFS(mp); struct vnode *vp, **vpp; @@ -555,7 +555,7 @@ getquota(td, mp, id, type, addr) struct mount *mp; u_long id; int type; - caddr_t addr; + void *addr; { struct dquot *dq; int error; @@ -584,7 +584,7 @@ getquota(td, mp, id, type, addr) error = dqget(NULLVP, id, VFSTOUFS(mp), type, &dq); if (error) return (error); - error = copyout((caddr_t)&dq->dq_dqb, addr, sizeof (struct dqblk)); + error = copyout(&dq->dq_dqb, addr, sizeof (struct dqblk)); dqrele(NULLVP, dq); return (error); } @@ -598,7 +598,7 @@ setquota(td, mp, id, type, addr) struct mount *mp; u_long id; int type; - caddr_t addr; + void *addr; { struct dquot *dq; struct dquot *ndq; @@ -610,7 +610,7 @@ setquota(td, mp, id, type, addr) if (error) return (error); - error = copyin(addr, (caddr_t)&newlim, sizeof (struct dqblk)); + error = copyin(addr, &newlim, sizeof (struct dqblk)); if (error) return (error); error = dqget(NULLVP, id, ump, type, &ndq); @@ -664,7 +664,7 @@ setuse(td, mp, id, type, addr) struct mount *mp; u_long id; int type; - caddr_t addr; + void *addr; { struct dquot *dq; struct ufsmount *ump = VFSTOUFS(mp); @@ -676,7 +676,7 @@ setuse(td, mp, id, type, addr) if (error) return (error); - error = copyin(addr, (caddr_t)&usage, sizeof (struct dqblk)); + error = copyin(addr, &usage, sizeof (struct dqblk)); if (error) return (error); error = dqget(NULLVP, id, ump, type, &ndq); @@ -882,7 +882,7 @@ dqget(vp, id, ump, type, dqp) dq->dq_type = type; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; - aiov.iov_base = (caddr_t)&dq->dq_dqb; + aiov.iov_base = &dq->dq_dqb; aiov.iov_len = sizeof (struct dqblk); auio.uio_resid = sizeof (struct dqblk); auio.uio_offset = (off_t)(id * sizeof (struct dqblk)); @@ -891,7 +891,7 @@ dqget(vp, id, ump, type, dqp) auio.uio_td = (struct thread *)0; error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]); if (auio.uio_resid == sizeof(struct dqblk) && error == 0) - bzero((caddr_t)&dq->dq_dqb, sizeof(struct dqblk)); + bzero(&dq->dq_dqb, sizeof(struct dqblk)); if (vp != dqvp) VOP_UNLOCK(dqvp, 0, td); if (dq->dq_flags & DQ_WANT) @@ -994,7 +994,7 @@ dqsync(vp, dq) dq->dq_flags |= DQ_LOCK; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; - aiov.iov_base = (caddr_t)&dq->dq_dqb; + aiov.iov_base = &dq->dq_dqb; aiov.iov_len = sizeof (struct dqblk); auio.uio_resid = sizeof (struct dqblk); auio.uio_offset = (off_t)(dq->dq_id * sizeof (struct dqblk)); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index ff81bf8..8fdf71f 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -90,7 +90,7 @@ ufs_quotactl(mp, cmds, uid, arg, td) struct mount *mp; int cmds; uid_t uid; - caddr_t arg; + void *arg; struct thread *td; { #ifndef QUOTA -- cgit v1.1