From cd72f2180bfff020d03180e6eba1c3a0e0125468 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 12 Jan 2003 01:37:13 +0000 Subject: 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. --- sys/dev/streams/streams.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/streams') diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c index e1f4ae81d3da3..039930e4287c7 100644 --- a/sys/dev/streams/streams.c +++ b/sys/dev/streams/streams.c @@ -274,7 +274,7 @@ streamsopen(dev_t dev, int oflags, int devtype, struct thread *td) } FILEDESC_LOCK(p->p_fd); - fp->f_data = (caddr_t)so; + fp->un_data.socket = so; fp->f_flag = FREAD|FWRITE; fp->f_ops = &svr4_netops; fp->f_type = DTYPE_SOCKET; @@ -357,7 +357,7 @@ svr4_stream_get(fp) if (fp == NULL || fp->f_type != DTYPE_SOCKET) return NULL; - so = (struct socket *) fp->f_data; + so = fp->un_data.socket; /* * mpfixme: lock socketbuffer here @@ -395,7 +395,7 @@ svr4_delete_socket(p, fp) struct file *fp; { struct svr4_sockcache_entry *e; - void *cookie = ((struct socket *) fp->f_data)->so_emuldata; + void *cookie = fp->un_data.socket->so_emuldata; while (svr4_str_initialized != 2) { if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) { @@ -418,7 +418,7 @@ svr4_delete_socket(p, fp) static int svr4_soo_close(struct file *fp, struct thread *td) { - struct socket *so = (struct socket *)fp->f_data; + struct socket *so = fp->un_data.socket; /* CHECKUNIT_DIAG(ENXIO);*/ -- cgit v1.3