summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2003-01-12 01:37:13 +0000
committerdillon <dillon@FreeBSD.org>2003-01-12 01:37:13 +0000
commitddf9ef103e0a611c9a01425a28baf8a612b0d114 (patch)
tree19da0d56c468b8e0f6d0361d7d39157f561aa69f /sys/kern/sys_pipe.c
parent07cbccc353d7afbe8948b6025965ca36739d7373 (diff)
downloadFreeBSD-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/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 65d41e9..84ce363 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -238,7 +238,7 @@ pipe(td, uap)
FILE_LOCK(rf);
rf->f_flag = FREAD | FWRITE;
rf->f_type = DTYPE_PIPE;
- rf->f_data = rpipe;
+ rf->un_data.pipe = rpipe;
rf->f_ops = &pipeops;
FILE_UNLOCK(rf);
error = falloc(td, &wf, &fd);
@@ -259,7 +259,7 @@ pipe(td, uap)
FILE_LOCK(wf);
wf->f_flag = FREAD | FWRITE;
wf->f_type = DTYPE_PIPE;
- wf->f_data = wpipe;
+ wf->un_data.pipe = wpipe;
wf->f_ops = &pipeops;
FILE_UNLOCK(wf);
td->td_retval[1] = fd;
@@ -452,7 +452,7 @@ pipe_read(fp, uio, active_cred, flags, td)
struct thread *td;
int flags;
{
- struct pipe *rpipe = (struct pipe *) fp->f_data;
+ struct pipe *rpipe = fp->un_data.pipe;
int error;
int nread = 0;
u_int size;
@@ -868,7 +868,7 @@ pipe_write(fp, uio, active_cred, flags, td)
int orig_resid;
struct pipe *wpipe, *rpipe;
- rpipe = (struct pipe *) fp->f_data;
+ rpipe = fp->un_data.pipe;
wpipe = rpipe->pipe_peer;
PIPE_LOCK(rpipe);
@@ -1155,7 +1155,7 @@ pipe_ioctl(fp, cmd, data, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct pipe *mpipe = (struct pipe *)fp->f_data;
+ struct pipe *mpipe = fp->un_data.pipe;
#ifdef MAC
int error;
#endif
@@ -1223,7 +1223,7 @@ pipe_poll(fp, events, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct pipe *rpipe = (struct pipe *)fp->f_data;
+ struct pipe *rpipe = fp->un_data.pipe;
struct pipe *wpipe;
int revents = 0;
#ifdef MAC
@@ -1284,7 +1284,7 @@ pipe_stat(fp, ub, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct pipe *pipe = (struct pipe *)fp->f_data;
+ struct pipe *pipe = fp->un_data.pipe;
#ifdef MAC
int error;
@@ -1317,10 +1317,10 @@ pipe_close(fp, td)
struct file *fp;
struct thread *td;
{
- struct pipe *cpipe = (struct pipe *)fp->f_data;
+ struct pipe *cpipe = fp->un_data.pipe;
fp->f_ops = &badfileops;
- fp->f_data = NULL;
+ fp->un_data.pipe = NULL;
funsetown(&cpipe->pipe_sigio);
pipeclose(cpipe);
return (0);
@@ -1428,7 +1428,7 @@ pipe_kqfilter(struct file *fp, struct knote *kn)
{
struct pipe *cpipe;
- cpipe = (struct pipe *)kn->kn_fp->f_data;
+ cpipe = kn->kn_fp->un_data.pipe;
switch (kn->kn_filter) {
case EVFILT_READ:
kn->kn_fop = &pipe_rfiltops;
@@ -1465,7 +1465,7 @@ filt_pipedetach(struct knote *kn)
static int
filt_piperead(struct knote *kn, long hint)
{
- struct pipe *rpipe = (struct pipe *)kn->kn_fp->f_data;
+ struct pipe *rpipe = kn->kn_fp->un_data.pipe;
struct pipe *wpipe = rpipe->pipe_peer;
PIPE_LOCK(rpipe);
@@ -1487,7 +1487,7 @@ filt_piperead(struct knote *kn, long hint)
static int
filt_pipewrite(struct knote *kn, long hint)
{
- struct pipe *rpipe = (struct pipe *)kn->kn_fp->f_data;
+ struct pipe *rpipe = kn->kn_fp->un_data.pipe;
struct pipe *wpipe = rpipe->pipe_peer;
PIPE_LOCK(rpipe);
OpenPOWER on IntegriCloud