diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c index 62c3c61..82e824b 100644 --- a/sys/coda/coda_vnops.c +++ b/sys/coda/coda_vnops.c @@ -257,7 +257,7 @@ coda_open(struct vop_open_args *ap) cp->c_inode = inode; /* Open the cache file. */ - error = VOP_OPEN(vp, flag, cred, td, -1); + error = VOP_OPEN(vp, flag, cred, td, NULL); if (error) { printf("coda_open: VOP_OPEN on container failed %d\n", error); return (error); @@ -410,7 +410,7 @@ coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag, opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), - cred, td, -1); + cred, td, NULL); printf("coda_rdwr: Internally Opening %p\n", vp); if (error) { printf("coda_rdwr: VOP_OPEN on container failed %d\n", error); @@ -1525,7 +1525,7 @@ coda_readdir(struct vop_readdir_args *ap) if (cp->c_ovp == NULL) { opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); - error = VOP_OPEN(vp, FREAD, cred, td, -1); + error = VOP_OPEN(vp, FREAD, cred, td, NULL); printf("coda_readdir: Internally Opening %p\n", vp); if (error) { printf("coda_readdir: VOP_OPEN on container failed %d\n", error); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 0462d68..deb3853 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -305,7 +305,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) if (error) goto cleanup; #endif - error = VOP_OPEN(vp, FREAD, td->td_ucred, td, -1); + error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); if (error) goto cleanup; @@ -1451,6 +1451,7 @@ linux_getpid(struct thread *td, struct linux_getpid_args *args) int linux_gettid(struct thread *td, struct linux_gettid_args *args) { + #ifdef DEBUG if (ldebug(gettid)) printf(ARGS(gettid, "")); diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 2a559a1..29c7d8a 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -2961,7 +2961,7 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr) NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, path, td); flags = FREAD; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) { *status = NDIS_STATUS_FILE_NOT_FOUND; ExFreePool(fh); diff --git a/sys/compat/opensolaris/kern/opensolaris_kobj.c b/sys/compat/opensolaris/kern/opensolaris_kobj.c index 2687a70..32365dd 100644 --- a/sys/compat/opensolaris/kern/opensolaris_kobj.c +++ b/sys/compat/opensolaris/kern/opensolaris_kobj.c @@ -77,7 +77,7 @@ kobj_open_file_vnode(const char *file) flags = FREAD; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); - error = vn_open_cred(&nd, &flags, 0, td->td_ucred, -1); + error = vn_open_cred(&nd, &flags, 0, td->td_ucred, NULL); NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) return (NULL); diff --git a/sys/compat/opensolaris/sys/vnode.h b/sys/compat/opensolaris/sys/vnode.h index c8acd1c..cbcb937 100644 --- a/sys/compat/opensolaris/sys/vnode.h +++ b/sys/compat/opensolaris/sys/vnode.h @@ -170,7 +170,7 @@ zfs_vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode, td->td_proc->p_fd->fd_cdir = rootvnode; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pnamep, td); - error = vn_open_cred(&nd, &filemode, createmode, td->td_ucred, -1); + error = vn_open_cred(&nd, &filemode, createmode, td->td_ucred, NULL); NDFREE(&nd, NDF_ONLY_PNBUF); if (error == 0) { /* We just unlock so we hold a reference. */ diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 536dde6..cfcfda7 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -913,7 +913,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) if ((mdio->md_options & MD_READONLY) != 0) flags &= ~FWRITE; NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, sc->file, td); - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error != 0) return (error); vfslocked = NDHASGIANT(&nd); diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 575498a..03d7cf6 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -734,7 +734,7 @@ devfs_open(struct vop_open_args *ap) struct thread *td = ap->a_td; struct vnode *vp = ap->a_vp; struct cdev *dev = vp->v_rdev; - struct file *fp; + struct file *fp = ap->a_fp; int error; struct cdevsw *dsw; @@ -761,13 +761,13 @@ devfs_open(struct vop_open_args *ap) if(!(dsw->d_flags & D_NEEDGIANT)) { DROP_GIANT(); if (dsw->d_fdopen != NULL) - error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx); + error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fp); else error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); PICKUP_GIANT(); } else { if (dsw->d_fdopen != NULL) - error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx); + error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fp); else error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); } @@ -780,19 +780,12 @@ devfs_open(struct vop_open_args *ap) return (error); #if 0 /* /dev/console */ - KASSERT(ap->a_fdidx >= 0, + KASSERT(ap->a_fp != NULL, ("Could not vnode bypass device on fd %d", ap->a_fdidx)); #else - if(ap->a_fdidx < 0) + if(ap->a_fp == NULL) return (error); #endif - /* - * This is a pretty disgustingly long chain, but I am not - * sure there is any better way. Passing the fdidx into - * VOP_OPEN() offers us more information than just passing - * the file *. - */ - fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]; FILE_LOCK(fp); KASSERT(fp->f_ops == &badfileops, ("Could not vnode bypass device on fdops %p", fp->f_ops)); diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 2e1e143..06a1b1e 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -175,12 +175,12 @@ fifo_open(ap) struct fifoinfo *fip; struct thread *td = ap->a_td; struct ucred *cred = ap->a_cred; + struct file *fp = ap->a_fp; struct socket *rso, *wso; - struct file *fp; int error; ASSERT_VOP_LOCKED(vp, "fifo_open"); - if (ap->a_fdidx < 0) + if (ap->a_fp == NULL) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK); @@ -293,8 +293,7 @@ fail1: } } mtx_unlock(&fifo_mtx); - KASSERT(ap->a_fdidx >= 0, ("can't fifo/vnode bypass %d", ap->a_fdidx)); - fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]; + KASSERT(fp != NULL, ("can't fifo/vnode bypass")); FILE_LOCK(fp); KASSERT(fp->f_ops == &badfileops, ("not badfileops in fifo_open")); fp->f_data = fip; diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 196fdc7..40d3cdb 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -385,7 +385,7 @@ smbfs_setattr(ap) */ if ((np->n_flag & NOPEN) == 0) { if (vcp->vc_flags & SMBV_WIN95) { - error = VOP_OPEN(vp, FWRITE, ap->a_cred, ap->a_td, -1); + error = VOP_OPEN(vp, FWRITE, ap->a_cred, ap->a_td, NULL); if (!error) { /* error = smbfs_smb_setfattrNT(np, 0, mtime, atime, &scred); VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);*/ diff --git a/sys/fs/unionfs/union.h b/sys/fs/unionfs/union.h index 157018a..1931d32 100644 --- a/sys/fs/unionfs/union.h +++ b/sys/fs/unionfs/union.h @@ -64,7 +64,6 @@ struct unionfs_node_status { int uns_lower_opencnt; /* open count of lower */ int uns_upper_opencnt; /* open count of upper */ int uns_lower_openmode; /* open mode of lower */ - int uns_lower_fdidx; /* open fdidx of lower */ int uns_readdir_status; /* read status of readdir */ }; diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 8171eec..5007b98 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -913,7 +913,7 @@ unionfs_vn_create_on_upper(struct vnode **vpp, struct vnode *udvp, if ((error = VOP_CREATE(udvp, &vp, &cn, uvap)) != 0) goto unionfs_vn_create_on_upper_free_out1; - if ((error = VOP_OPEN(vp, fmode, cred, td, -1)) != 0) { + if ((error = VOP_OPEN(vp, fmode, cred, td, NULL)) != 0) { vput(vp); goto unionfs_vn_create_on_upper_free_out1; } @@ -1049,7 +1049,7 @@ unionfs_copyfile(struct unionfs_node *unp, int docopy, struct ucred *cred, } if (docopy != 0) { - error = VOP_OPEN(lvp, FREAD, cred, td, -1); + error = VOP_OPEN(lvp, FREAD, cred, td, NULL); if (error == 0) { error = unionfs_copyfile_core(lvp, uvp, cred, td); VOP_CLOSE(lvp, FREAD, cred, td); @@ -1110,7 +1110,7 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred *cred, struct thread *td) return (0); /* open vnode */ - if ((error = VOP_OPEN(vp, FREAD, cred, td, -1)) != 0) + if ((error = VOP_OPEN(vp, FREAD, cred, td, NULL)) != 0) return (error); uio.uio_rw = UIO_READ; diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 55e75ef..e63683c 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -475,13 +475,13 @@ unionfs_open(struct vop_open_args *ap) targetvp = uvp; } - error = VOP_OPEN(targetvp, ap->a_mode, cred, td, ap->a_fdidx); + error = VOP_OPEN(targetvp, ap->a_mode, cred, td, ap->a_fp); if (error == 0) { if (targetvp == uvp) { if (uvp->v_type == VDIR && lvp != NULLVP && unsp->uns_lower_opencnt <= 0) { /* open lower for readdir */ - error = VOP_OPEN(lvp, FREAD, cred, td, -1); + error = VOP_OPEN(lvp, FREAD, cred, td, NULL); if (error != 0) { VOP_CLOSE(uvp, ap->a_mode, cred, td); goto unionfs_open_abort; @@ -493,7 +493,6 @@ unionfs_open(struct vop_open_args *ap) } else { unsp->uns_lower_opencnt++; unsp->uns_lower_openmode = ap->a_mode; - unsp->uns_lower_fdidx = ap->a_fdidx; } ap->a_vp->v_object = targetvp->v_object; } @@ -1852,7 +1851,8 @@ unionfs_advlock(struct vop_advlock_args *ap) unionfs_get_node_status(unp, td, &unsp); if (unsp->uns_lower_opencnt > 0) { /* try reopen the vnode */ - error = VOP_OPEN(uvp, unsp->uns_lower_openmode, td->td_ucred, td, unsp->uns_lower_fdidx); + error = VOP_OPEN(uvp, unsp->uns_lower_openmode, + td->td_ucred, td, NULL); if (error) goto unionfs_advlock_abort; unsp->uns_upper_opencnt++; diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c index 1f44716..054574f 100644 --- a/sys/i386/ibcs2/imgact_coff.c +++ b/sys/i386/ibcs2/imgact_coff.c @@ -204,7 +204,7 @@ coff_load_file(struct thread *td, char *name) if ((error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td)) != 0) goto fail; - if ((error = VOP_OPEN(vp, FREAD, td->td_ucred, td, -1)) != 0) + if ((error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL)) != 0) goto fail; /* diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 60c1b28..b60f902 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -203,7 +203,7 @@ acct(struct thread *td, struct acct_args *uap) NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE | AUDITVNODE1, UIO_USERSPACE, uap->path, td); flags = FWRITE | O_APPEND; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) return (error); vfslocked = NDHASGIANT(&nd); diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 6c043db..c0507d9 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -264,13 +264,13 @@ giant_open(struct cdev *dev, int oflags, int devtype, struct thread *td) } static int -giant_fdopen(struct cdev *dev, int oflags, struct thread *td, int fdidx) +giant_fdopen(struct cdev *dev, int oflags, struct thread *td, struct file *fp) { int retval; mtx_lock(&Giant); retval = dev->si_devsw->d_gianttrick-> - d_fdopen(dev, oflags, td, fdidx); + d_fdopen(dev, oflags, td, fp); mtx_unlock(&Giant); return (retval); } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index cb4449b..c576913 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1233,7 +1233,7 @@ exec_check_permissions(imgp) * Call filesystem specific open routine (which does nothing in the * general case). */ - error = VOP_OPEN(vp, FREAD, td->td_ucred, td, -1); + error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); return (error); } diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index beb188d..1784bc2 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -596,7 +596,7 @@ ktrace(td, uap) NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_USERSPACE, uap->fname, td); flags = FREAD | FWRITE | O_NOFOLLOW; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) { ktrace_exit(td); return (error); diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 444373f..084105f 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1510,7 +1510,7 @@ linker_lookup_file(const char *path, int pathlen, const char *name, */ NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, result, td); flags = FREAD; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error == 0) { vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1561,7 +1561,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, pathbuf, td); flags = FREAD; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) goto bad; vfslocked = NDHASGIANT(&nd); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ca0efe0..addcfa5 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3068,7 +3068,7 @@ restart: return (EINVAL); NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, name, td); flags = O_CREAT | FWRITE | O_NOFOLLOW; - error = vn_open(&nd, &flags, S_IRUSR | S_IWUSR, -1); + error = vn_open(&nd, &flags, S_IRUSR | S_IWUSR, NULL); free(name, M_TEMP); if (error) return (error); diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index d186f0b..02fe809 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -566,7 +566,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, filename, td); flags = FREAD; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) return error; vfslocked = NDHASGIANT(&nd); diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 49f2ad8..6ea18f8 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -404,7 +404,7 @@ link_elf_load_file(linker_class_t cls, const char *filename, NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, filename, td); flags = FREAD; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) return error; vfslocked = NDHASGIANT(&nd); diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index fb533cf..a09f9f2 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -407,7 +407,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen) } snprintf(path, sizeof(path), "/dev/%s", cnd->cnd_cn->cn_name); NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td); - error = vn_open(&nd, &openflag, 0, -1); + error = vn_open(&nd, &openflag, 0, NULL); if (error == 0) { NDFREE(&nd, NDF_ONLY_PNBUF); VOP_UNLOCK(nd.ni_vp, 0, td); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 15ab9a0..fa3ef2e 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -984,7 +984,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags, cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, path, td); td->td_dupfd = -1; /* XXX check for fdopen */ - error = vn_open(&nd, &flags, cmode, indx); + error = vn_open(&nd, &flags, cmode, fp); if (error) { /* * If the vn_open replaced the method vector, something @@ -4091,7 +4091,7 @@ fhopen(td, uap) if (error) goto bad; } - error = VOP_OPEN(vp, fmode, td->td_ucred, td, -1); + error = VOP_OPEN(vp, fmode, td->td_ucred, td, NULL); if (error) goto bad; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f035558..b00a42f 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -84,13 +84,14 @@ struct fileops vnops = { }; int -vn_open(ndp, flagp, cmode, fdidx) +vn_open(ndp, flagp, cmode, fp) struct nameidata *ndp; - int *flagp, cmode, fdidx; + int *flagp, cmode; + struct file *fp; { struct thread *td = ndp->ni_cnd.cn_thread; - return (vn_open_cred(ndp, flagp, cmode, td->td_ucred, fdidx)); + return (vn_open_cred(ndp, flagp, cmode, td->td_ucred, fp)); } /* @@ -101,11 +102,11 @@ vn_open(ndp, flagp, cmode, fdidx) * due to the NDINIT being done elsewhere. */ int -vn_open_cred(ndp, flagp, cmode, cred, fdidx) +vn_open_cred(ndp, flagp, cmode, cred, fp) struct nameidata *ndp; int *flagp, cmode; struct ucred *cred; - int fdidx; + struct file *fp; { struct vnode *vp; struct mount *mp; @@ -228,7 +229,7 @@ restart: goto bad; } } - if ((error = VOP_OPEN(vp, fmode, cred, td, fdidx)) != 0) + if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0) goto bad; if (fmode & FWRITE) diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index aa022c7..097b872 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -130,7 +130,7 @@ vop_open { IN int mode; IN struct ucred *cred; IN struct thread *td; - IN int fdidx; + IN struct file *fp; }; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 209117f..65ab1a9 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -50,6 +50,7 @@ struct tty; struct snapdata; struct devfs_dirent; struct cdevsw; +struct file; struct cdev { struct cdev_priv *si_priv; @@ -126,7 +127,7 @@ struct vnode; typedef struct thread d_thread_t; typedef int d_open_t(struct cdev *dev, int oflags, int devtype, struct thread *td); -typedef int d_fdopen_t(struct cdev *dev, int oflags, struct thread *td, int fdidx); +typedef int d_fdopen_t(struct cdev *dev, int oflags, struct thread *td, struct file *fp); typedef int d_close_t(struct cdev *dev, int fflag, int devtype, struct thread *td); typedef void d_strategy_t(struct bio *bp); typedef int d_ioctl_t(struct cdev *dev, u_long cmd, caddr_t data, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index b83fea3..72d2650 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -613,9 +613,9 @@ void vn_finished_secondary_write(struct mount *mp); int vn_isdisk(struct vnode *vp, int *errp); int _vn_lock(struct vnode *vp, int flags, struct thread *td, char *file, int line); #define vn_lock(vp, flags, td) _vn_lock(vp, flags, td, __FILE__, __LINE__) -int vn_open(struct nameidata *ndp, int *flagp, int cmode, int fdidx); +int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, - struct ucred *cred, int fdidx); + struct ucred *cred, struct file *fp); int vn_pollrecord(struct vnode *vp, struct thread *p, int events); int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 07b8d59..5bf083e 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -524,7 +524,7 @@ quotaon(td, mp, type, fname) NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_USERSPACE, fname, td); flags = FREAD | FWRITE; - error = vn_open(&nd, &flags, 0, -1); + error = vn_open(&nd, &flags, 0, NULL); if (error) return (error); vfslocked = NDHASGIANT(&nd); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 9640ce8..9dffc8c 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2535,7 +2535,7 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) error = mac_check_system_swapon(td->td_ucred, vp); if (error == 0) #endif - error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td, -1); + error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td, NULL); (void) VOP_UNLOCK(vp, 0, td); if (error) return (error);