summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.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/vfs_vnops.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/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 8929705..67a4abf 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 = (struct vnode *)fp->f_data;
+ vp = fp->un_data.vnode;
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 = (struct vnode *)fp->f_data;
+ vp = fp->un_data.vnode;
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 = (struct vnode *)fp->f_data;
+ struct vnode *vp = fp->un_data.vnode;
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;
{
- register struct vnode *vp = ((struct vnode *)fp->f_data);
+ struct vnode *vp = fp->un_data.vnode;
struct vnode *vpold;
struct vattr vattr;
int error;
@@ -823,7 +823,7 @@ vn_poll(fp, events, active_cred, td)
int error;
#endif
- vp = (struct vnode *)fp->f_data;
+ vp = fp->un_data.vnode;
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
error = mac_check_vnode_poll(active_cred, fp->f_cred, vp);
@@ -891,8 +891,7 @@ vn_closefile(fp, td)
{
fp->f_ops = &badfileops;
- return (vn_close(((struct vnode *)fp->f_data), fp->f_flag,
- fp->f_cred, td));
+ return (vn_close(fp->un_data.vnode, fp->f_flag, fp->f_cred, td));
}
/*
@@ -1043,7 +1042,7 @@ static int
vn_kqfilter(struct file *fp, struct knote *kn)
{
- return (VOP_KQFILTER(((struct vnode *)fp->f_data), kn));
+ return (VOP_KQFILTER(fp->un_data.vnode, kn));
}
/*
OpenPOWER on IntegriCloud