From c81c59299bd255eb5ab7510c9e84e9c54b8003d0 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 22 Jun 2003 08:41:43 +0000 Subject: Add a f_vnode field to struct file. Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work. --- sys/i386/ibcs2/ibcs2_misc.c | 4 ++-- sys/i386/ibcs2/ibcs2_stat.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/i386/ibcs2') diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 013b757..8cd3488 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -324,7 +324,7 @@ ibcs2_getdents(td, uap) fdrop(fp, td); return (EBADF); } - vp = fp->f_data; + vp = fp->f_vnode; if (vp->v_type != VDIR) { /* XXX vnode readdir op should do this */ fdrop(fp, td); return (EINVAL); @@ -481,7 +481,7 @@ ibcs2_read(td, uap) fdrop(fp, td); return (EBADF); } - vp = fp->f_data; + vp = fp->f_vnode; if (vp->v_type != VDIR) { fdrop(fp, td); return read(td, (struct read_args *)uap); diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c index 572b77b..74f8f7c 100644 --- a/sys/i386/ibcs2/ibcs2_stat.c +++ b/sys/i386/ibcs2/ibcs2_stat.c @@ -133,7 +133,7 @@ ibcs2_fstatfs(td, uap) if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); - mp = ((struct vnode *)fp->f_data)->v_mount; + mp = fp->f_vnode->v_mount; sp = &mp->mnt_stat; error = VFS_STATFS(mp, sp, td); fdrop(fp, td); -- cgit v1.1