summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2003-01-13 00:33:17 +0000
committerdillon <dillon@FreeBSD.org>2003-01-13 00:33:17 +0000
commitccd5574cc6e61b8fbf6b5ed907375f42e19b54f8 (patch)
treeee3c8690226ac4a086122b794c975aab9319b671 /sys/kern
parentfe540b81bb4ea3115544cd0f082b4ecd39cebb62 (diff)
downloadFreeBSD-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')
-rw-r--r--sys/kern/kern_acl.c11
-rw-r--r--sys/kern/kern_descrip.c34
-rw-r--r--sys/kern/kern_event.c20
-rw-r--r--sys/kern/kern_mac.c8
-rw-r--r--sys/kern/subr_acl_posix1e.c11
-rw-r--r--sys/kern/sys_pipe.c24
-rw-r--r--sys/kern/sys_socket.c14
-rw-r--r--sys/kern/uipc_socket.c12
-rw-r--r--sys/kern/uipc_syscalls.c8
-rw-r--r--sys/kern/uipc_usrreq.c6
-rw-r--r--sys/kern/vfs_acl.c11
-rw-r--r--sys/kern/vfs_aio.c12
-rw-r--r--sys/kern/vfs_extattr.c42
-rw-r--r--sys/kern/vfs_syscalls.c42
-rw-r--r--sys/kern/vfs_vnops.c14
15 files changed, 129 insertions, 140 deletions
diff --git a/sys/kern/kern_acl.c b/sys/kern/kern_acl.c
index 1611614..6b9f942 100644
--- a/sys/kern/kern_acl.c
+++ b/sys/kern/kern_acl.c
@@ -780,8 +780,7 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_get_acl(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_get_acl(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -802,8 +801,7 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_set_acl(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_set_acl(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -868,7 +866,7 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_delete(td, fp->un_data.vnode, uap->type);
+ error = vacl_delete(td, fp->f_data, uap->type);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -933,8 +931,7 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_aclcheck(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_aclcheck(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
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;
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index e36fdb4..9ff14a6 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 = kn->kn_fp->un_data.kqueue;
+ struct kqueue *kq = kn->kn_fp->f_data;
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 = kn->kn_fp->un_data.kqueue;
+ struct kqueue *kq = kn->kn_fp->f_data;
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 = kn->kn_fp->un_data.kqueue;
+ struct kqueue *kq = kn->kn_fp->f_data;
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->un_data.kqueue = kq;
+ fp->f_data = 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 = fp->un_data.kqueue;
+ kq = fp->f_data;
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 = fp->un_data.kqueue;
+ kq = fp->f_data;
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 = fp->un_data.kqueue;
+ kq = fp->f_data;
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 = fp->un_data.kqueue;
+ kq = fp->f_data;
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 = fp->un_data.kqueue;
+ struct kqueue *kq = fp->f_data;
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->un_data.kqueue = NULL;
+ fp->f_data = NULL;
return (0);
}
diff --git a/sys/kern/kern_mac.c b/sys/kern/kern_mac.c
index 299ad50..e9d9eeb 100644
--- a/sys/kern/kern_mac.c
+++ b/sys/kern/kern_mac.c
@@ -3211,7 +3211,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
mac_init_vnode_label(&intlabel);
@@ -3221,7 +3221,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
break;
case DTYPE_PIPE:
- pipe = fp->un_data.pipe;
+ pipe = fp->f_data;
mac_init_pipe_label(&intlabel);
@@ -3419,7 +3419,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
@@ -3438,7 +3438,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
mac_init_pipe_label(&intlabel);
error = mac_internalize_pipe_label(&intlabel, buffer);
if (error == 0) {
- pipe = fp->un_data.pipe;
+ pipe = fp->f_data;
PIPE_LOCK(pipe);
error = mac_pipe_label_set(td->td_ucred, pipe,
&intlabel);
diff --git a/sys/kern/subr_acl_posix1e.c b/sys/kern/subr_acl_posix1e.c
index 1611614..6b9f942 100644
--- a/sys/kern/subr_acl_posix1e.c
+++ b/sys/kern/subr_acl_posix1e.c
@@ -780,8 +780,7 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_get_acl(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_get_acl(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -802,8 +801,7 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_set_acl(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_set_acl(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -868,7 +866,7 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_delete(td, fp->un_data.vnode, uap->type);
+ error = vacl_delete(td, fp->f_data, uap->type);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -933,8 +931,7 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_aclcheck(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_aclcheck(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 84ce363..915ee3e 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->un_data.pipe = rpipe;
+ rf->f_data = 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->un_data.pipe = wpipe;
+ wf->f_data = 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 = fp->un_data.pipe;
+ struct pipe *rpipe = fp->f_data;
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 = fp->un_data.pipe;
+ rpipe = fp->f_data;
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 = fp->un_data.pipe;
+ struct pipe *mpipe = fp->f_data;
#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 = fp->un_data.pipe;
+ struct pipe *rpipe = fp->f_data;
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 = fp->un_data.pipe;
+ struct pipe *pipe = fp->f_data;
#ifdef MAC
int error;
@@ -1317,10 +1317,10 @@ pipe_close(fp, td)
struct file *fp;
struct thread *td;
{
- struct pipe *cpipe = fp->un_data.pipe;
+ struct pipe *cpipe = fp->f_data;
fp->f_ops = &badfileops;
- fp->un_data.pipe = NULL;
+ fp->f_data = 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 = kn->kn_fp->un_data.pipe;
+ cpipe = kn->kn_fp->f_data;
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 = kn->kn_fp->un_data.pipe;
+ struct pipe *rpipe = kn->kn_fp->f_data;
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 = kn->kn_fp->un_data.pipe;
+ struct pipe *rpipe = kn->kn_fp->f_data;
struct pipe *wpipe = rpipe->pipe_peer;
PIPE_LOCK(rpipe);
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index c2c3076..9936cd2 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -69,7 +69,7 @@ soo_read(fp, uio, active_cred, flags, td)
struct thread *td;
int flags;
{
- struct socket *so = fp->un_data.socket;
+ struct socket *so = fp->f_data;
int error;
mtx_lock(&Giant);
@@ -94,7 +94,7 @@ soo_write(fp, uio, active_cred, flags, td)
struct thread *td;
int flags;
{
- struct socket *so = fp->un_data.socket;
+ struct socket *so = fp->f_data;
int error;
mtx_lock(&Giant);
@@ -119,7 +119,7 @@ soo_ioctl(fp, cmd, data, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- register struct socket *so = fp->un_data.socket;
+ register struct socket *so = fp->f_data;
switch (cmd) {
@@ -183,7 +183,7 @@ soo_poll(fp, events, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct socket *so = fp->un_data.socket;
+ struct socket *so = fp->f_data;
return so->so_proto->pr_usrreqs->pru_sopoll(so, events,
fp->f_cred, td);
}
@@ -195,7 +195,7 @@ soo_stat(fp, ub, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct socket *so = fp->un_data.socket;
+ struct socket *so = fp->f_data;
bzero((caddr_t)ub, sizeof (*ub));
ub->st_mode = S_IFSOCK;
@@ -229,9 +229,9 @@ soo_close(fp, td)
int error = 0;
struct socket *so;
- so = fp->un_data.socket;
+ so = fp->f_data;
fp->f_ops = &badfileops;
- fp->un_data.socket = 0;
+ fp->f_data = NULL;
if (so)
error = soclose(so);
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index aedcecc..c4d596f 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1735,7 +1735,7 @@ sopoll(struct socket *so, int events, struct ucred *active_cred,
int
soo_kqfilter(struct file *fp, struct knote *kn)
{
- struct socket *so = kn->kn_fp->un_data.socket;
+ struct socket *so = kn->kn_fp->f_data;
struct sockbuf *sb;
int s;
@@ -1765,7 +1765,7 @@ soo_kqfilter(struct file *fp, struct knote *kn)
static void
filt_sordetach(struct knote *kn)
{
- struct socket *so = kn->kn_fp->un_data.socket;
+ struct socket *so = kn->kn_fp->f_data;
int s = splnet();
SLIST_REMOVE(&so->so_rcv.sb_sel.si_note, kn, knote, kn_selnext);
@@ -1778,7 +1778,7 @@ filt_sordetach(struct knote *kn)
static int
filt_soread(struct knote *kn, long hint)
{
- struct socket *so = kn->kn_fp->un_data.socket;
+ struct socket *so = kn->kn_fp->f_data;
kn->kn_data = so->so_rcv.sb_cc - so->so_rcv.sb_ctl;
if (so->so_state & SS_CANTRCVMORE) {
@@ -1796,7 +1796,7 @@ filt_soread(struct knote *kn, long hint)
static void
filt_sowdetach(struct knote *kn)
{
- struct socket *so = kn->kn_fp->un_data.socket;
+ struct socket *so = kn->kn_fp->f_data;
int s = splnet();
SLIST_REMOVE(&so->so_snd.sb_sel.si_note, kn, knote, kn_selnext);
@@ -1809,7 +1809,7 @@ filt_sowdetach(struct knote *kn)
static int
filt_sowrite(struct knote *kn, long hint)
{
- struct socket *so = kn->kn_fp->un_data.socket;
+ struct socket *so = kn->kn_fp->f_data;
kn->kn_data = sbspace(&so->so_snd);
if (so->so_state & SS_CANTSENDMORE) {
@@ -1831,7 +1831,7 @@ filt_sowrite(struct knote *kn, long hint)
static int
filt_solisten(struct knote *kn, long hint)
{
- struct socket *so = kn->kn_fp->un_data.socket;
+ struct socket *so = kn->kn_fp->f_data;
kn->kn_data = so->so_qlen;
return (! TAILQ_EMPTY(&so->so_comp));
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index c0ffa9d..2bd0c9f0 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -141,7 +141,7 @@ socket(td, uap)
} else
FILEDESC_UNLOCK(fdp);
} else {
- fp->un_data.socket = so; /* already has ref count */
+ fp->f_data = so; /* already has ref count */
fp->f_flag = FREAD|FWRITE;
fp->f_ops = &socketops;
fp->f_type = DTYPE_SOCKET;
@@ -329,7 +329,7 @@ accept1(td, uap, compat)
FILE_LOCK(nfp);
soref(so); /* file descriptor reference */
- nfp->un_data.socket = so; /* nfp has ref count from falloc */
+ nfp->f_data = so; /* nfp has ref count from falloc */
nfp->f_flag = fflag;
nfp->f_ops = &socketops;
nfp->f_type = DTYPE_SOCKET;
@@ -524,12 +524,12 @@ socketpair(td, uap)
goto free2;
fhold(fp1);
sv[0] = fd;
- fp1->un_data.socket = so1; /* so1 already has ref count */
+ fp1->f_data = so1; /* so1 already has ref count */
error = falloc(td, &fp2, &fd);
if (error)
goto free3;
fhold(fp2);
- fp2->un_data.socket = so2; /* so2 already has ref count */
+ fp2->f_data = so2; /* so2 already has ref count */
sv[1] = fd;
error = soconnect2(so1, so2);
if (error)
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 6846352..04b4c6d 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1305,7 +1305,7 @@ unp_gc()
* Now check if it is possibly one of OUR sockets.
*/
if (fp->f_type != DTYPE_SOCKET ||
- (so = fp->un_data.socket) == 0) {
+ (so = fp->f_data) == NULL) {
FILE_UNLOCK(fp);
continue;
}
@@ -1413,9 +1413,9 @@ unp_gc()
struct file *tfp = *fpp;
FILE_LOCK(tfp);
if (tfp->f_type == DTYPE_SOCKET &&
- tfp->un_data.socket != NULL) {
+ tfp->f_data != NULL) {
FILE_UNLOCK(tfp);
- sorflush(tfp->un_data.socket);
+ sorflush(tfp->f_data);
} else
FILE_UNLOCK(tfp);
}
diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c
index 1611614..6b9f942 100644
--- a/sys/kern/vfs_acl.c
+++ b/sys/kern/vfs_acl.c
@@ -780,8 +780,7 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_get_acl(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_get_acl(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -802,8 +801,7 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_set_acl(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_set_acl(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -868,7 +866,7 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_delete(td, fp->un_data.vnode, uap->type);
+ error = vacl_delete(td, fp->f_data, uap->type);
fdrop(fp, td);
}
mtx_unlock(&Giant);
@@ -933,8 +931,7 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap)
mtx_lock(&Giant);
error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
if (error == 0) {
- error = vacl_aclcheck(td, fp->un_data.vnode,
- uap->type, uap->aclp);
+ error = vacl_aclcheck(td, fp->f_data, uap->type, uap->aclp);
fdrop(fp, td);
}
mtx_unlock(&Giant);
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 23e49d5..4bf8724 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -555,7 +555,7 @@ aio_proc_rundown(struct proc *p)
aiocbn = TAILQ_NEXT(aiocbe, plist);
fp = aiocbe->fd_file;
if (fp != NULL) {
- so = fp->un_data.socket;
+ so = fp->f_data;
TAILQ_REMOVE(&so->so_aiojobq, aiocbe, list);
if (TAILQ_EMPTY(&so->so_aiojobq)) {
so->so_snd.sb_flags &= ~SB_AIO;
@@ -1059,7 +1059,7 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
if (fp->f_type != DTYPE_VNODE)
return (-1);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
/*
* If its not a disk, we don't want to return a positive error.
@@ -1406,7 +1406,7 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ
error = EBADF;
goto aqueue_fail;
}
- kq = kq_fp->un_data.kqueue;
+ kq = kq_fp->f_data;
kev.ident = (uintptr_t)aiocbe->uuaiocb;
kev.filter = EVFILT_AIO;
kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1;
@@ -1441,7 +1441,7 @@ no_kqueue:
* socket, and set the flags so we get a call when sbnotify()
* happens.
*/
- so = fp->un_data.socket;
+ so = fp->f_data;
s = splnet();
if (((opcode == LIO_READ) && (!soreadable(so))) || ((opcode ==
LIO_WRITE) && (!sowriteable(so)))) {
@@ -1731,14 +1731,14 @@ aio_cancel(struct thread *td, struct aio_cancel_args *uap)
return (EBADF);
if (fp->f_type == DTYPE_VNODE) {
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if (vn_isdisk(vp,&error)) {
td->td_retval[0] = AIO_NOTCANCELED;
return 0;
}
} else if (fp->f_type == DTYPE_SOCKET) {
- so = fp->un_data.socket;
+ so = fp->f_data;
s = splnet();
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 0948c31..432ebed 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -278,7 +278,7 @@ fstatfs(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- mp = (fp->un_data.vnode)->v_mount;
+ mp = ((struct vnode *)fp->f_data)->v_mount;
fdrop(fp, td);
if (mp == NULL)
return (EBADF);
@@ -399,7 +399,7 @@ fchdir(td, uap)
if ((error = getvnode(fdp, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
VREF(vp);
fdrop(fp, td);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
@@ -492,7 +492,7 @@ chroot_refuse_vdir_fds(fdp)
if (fp == NULL)
continue;
if (fp->f_type == DTYPE_VNODE) {
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if (vp->v_type == VDIR)
return (EPERM);
}
@@ -724,7 +724,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
("open: vmio vnode has no backing object after vn_open"));
- fp->un_data.vnode = vp;
+ fp->f_data = vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE);
@@ -1319,7 +1319,7 @@ lseek(td, uap)
fdrop(fp, td);
return (ESPIPE);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
noneg = (vp->v_type != VCHR);
offset = uap->offset;
switch (uap->whence) {
@@ -2032,7 +2032,7 @@ fchflags(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- error = setfflags(td, fp->un_data.vnode, uap->flags);
+ error = setfflags(td, fp->f_data, uap->flags);
fdrop(fp, td);
return (error);
}
@@ -2157,8 +2157,8 @@ fchmod(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
- error = setfmode(td, fp->un_data.vnode, uap->mode);
+ vp = fp->f_data;
+ error = setfmode(td, fp->f_data, uap->mode);
fdrop(fp, td);
return (error);
}
@@ -2301,8 +2301,8 @@ fchown(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
- error = setfown(td, fp->un_data.vnode, uap->uid, uap->gid);
+ vp = fp->f_data;
+ error = setfown(td, fp->f_data, uap->uid, uap->gid);
fdrop(fp, td);
return (error);
}
@@ -2500,7 +2500,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr,
return (error);
if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0)
return (error);
- error = setutimes(td, fp->un_data.vnode, ts, 2, tptr == NULL);
+ error = setutimes(td, fp->f_data, ts, 2, tptr == NULL);
fdrop(fp, td);
return (error);
}
@@ -2602,7 +2602,7 @@ ftruncate(td, uap)
fdrop(fp, td);
return (EINVAL);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) {
fdrop(fp, td);
return (error);
@@ -2713,7 +2713,7 @@ fsync(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) {
fdrop(fp, td);
return (error);
@@ -3074,7 +3074,7 @@ ogetdirentries(td, uap)
fdrop(fp, td);
return (EBADF);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
unionread:
if (vp->v_type != VDIR) {
fdrop(fp, td);
@@ -3174,7 +3174,7 @@ unionread:
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
- fp->un_data.vnode = vp;
+ fp->f_data = vp;
fp->f_offset = 0;
vput(tvp);
goto unionread;
@@ -3222,7 +3222,7 @@ getdirentries(td, uap)
fdrop(fp, td);
return (EBADF);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
unionread:
if (vp->v_type != VDIR) {
fdrop(fp, td);
@@ -3271,7 +3271,7 @@ unionread:
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
- fp->un_data.vnode = vp;
+ fp->f_data = vp;
fp->f_offset = 0;
vput(tvp);
goto unionread;
@@ -3624,7 +3624,7 @@ fhopen(td, uap)
* from under us while we block in the lock op
*/
fhold(fp);
- nfp->un_data.vnode = vp;
+ nfp->f_data = vp;
nfp->f_flag = fmode & FMASK;
nfp->f_ops = &vnops;
nfp->f_type = DTYPE_VNODE;
@@ -3945,7 +3945,7 @@ extattr_set_fd(td, uap)
if (error)
return (error);
- error = extattr_set_vp(fp->un_data.vnode, uap->attrnamespace,
+ error = extattr_set_vp(fp->f_data, uap->attrnamespace,
attrname, uap->data, uap->nbytes, td);
fdrop(fp, td);
@@ -4109,7 +4109,7 @@ extattr_get_fd(td, uap)
if (error)
return (error);
- error = extattr_get_vp(fp->un_data.vnode, uap->attrnamespace,
+ error = extattr_get_vp(fp->f_data, uap->attrnamespace,
attrname, uap->data, uap->nbytes, td);
fdrop(fp, td);
@@ -4241,7 +4241,7 @@ extattr_delete_fd(td, uap)
error = getvnode(td->td_proc->p_fd, uap->fd, &fp);
if (error)
return (error);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
error = extattr_delete_vp(vp, uap->attrnamespace, attrname, td);
fdrop(fp, td);
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 0948c31..432ebed 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -278,7 +278,7 @@ fstatfs(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- mp = (fp->un_data.vnode)->v_mount;
+ mp = ((struct vnode *)fp->f_data)->v_mount;
fdrop(fp, td);
if (mp == NULL)
return (EBADF);
@@ -399,7 +399,7 @@ fchdir(td, uap)
if ((error = getvnode(fdp, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
VREF(vp);
fdrop(fp, td);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
@@ -492,7 +492,7 @@ chroot_refuse_vdir_fds(fdp)
if (fp == NULL)
continue;
if (fp->f_type == DTYPE_VNODE) {
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if (vp->v_type == VDIR)
return (EPERM);
}
@@ -724,7 +724,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
("open: vmio vnode has no backing object after vn_open"));
- fp->un_data.vnode = vp;
+ fp->f_data = vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE);
@@ -1319,7 +1319,7 @@ lseek(td, uap)
fdrop(fp, td);
return (ESPIPE);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
noneg = (vp->v_type != VCHR);
offset = uap->offset;
switch (uap->whence) {
@@ -2032,7 +2032,7 @@ fchflags(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- error = setfflags(td, fp->un_data.vnode, uap->flags);
+ error = setfflags(td, fp->f_data, uap->flags);
fdrop(fp, td);
return (error);
}
@@ -2157,8 +2157,8 @@ fchmod(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
- error = setfmode(td, fp->un_data.vnode, uap->mode);
+ vp = fp->f_data;
+ error = setfmode(td, fp->f_data, uap->mode);
fdrop(fp, td);
return (error);
}
@@ -2301,8 +2301,8 @@ fchown(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
- error = setfown(td, fp->un_data.vnode, uap->uid, uap->gid);
+ vp = fp->f_data;
+ error = setfown(td, fp->f_data, uap->uid, uap->gid);
fdrop(fp, td);
return (error);
}
@@ -2500,7 +2500,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr,
return (error);
if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0)
return (error);
- error = setutimes(td, fp->un_data.vnode, ts, 2, tptr == NULL);
+ error = setutimes(td, fp->f_data, ts, 2, tptr == NULL);
fdrop(fp, td);
return (error);
}
@@ -2602,7 +2602,7 @@ ftruncate(td, uap)
fdrop(fp, td);
return (EINVAL);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) {
fdrop(fp, td);
return (error);
@@ -2713,7 +2713,7 @@ fsync(td, uap)
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
return (error);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) {
fdrop(fp, td);
return (error);
@@ -3074,7 +3074,7 @@ ogetdirentries(td, uap)
fdrop(fp, td);
return (EBADF);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
unionread:
if (vp->v_type != VDIR) {
fdrop(fp, td);
@@ -3174,7 +3174,7 @@ unionread:
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
- fp->un_data.vnode = vp;
+ fp->f_data = vp;
fp->f_offset = 0;
vput(tvp);
goto unionread;
@@ -3222,7 +3222,7 @@ getdirentries(td, uap)
fdrop(fp, td);
return (EBADF);
}
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
unionread:
if (vp->v_type != VDIR) {
fdrop(fp, td);
@@ -3271,7 +3271,7 @@ unionread:
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
- fp->un_data.vnode = vp;
+ fp->f_data = vp;
fp->f_offset = 0;
vput(tvp);
goto unionread;
@@ -3624,7 +3624,7 @@ fhopen(td, uap)
* from under us while we block in the lock op
*/
fhold(fp);
- nfp->un_data.vnode = vp;
+ nfp->f_data = vp;
nfp->f_flag = fmode & FMASK;
nfp->f_ops = &vnops;
nfp->f_type = DTYPE_VNODE;
@@ -3945,7 +3945,7 @@ extattr_set_fd(td, uap)
if (error)
return (error);
- error = extattr_set_vp(fp->un_data.vnode, uap->attrnamespace,
+ error = extattr_set_vp(fp->f_data, uap->attrnamespace,
attrname, uap->data, uap->nbytes, td);
fdrop(fp, td);
@@ -4109,7 +4109,7 @@ extattr_get_fd(td, uap)
if (error)
return (error);
- error = extattr_get_vp(fp->un_data.vnode, uap->attrnamespace,
+ error = extattr_get_vp(fp->f_data, uap->attrnamespace,
attrname, uap->data, uap->nbytes, td);
fdrop(fp, td);
@@ -4241,7 +4241,7 @@ extattr_delete_fd(td, uap)
error = getvnode(td->td_proc->p_fd, uap->fd, &fp);
if (error)
return (error);
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
error = extattr_delete_vp(vp, uap->attrnamespace, attrname, td);
fdrop(fp, td);
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 67a4abf..7891dc6 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -502,7 +502,7 @@ vn_read(fp, uio, active_cred, flags, td)
mtx_lock(&Giant);
KASSERT(uio->uio_td == td, ("uio_td %p is not td %p",
uio->uio_td, td));
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
ioflag = 0;
if (fp->f_flag & FNONBLOCK)
ioflag |= IO_NDELAY;
@@ -550,7 +550,7 @@ vn_write(fp, uio, active_cred, flags, td)
mtx_lock(&Giant);
KASSERT(uio->uio_td == td, ("uio_td %p is not td %p",
uio->uio_td, td));
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
if (vp->v_type == VREG)
bwillwrite();
ioflag = IO_UNIT;
@@ -598,7 +598,7 @@ vn_statfile(fp, sb, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct vnode *vp = fp->un_data.vnode;
+ struct vnode *vp = fp->f_data;
int error;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
@@ -741,7 +741,7 @@ vn_ioctl(fp, com, data, active_cred, td)
struct ucred *active_cred;
struct thread *td;
{
- struct vnode *vp = fp->un_data.vnode;
+ struct vnode *vp = fp->f_data;
struct vnode *vpold;
struct vattr vattr;
int error;
@@ -823,7 +823,7 @@ vn_poll(fp, events, active_cred, td)
int error;
#endif
- vp = fp->un_data.vnode;
+ vp = fp->f_data;
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
error = mac_check_vnode_poll(active_cred, fp->f_cred, vp);
@@ -891,7 +891,7 @@ vn_closefile(fp, td)
{
fp->f_ops = &badfileops;
- return (vn_close(fp->un_data.vnode, fp->f_flag, fp->f_cred, td));
+ return (vn_close(fp->f_data, fp->f_flag, fp->f_cred, td));
}
/*
@@ -1042,7 +1042,7 @@ static int
vn_kqfilter(struct file *fp, struct knote *kn)
{
- return (VOP_KQFILTER(fp->un_data.vnode, kn));
+ return (VOP_KQFILTER(fp->f_data, kn));
}
/*
OpenPOWER on IntegriCloud