summaryrefslogtreecommitdiffstats
path: root/sys/kern
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 /sys/kern
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.
Diffstat (limited to 'sys/kern')
-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
12 files changed, 17 insertions, 16 deletions
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;
OpenPOWER on IntegriCloud