diff options
author | dillon <dillon@FreeBSD.org> | 2003-01-12 01:37:13 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2003-01-12 01:37:13 +0000 |
commit | ddf9ef103e0a611c9a01425a28baf8a612b0d114 (patch) | |
tree | 19da0d56c468b8e0f6d0361d7d39157f561aa69f /sys/compat | |
parent | 07cbccc353d7afbe8948b6025965ca36739d7373 (diff) | |
download | FreeBSD-src-ddf9ef103e0a611c9a01425a28baf8a612b0d114.zip FreeBSD-src-ddf9ef103e0a611c9a01425a28baf8a612b0d114.tar.gz |
Change struct file f_data to un_data, a union of the correct struct
pointer types, and remove a huge number of casts from code using it.
Change struct xfile xf_data to xun_data (ABI is still compatible).
If we need to add a #define for f_data and xf_data we can, but I don't
think it will be necessary. There are no operational changes in this
commit.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_file.c | 2 | ||||
-rw-r--r-- | sys/compat/linux/linux_stats.c | 2 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_fcntl.c | 2 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_filio.c | 2 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_ioctl.c | 4 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 6 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_socket.c | 2 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stream.c | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 3cf3bc5..1058d49 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -270,7 +270,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args, return (EBADF); } - vp = (struct vnode *) fp->f_data; + vp = fp->un_data.vnode; if (vp->v_type != VDIR) { fdrop(fp, td); return (EINVAL); diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index d02186f..712d914 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -289,7 +289,7 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args) error = getvnode(td->td_proc->p_fd, args->fd, &fp); if (error) return error; - mp = ((struct vnode *)fp->f_data)->v_mount; + mp = fp->un_data.vnode->v_mount; #ifdef MAC error = mac_check_mount_stat(td->td_proc->p_ucred, mp); if (error) { diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index 60d5edf..d41192b 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -311,7 +311,7 @@ fd_truncate(td, fd, flp) if ((error = fget(td, fd, &fp)) != 0) return (error); - vp = (struct vnode *) fp->f_data; + vp = fp->un_data.vnode; if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) { fdrop(fp, td); diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c index f4b0950..dbbdfdb 100644 --- a/sys/compat/svr4/svr4_filio.c +++ b/sys/compat/svr4/svr4_filio.c @@ -115,7 +115,7 @@ svr4_sys_read(td, uap) } if (fp->f_type == DTYPE_SOCKET) { - so = (struct socket *)fp->f_data; + so = fp->un_data.socket; DPRINTF(("fd %d is a socket\n", uap->fd)); if (so->so_state & SS_ASYNC) { DPRINTF(("fd %d is an ASYNC socket!\n", uap->fd)); diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index cabfcb3..51334bc 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -112,7 +112,7 @@ svr4_sys_ioctl(td, uap) #if defined(DEBUG_SVR4) if (fp->f_type == DTYPE_SOCKET) { - struct socket *so = (struct socket *)fp->f_data; + struct socket *so = fp->un_data.socket; DPRINTF(("<<< IN: so_state = 0x%x\n", so->so_state)); } #endif @@ -157,7 +157,7 @@ svr4_sys_ioctl(td, uap) if (fp->f_type == DTYPE_SOCKET) { struct socket *so; - so = (struct socket *)fp->f_data; + so = fp->un_data.socket; DPRINTF((">>> OUT: so_state = 0x%x\n", so->so_state)); } #endif diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index d7a30e9..9f9d7e5 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -271,7 +271,7 @@ svr4_sys_getdents64(td, uap) return (EBADF); } - vp = (struct vnode *) fp->f_data; + vp = fp->un_data.vnode; if (vp->v_type != VDIR) { fdrop(fp, td); @@ -451,7 +451,7 @@ svr4_sys_getdents(td, uap) return (EBADF); } - vp = (struct vnode *)fp->f_data; + vp = fp->un_data.vnode; if (vp->v_type != VDIR) { fdrop(fp, td); return (EINVAL); @@ -627,7 +627,7 @@ svr4_sys_fchroot(td, uap) return error; if ((error = getvnode(fdp, uap->fd, &fp)) != 0) return error; - vp = (struct vnode *) fp->f_data; + vp = fp->un_data.vnode; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); if (vp->v_type != VDIR) error = ENOTDIR; diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c index bea6306..a2c49b4 100644 --- a/sys/compat/svr4/svr4_socket.c +++ b/sys/compat/svr4/svr4_socket.c @@ -82,7 +82,7 @@ svr4_find_socket(td, fp, dev, ino) ino_t ino; { struct svr4_sockcache_entry *e; - void *cookie = ((struct socket *) fp->f_data)->so_emuldata; + void *cookie = fp->un_data.socket->so_emuldata; if (svr4_str_initialized != 2) { if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) { diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index ea75ba7..ae885ed 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -644,7 +644,7 @@ getparm(fp, pa) if (st == NULL) return; - so = (struct socket *) fp->f_data; + so = fp->un_data.socket; pa->family = st->s_family; |