diff options
author | dillon <dillon@FreeBSD.org> | 2003-01-13 00:33:17 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2003-01-13 00:33:17 +0000 |
commit | ccd5574cc6e61b8fbf6b5ed907375f42e19b54f8 (patch) | |
tree | ee3c8690226ac4a086122b794c975aab9319b671 /sys/kern/kern_descrip.c | |
parent | fe540b81bb4ea3115544cd0f082b4ecd39cebb62 (diff) | |
download | FreeBSD-src-ccd5574cc6e61b8fbf6b5ed907375f42e19b54f8.zip FreeBSD-src-ccd5574cc6e61b8fbf6b5ed907375f42e19b54f8.tar.gz |
Bow to the whining masses and change a union back into void *. Retain
removal of unnecessary casts and throw in some minor cleanups to see if
anyone complains, just for the hell of it.
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index c11762b..cf802ab 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -355,7 +355,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) */ fhold(fp); FILEDESC_UNLOCK(fdp); - vp = fp->un_data.vnode; + vp = fp->f_data; switch (flp->l_type) { case F_RDLCK: @@ -420,7 +420,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) */ fhold(fp); FILEDESC_UNLOCK(fdp); - vp = fp->un_data.vnode; + vp = fp->f_data; error = VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_GETLK, flp, F_POSIX); fdrop(fp, td); @@ -979,7 +979,7 @@ fpathconf(td, uap) break; case DTYPE_FIFO: case DTYPE_VNODE: - vp = fp->un_data.vnode; + vp = fp->f_data; mtx_lock(&Giant); error = VOP_PATHCONF(vp, uap->name, td->td_retval); mtx_unlock(&Giant); @@ -1424,7 +1424,7 @@ static int is_unsafe(struct file *fp) { if (fp->f_type == DTYPE_VNODE) { - struct vnode *vp = fp->un_data.vnode; + struct vnode *vp = fp->f_data; if ((vp->v_vflag & VV_PROCDEP) != 0) return (1); @@ -1582,7 +1582,7 @@ fdcheckstd(td) break; } NDFREE(&nd, NDF_ONLY_PNBUF); - fp->un_data.vnode = nd.ni_vp; + fp->f_data = nd.ni_vp; fp->f_flag = flags; fp->f_ops = &vnops; fp->f_type = DTYPE_VNODE; @@ -1627,7 +1627,7 @@ closef(fp, td) lf.l_start = 0; lf.l_len = 0; lf.l_type = F_UNLCK; - vp = fp->un_data.vnode; + vp = fp->f_data; (void) VOP_ADVLOCK(vp, (caddr_t)td->td_proc->p_leader, F_UNLCK, &lf, F_POSIX); } @@ -1741,7 +1741,7 @@ _fgetvp(struct thread *td, int fd, struct vnode **vpp, int flags) if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_FIFO) { error = EINVAL; } else { - *vpp = fp->un_data.vnode; + *vpp = fp->f_data; vref(*vpp); } FILEDESC_UNLOCK(td->td_proc->p_fd); @@ -1790,7 +1790,7 @@ fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp) if (fp->f_type != DTYPE_SOCKET) { error = ENOTSOCK; } else { - *spp = fp->un_data.socket; + *spp = fp->f_data; if (fflagp) *fflagp = fp->f_flag; soref(*spp); @@ -1838,7 +1838,7 @@ fdrop_locked(fp, td) lf.l_start = 0; lf.l_len = 0; lf.l_type = F_UNLCK; - vp = fp->un_data.vnode; + vp = fp->f_data; FILE_UNLOCK(fp); (void) VOP_ADVLOCK(vp, (caddr_t)fp, F_UNLCK, &lf, F_FLOCK); } else @@ -1886,7 +1886,7 @@ flock(td, uap) } mtx_lock(&Giant); - vp = fp->un_data.vnode; + vp = fp->f_data; lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; @@ -2110,14 +2110,12 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) continue; xf.xf_fd = n; xf.xf_file = fp; - xf.xun_data.generic = fp->un_data.generic; -#define XF_COPY(field) xf.xf_##field = fp->f_##field - XF_COPY(type); - XF_COPY(count); - XF_COPY(msgcount); - XF_COPY(offset); - XF_COPY(flag); -#undef XF_COPY + xf.xf_data = fp->f_data; + xf.xf_type = fp->f_type; + xf.xf_count = fp->f_count; + xf.xf_msgcount = fp->f_msgcount; + xf.xf_offset = fp->f_offset; + xf.xf_flag = fp->f_flag; error = SYSCTL_OUT(req, &xf, sizeof(xf)); if (error) break; |