summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-07-27 17:04:56 +0000
committerphk <phk@FreeBSD.org>2003-07-27 17:04:56 +0000
commitd4d7ca154aba6a0f8370fe818bb79bd7685b9fdc (patch)
tree9fe71cfe1133914703f5c502a7c60529cda9fff5
parentb40be37a17ddb7368dd149f10f7c780fa8cfed66 (diff)
downloadFreeBSD-src-d4d7ca154aba6a0f8370fe818bb79bd7685b9fdc.zip
FreeBSD-src-d4d7ca154aba6a0f8370fe818bb79bd7685b9fdc.tar.gz
Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.
-rw-r--r--sys/dev/md/md.c4
-rw-r--r--sys/dev/raidframe/rf_freebsdkintf.c2
-rw-r--r--sys/kern/kern_acct.c2
-rw-r--r--sys/kern/kern_alq.c2
-rw-r--r--sys/kern/kern_descrip.c2
-rw-r--r--sys/kern/kern_ktrace.c2
-rw-r--r--sys/kern/kern_linker.c4
-rw-r--r--sys/kern/kern_sig.c2
-rw-r--r--sys/kern/link_elf.c2
-rw-r--r--sys/kern/link_elf_obj.c2
-rw-r--r--sys/kern/tty_cons.c2
-rw-r--r--sys/kern/vfs_extattr.c2
-rw-r--r--sys/kern/vfs_syscalls.c2
-rw-r--r--sys/kern/vfs_vnops.c9
-rw-r--r--sys/nfsclient/nfs_lock.c2
-rw-r--r--sys/sys/vnode.h4
-rw-r--r--sys/ufs/ufs/ufs_quota.c2
17 files changed, 24 insertions, 23 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 57eed2e..4898762 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -840,13 +840,13 @@ mdcreate_vnode(struct md_ioctl *mdio, struct thread *td)
flags = FREAD|FWRITE;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, mdio->md_file, td);
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error) {
if (error != EACCES && error != EPERM && error != EROFS)
return (error);
flags &= ~FWRITE;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, mdio->md_file, td);
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error)
return (error);
}
diff --git a/sys/dev/raidframe/rf_freebsdkintf.c b/sys/dev/raidframe/rf_freebsdkintf.c
index d58bf26..d391fcd 100644
--- a/sys/dev/raidframe/rf_freebsdkintf.c
+++ b/sys/dev/raidframe/rf_freebsdkintf.c
@@ -1727,7 +1727,7 @@ raidlookup(path, td, vpp)
NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, curthread);
flags = FREAD | FWRITE;
- if ((error = vn_open(nd, &flags, 0)) != 0) {
+ if ((error = vn_open(nd, &flags, 0, -1)) != 0) {
rf_printf(2, "RAIDframe: vn_open returned %d\n", error);
goto end1;
}
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 8824d57..827a034 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -144,7 +144,7 @@ acct(td, uap)
if (uap->path != NULL) {
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
flags = FWRITE | O_APPEND;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error)
goto done2;
NDFREE(&nd, NDF_ONLY_PNBUF);
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c
index 94f0118..9613641 100644
--- a/sys/kern/kern_alq.c
+++ b/sys/kern/kern_alq.c
@@ -345,7 +345,7 @@ alq_open(struct alq **alqp, const char *file, struct ucred *cred, int size,
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td);
flags = FWRITE | O_NOFOLLOW | O_CREAT;
- error = vn_open_cred(&nd, &flags, 0, cred);
+ error = vn_open_cred(&nd, &flags, 0, cred, -1);
if (error)
return (error);
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 3e7c660..d8542c8 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1701,7 +1701,7 @@ fdcheckstd(td)
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/null",
td);
flags = FREAD | FWRITE;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error != 0) {
FILEDESC_LOCK(fdp);
fdp->fd_ofiles[fd] = NULL;
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 42a3581..a6630f2 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -524,7 +524,7 @@ ktrace(td, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->fname, td);
flags = FREAD | FWRITE | O_NOFOLLOW;
mtx_lock(&Giant);
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error) {
mtx_unlock(&Giant);
td->td_pflags &= ~TDP_INKTRACE;
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index c6d46ca..d6c18f2 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1392,7 +1392,7 @@ linker_lookup_file(const char *path, int pathlen, const char *name,
*/
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, result, td);
flags = FREAD;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error == 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
type = nd.ni_vp->v_type;
@@ -1440,7 +1440,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pathbuf, td);
flags = FREAD;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error)
goto bad;
NDFREE(&nd, NDF_ONLY_PNBUF);
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 0e86e25..72fbbff 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2545,7 +2545,7 @@ restart:
return (EINVAL);
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); /* XXXKSE */
flags = O_CREAT | FWRITE | O_NOFOLLOW;
- error = vn_open(&nd, &flags, S_IRUSR | S_IWUSR);
+ error = vn_open(&nd, &flags, S_IRUSR | S_IWUSR, -1);
free(name, M_TEMP);
if (error)
return (error);
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 015d5ba..cf7117a 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -561,7 +561,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td);
flags = FREAD;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error)
return error;
NDFREE(&nd, NDF_ONLY_PNBUF);
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 015d5ba..cf7117a 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -561,7 +561,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td);
flags = FREAD;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error)
return error;
NDFREE(&nd, NDF_ONLY_PNBUF);
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 53a5d3d..9737ca5 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -376,7 +376,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen)
}
snprintf(path, sizeof(path), "/dev/%s", cnd->cnd_name);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td);
- error = vn_open(&nd, &openflag, 0);
+ error = vn_open(&nd, &openflag, 0, -1);
if (error == 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
VOP_UNLOCK(nd.ni_vp, 0, td);
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index f7afcb5..7aa1729 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -685,7 +685,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
* the descriptor while we are blocked in vn_open()
*/
fhold(fp);
- error = vn_open(&nd, &flags, cmode);
+ error = vn_open(&nd, &flags, cmode, -1);
if (error) {
/*
* release our own reference
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index f7afcb5..7aa1729 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -685,7 +685,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
* the descriptor while we are blocked in vn_open()
*/
fhold(fp);
- error = vn_open(&nd, &flags, cmode);
+ error = vn_open(&nd, &flags, cmode, -1);
if (error) {
/*
* release our own reference
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 216a577..b43b908 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -84,13 +84,13 @@ struct fileops vnops = {
};
int
-vn_open(ndp, flagp, cmode)
+vn_open(ndp, flagp, cmode, fdidx)
register struct nameidata *ndp;
- int *flagp, cmode;
+ int *flagp, cmode, fdidx;
{
struct thread *td = ndp->ni_cnd.cn_thread;
- return (vn_open_cred(ndp, flagp, cmode, td->td_ucred));
+ return (vn_open_cred(ndp, flagp, cmode, td->td_ucred, fdidx));
}
/*
@@ -101,10 +101,11 @@ vn_open(ndp, flagp, cmode)
* due to the NDINIT being done elsewhere.
*/
int
-vn_open_cred(ndp, flagp, cmode, cred)
+vn_open_cred(ndp, flagp, cmode, cred, fdidx)
register struct nameidata *ndp;
int *flagp, cmode;
struct ucred *cred;
+ int fdidx;
{
struct vnode *vp;
struct mount *mp;
diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c
index f524712..374bbf9 100644
--- a/sys/nfsclient/nfs_lock.c
+++ b/sys/nfsclient/nfs_lock.c
@@ -144,7 +144,7 @@ nfs_dolock(struct vop_advlock_args *ap)
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, td);
fmode = FFLAGS(O_WRONLY | O_NONBLOCK);
- error = vn_open_cred(&nd, &fmode, 0, thread0.td_ucred);
+ error = vn_open_cred(&nd, &fmode, 0, thread0.td_ucred, -1);
switch (error) {
case ENOENT:
case ENXIO:
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 2efaa38..a222469 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -645,9 +645,9 @@ int debug_vn_lock(struct vnode *vp, int flags, struct thread *p,
const char *filename, int line);
#define vn_lock(vp,flags,p) debug_vn_lock(vp,flags,p,__FILE__,__LINE__)
#endif
-int vn_open(struct nameidata *ndp, int *flagp, int cmode);
+int vn_open(struct nameidata *ndp, int *flagp, int cmode, int fdidx);
int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode,
- struct ucred *cred);
+ struct ucred *cred, int fdidx);
void vn_pollevent(struct vnode *vp, int events);
void vn_pollgone(struct vnode *vp);
int vn_pollrecord(struct vnode *vp, struct thread *p, int events);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 21c0355..11d2e4b 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -419,7 +419,7 @@ quotaon(td, mp, type, fname)
vpp = &ump->um_quotas[type];
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fname, td);
flags = FREAD | FWRITE;
- error = vn_open(&nd, &flags, 0);
+ error = vn_open(&nd, &flags, 0, -1);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
OpenPOWER on IntegriCloud