summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_event.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/kern_event.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/kern_event.c')
-rw-r--r--sys/kern/kern_event.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index a6d0eb1..e36fdb4 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -157,7 +157,7 @@ filt_fileattach(struct knote *kn)
static int
kqueue_kqfilter(struct file *fp, struct knote *kn)
{
- struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
+ struct kqueue *kq = kn->kn_fp->un_data.kqueue;
if (kn->kn_filter != EVFILT_READ)
return (1);
@@ -170,7 +170,7 @@ kqueue_kqfilter(struct file *fp, struct knote *kn)
static void
filt_kqdetach(struct knote *kn)
{
- struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
+ struct kqueue *kq = kn->kn_fp->un_data.kqueue;
SLIST_REMOVE(&kq->kq_sel.si_note, kn, knote, kn_selnext);
}
@@ -179,7 +179,7 @@ filt_kqdetach(struct knote *kn)
static int
filt_kqueue(struct knote *kn, long hint)
{
- struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
+ struct kqueue *kq = kn->kn_fp->un_data.kqueue;
kn->kn_data = kq->kq_count;
return (kn->kn_data > 0);
@@ -378,7 +378,7 @@ kqueue(struct thread *td, struct kqueue_args *uap)
fp->f_type = DTYPE_KQUEUE;
fp->f_ops = &kqueueops;
TAILQ_INIT(&kq->kq_head);
- fp->f_data = kq;
+ fp->un_data.kqueue = kq;
FILE_UNLOCK(fp);
FILEDESC_LOCK(fdp);
td->td_retval[0] = fd;
@@ -427,7 +427,7 @@ kevent(struct thread *td, struct kevent_args *uap)
}
mtx_lock(&Giant);
- kq = (struct kqueue *)fp->f_data;
+ kq = fp->un_data.kqueue;
nerrors = 0;
while (uap->nchanges > 0) {
@@ -650,7 +650,7 @@ kqueue_scan(struct file *fp, int maxevents, struct kevent *ulistp,
FILE_LOCK_ASSERT(fp, MA_NOTOWNED);
- kq = (struct kqueue *)fp->f_data;
+ kq = fp->un_data.kqueue;
count = maxevents;
if (count == 0)
goto done;
@@ -806,7 +806,7 @@ kqueue_poll(struct file *fp, int events, struct ucred *active_cred,
int revents = 0;
int s = splnet();
- kq = (struct kqueue *)fp->f_data;
+ kq = fp->un_data.kqueue;
if (events & (POLLIN | POLLRDNORM)) {
if (kq->kq_count) {
revents |= events & (POLLIN | POLLRDNORM);
@@ -826,7 +826,7 @@ kqueue_stat(struct file *fp, struct stat *st, struct ucred *active_cred,
{
struct kqueue *kq;
- kq = (struct kqueue *)fp->f_data;
+ kq = fp->un_data.kqueue;
bzero((void *)st, sizeof(*st));
st->st_size = kq->kq_count;
st->st_blksize = sizeof(struct kevent);
@@ -838,7 +838,7 @@ kqueue_stat(struct file *fp, struct stat *st, struct ucred *active_cred,
static int
kqueue_close(struct file *fp, struct thread *td)
{
- struct kqueue *kq = (struct kqueue *)fp->f_data;
+ struct kqueue *kq = fp->un_data.kqueue;
struct filedesc *fdp = td->td_proc->p_fd;
struct knote **knp, *kn, *kn0;
int i;
@@ -885,7 +885,7 @@ kqueue_close(struct file *fp, struct thread *td)
}
FILEDESC_UNLOCK(fdp);
free(kq, M_KQUEUE);
- fp->f_data = NULL;
+ fp->un_data.kqueue = NULL;
return (0);
}
OpenPOWER on IntegriCloud