summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-09-23 18:49:40 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-09-23 18:49:40 +0000
commit206df040f0a173a6703ddff05fccef9372353b2e (patch)
tree5dfcd2b0e5fb6c546670363aba8abddd0c671cc4
parentcff1a3e5da18708311dbb5d2fb178a800b031333 (diff)
The only sensible argument for VOP_* calls that take a struct proc pointer is
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this pointer, which was fine until the called vnode function tried to do something with it. Typically, this code was then copy/pasted to various parts of the tree. Accept the facts of life and switch all of these over to passing curproc for now until the argument can be removed. Discovered by stsp trying to create a softraid on top of a vnd, which crashed with a NULL deref in vndioctl. softraid bits tested by mikeb and jsing. raidframe bits tested by pea, matthieu and naddy. The rest tested by at least thib, jsing and myself. ok thib@, jsing@.
-rw-r--r--sys/dev/raidframe/rf_disks.c4
-rw-r--r--sys/dev/raidframe/rf_openbsdkintf.c14
-rw-r--r--sys/dev/softraid.c45
-rw-r--r--sys/dev/softraid_crypto.c20
-rw-r--r--sys/kern/subr_disk.c6
-rw-r--r--sys/nnpfs/nnpfs_vnodeops.h2
-rw-r--r--sys/ufs/ext2fs/ext2fs_lookup.c8
-rw-r--r--sys/ufs/ext2fs/ext2fs_vnops.c11
-rw-r--r--sys/ufs/ufs/ufs_lookup.c6
-rw-r--r--sys/ufs/ufs/ufs_vnops.c4
10 files changed, 63 insertions, 57 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index fefce52be6b..56e7dc1d32c 100644
--- a/sys/dev/raidframe/rf_disks.c
+++ b/sys/dev/raidframe/rf_disks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_disks.c,v 1.14 2010/05/23 13:49:35 naddy Exp $ */
+/* $OpenBSD: rf_disks.c,v 1.15 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: rf_disks.c,v 1.31 2000/06/02 01:17:14 oster Exp $ */
/*
@@ -598,7 +598,7 @@ rf_AutoConfigureDisks(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr,
ac = auto_config;
while(ac != NULL) {
if (ac->flag == 0) {
- VOP_CLOSE(ac->vp, FREAD, NOCRED, 0);
+ VOP_CLOSE(ac->vp, FREAD, NOCRED, curproc);
vput(ac->vp);
ac->vp = NULL;
#if DEBUG
diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c
index 992ae78364b..51a8bd787e3 100644
--- a/sys/dev/raidframe/rf_openbsdkintf.c
+++ b/sys/dev/raidframe/rf_openbsdkintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_openbsdkintf.c,v 1.59 2010/09/22 01:18:57 matthew Exp $ */
+/* $OpenBSD: rf_openbsdkintf.c,v 1.60 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */
/*-
@@ -2720,7 +2720,7 @@ rf_find_raid_components(void)
if (bdevvp(dev, &vp))
panic("RAID can't alloc vnode");
- error = VOP_OPEN(vp, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vp, FREAD, NOCRED, curproc);
if (error) {
/*
@@ -2733,7 +2733,7 @@ rf_find_raid_components(void)
/* Ok, the disk exists. Go get the disklabel. */
error = VOP_IOCTL(vp, DIOCGDINFO, (caddr_t)&label,
- FREAD, NOCRED, 0);
+ FREAD, NOCRED, curproc);
if (error) {
/*
* XXX can't happen - open() would
@@ -2747,7 +2747,7 @@ rf_find_raid_components(void)
* We don't need this any more. We'll allocate it again
* a little later if we really do...
*/
- VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, curproc);
vrele(vp);
for (i=0; i < label.d_npartitions; i++) {
@@ -2770,7 +2770,7 @@ rf_find_raid_components(void)
if (bdevvp(dev, &vp))
panic("RAID can't alloc vnode");
- error = VOP_OPEN(vp, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vp, FREAD, NOCRED, curproc);
if (error) {
/* Whatever... */
vput(vp);
@@ -2825,7 +2825,7 @@ rf_find_raid_components(void)
if (!good_one) {
/* Cleanup. */
free(clabel, M_RAIDFRAME);
- VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, curproc);
vrele(vp);
}
}
@@ -3328,7 +3328,7 @@ rf_release_all_vps(RF_ConfigSet_t *cset)
while(ac!=NULL) {
/* Close the vp, and give it back. */
if (ac->vp) {
- VOP_CLOSE(ac->vp, FREAD, NOCRED, 0);
+ VOP_CLOSE(ac->vp, FREAD, NOCRED, curproc);
vrele(ac->vp);
ac->vp = NULL;
}
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index f86d0fcc94b..df9d63562a9 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.213 2010/09/07 17:14:06 deraadt Exp $ */
+/* $OpenBSD: softraid.c,v 1.214 2010/09/23 18:49:39 oga Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -322,7 +322,7 @@ sr_meta_probe(struct sr_discipline *sd, dev_t *dt, int no_chunk)
* XXX leaving dev open for now; move this to attach
* and figure out the open/close dance for unwind.
*/
- error = VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0);
+ error = VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META,"%s: sr_meta_probe can't "
"open %s\n", DEVNAME(sc), devname);
@@ -900,7 +900,7 @@ sr_meta_native_bootprobe(struct sr_softc *sc, dev_t devno,
}
/* open device */
- error = VOP_OPEN(vn, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vn, FREAD, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe open "
"failed\n", DEVNAME(sc));
@@ -909,17 +909,18 @@ sr_meta_native_bootprobe(struct sr_softc *sc, dev_t devno,
}
/* get disklabel */
- error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0);
+ error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED,
+ curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe ioctl "
"failed\n", DEVNAME(sc));
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
goto done;
}
/* we are done, close device */
- error = VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ error = VOP_CLOSE(vn, FREAD, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe close "
"failed\n", DEVNAME(sc));
@@ -957,7 +958,7 @@ sr_meta_native_bootprobe(struct sr_softc *sc, dev_t devno,
"vnode for partition\n", DEVNAME(sc));
goto done;
}
- error = VOP_OPEN(vn, FREAD, NOCRED, 0);
+ error = VOP_OPEN(vn, FREAD, NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: sr_meta_native_bootprobe "
"open failed, partition %d\n",
@@ -969,14 +970,14 @@ sr_meta_native_bootprobe(struct sr_softc *sc, dev_t devno,
if (sr_meta_native_read(fake_sd, rawdev, md, NULL)) {
printf("%s: native bootprobe could not read native "
"metadata\n", DEVNAME(sc));
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
continue;
}
/* are we a softraid partition? */
if (md->ssdi.ssd_magic != SR_MAGIC) {
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
continue;
}
@@ -999,7 +1000,7 @@ sr_meta_native_bootprobe(struct sr_softc *sc, dev_t devno,
}
/* we are done, close partition */
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
}
@@ -1368,7 +1369,7 @@ sr_meta_native_probe(struct sr_softc *sc, struct sr_chunk *ch_entry)
/* get disklabel */
error = VOP_IOCTL(ch_entry->src_vn, DIOCGDINFO, (caddr_t)&label, FREAD,
- NOCRED, 0);
+ NOCRED, curproc);
if (error) {
DNPRINTF(SR_D_META, "%s: %s can't obtain disklabel\n",
DEVNAME(sc), devname);
@@ -2374,7 +2375,7 @@ sr_hotspare(struct sr_softc *sc, dev_t dev)
printf("%s:, sr_hotspare: can't allocate vnode\n", DEVNAME(sc));
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_hotspare cannot open %s\n",
DEVNAME(sc), devname);
vput(vn);
@@ -2384,10 +2385,11 @@ sr_hotspare(struct sr_softc *sc, dev_t dev)
/* Get partition details. */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD,
+ NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_hotspare ioctl failed\n",
DEVNAME(sc));
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
goto fail;
}
@@ -2498,7 +2500,7 @@ done:
if (sm)
free(sm, M_DEVBUF);
if (open) {
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
}
@@ -2671,7 +2673,7 @@ sr_rebuild_init(struct sr_discipline *sd, dev_t dev, int hotspare)
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_ioctl_setstate can't "
"open %s\n", DEVNAME(sc), devname);
vput(vn);
@@ -2681,7 +2683,8 @@ sr_rebuild_init(struct sr_discipline *sd, dev_t dev, int hotspare)
/* get partition */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD,
+ NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_ioctl_setstate ioctl failed\n",
DEVNAME(sc));
goto done;
@@ -2745,7 +2748,7 @@ sr_rebuild_init(struct sr_discipline *sd, dev_t dev, int hotspare)
rv = 0;
done:
if (open) {
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
}
@@ -3318,8 +3321,10 @@ sr_chunks_unwind(struct sr_softc *sc, struct sr_chunk_head *cl)
* the problem introduced by vnode aliasing... specfs
* has no locking, whereas ufs/ffs does!
*/
- vn_lock(ch_entry->src_vn, LK_EXCLUSIVE | LK_RETRY, 0);
- VOP_CLOSE(ch_entry->src_vn, FREAD | FWRITE, NOCRED, 0);
+ vn_lock(ch_entry->src_vn, LK_EXCLUSIVE |
+ LK_RETRY, curproc);
+ VOP_CLOSE(ch_entry->src_vn, FREAD | FWRITE, NOCRED,
+ curproc);
vput(ch_entry->src_vn);
}
free(ch_entry, M_DEVBUF);
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index 18e0cbc76c3..581daeef5fc 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.54 2010/07/02 09:26:05 jsing Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.55 2010/09/23 18:49:39 oga Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -674,7 +674,7 @@ sr_crypto_create_key_disk(struct sr_discipline *sd, dev_t dev)
DEVNAME(sc));
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_create_key_disk cannot open %s\n",
DEVNAME(sc), devname);
vput(vn);
@@ -684,10 +684,11 @@ sr_crypto_create_key_disk(struct sr_discipline *sd, dev_t dev)
/* Get partition details. */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label,
+ FREAD, NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_create_key_disk ioctl failed\n",
DEVNAME(sc));
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
goto fail;
}
@@ -798,7 +799,7 @@ done:
if (sm)
free(sm, M_DEVBUF);
if (open) {
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
}
@@ -836,7 +837,7 @@ sr_crypto_read_key_disk(struct sr_discipline *sd, dev_t dev)
DEVNAME(sc));
goto done;
}
- if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, 0)) {
+ if (VOP_OPEN(vn, FREAD | FWRITE, NOCRED, curproc)) {
DNPRINTF(SR_D_META,"%s: sr_create_key_disk cannot open %s\n",
DEVNAME(sc), devname);
vput(vn);
@@ -846,10 +847,11 @@ sr_crypto_read_key_disk(struct sr_discipline *sd, dev_t dev)
/* Get partition details. */
part = DISKPART(dev);
- if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD, NOCRED, 0)) {
+ if (VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)&label, FREAD,
+ NOCRED, curproc)) {
DNPRINTF(SR_D_META, "%s: sr_create_key_disk ioctl failed\n",
DEVNAME(sc));
- VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc);
vput(vn);
goto done;
}
@@ -928,7 +930,7 @@ done:
free(sm, M_DEVBUF);
if (vn && open) {
- VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ VOP_CLOSE(vn, FREAD, NOCRED, curproc);
vput(vn);
}
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index f6f47712473..b9a65b512f0 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.110 2010/09/23 13:20:36 jsing Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.111 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -1337,7 +1337,7 @@ disk_readlabel(struct disklabel *dl, dev_t dev)
return (errbuf);
}
- error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)dl, FREAD, NOCRED, 0);
+ error = VOP_IOCTL(vn, DIOCGDINFO, (caddr_t)dl, FREAD, NOCRED, curproc);
if (error) {
snprintf(errbuf, sizeof(errbuf),
"cannot read disk label, 0x%x/0x%x, error %d",
@@ -1345,7 +1345,7 @@ disk_readlabel(struct disklabel *dl, dev_t dev)
return (errbuf);
}
- error = VOP_CLOSE(vn, FREAD, NOCRED, 0);
+ error = VOP_CLOSE(vn, FREAD, NOCRED, curproc);
if (error) {
snprintf(errbuf, sizeof(errbuf),
"cannot close disk, 0x%x/0x%x, error %d",
diff --git a/sys/nnpfs/nnpfs_vnodeops.h b/sys/nnpfs/nnpfs_vnodeops.h
index e42ae1f63df..2dbe683450b 100644
--- a/sys/nnpfs/nnpfs_vnodeops.h
+++ b/sys/nnpfs/nnpfs_vnodeops.h
@@ -56,7 +56,7 @@
#define nnpfs_vfs_readlock(vp, proc) vn_lock((vp), LK_SHARED | LK_RETRY)
#define nnpfs_vfs_writelock(vp, proc) vn_lock((vp), LK_EXCLUSIVE | LK_RETRY)
-#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), 0)
+#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), (proc))
#define nnpfs_vfs_vn_lock(vp, flags, proc) vn_lock((vp), (flags))
#elif defined(HAVE_THREE_ARGUMENT_VOP_LOCK)
diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c
index ff0df391dbc..9b0ba254d48 100644
--- a/sys/ufs/ext2fs/ext2fs_lookup.c
+++ b/sys/ufs/ext2fs/ext2fs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_lookup.c,v 1.25 2009/07/09 22:29:56 thib Exp $ */
+/* $OpenBSD: ext2fs_lookup.c,v 1.26 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */
/*
@@ -969,7 +969,7 @@ ext2fs_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred)
for (off = 0; off < ext2fs_size(ip); off += fs2h16(dp->e2d_reclen)) {
error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off,
- UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, &count, curproc);
/*
* Since we read MINDIRSIZ, residual must
* be 0 unless we're at end of file.
@@ -1033,8 +1033,8 @@ ext2fs_checkpath(struct inode *source, struct inode *target,
}
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct ext2fs_dirtemplate), (off_t)0,
- UIO_SYSSPACE, IO_NODELOCKED, cred, (size_t *)0,
- (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, NULL,
+ curproc);
if (error != 0)
break;
namlen = dirbuf.dotdot_namlen;
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c
index 4b7626d09be..cc029be03dd 100644
--- a/sys/ufs/ext2fs/ext2fs_vnops.c
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vnops.c,v 1.56 2010/09/10 16:34:09 thib Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.57 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */
/*
@@ -826,7 +826,7 @@ abortit:
error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf,
sizeof (struct ext2fs_dirtemplate), (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED,
- tcnp->cn_cred, (size_t *)0, (struct proc *)0);
+ tcnp->cn_cred, NULL, curproc);
if (error == 0) {
namlen = dirbuf.dotdot_namlen;
if (namlen != 2 ||
@@ -841,8 +841,7 @@ abortit:
sizeof (struct dirtemplate),
(off_t)0, UIO_SYSSPACE,
IO_NODELOCKED|IO_SYNC,
- tcnp->cn_cred, (size_t *)0,
- (struct proc *)0);
+ tcnp->cn_cred, NULL, curproc);
cache_purge(fdvp);
}
}
@@ -951,7 +950,7 @@ ext2fs_mkdir(void *v)
dirtemplate.dotdot_name[0] = dirtemplate.dotdot_name[1] = '.';
error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate,
sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE,
- IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (size_t *)0, (struct proc *)0);
+ IO_NODELOCKED|IO_SYNC, cnp->cn_cred, NULL, curproc);
if (error) {
dp->i_e2fs_nlink--;
dp->i_flag |= IN_CHANGE;
@@ -1095,7 +1094,7 @@ ext2fs_symlink(void *v)
} else
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, NULL,
- (struct proc *)0);
+ curproc);
bad:
vput(vp);
return (error);
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 34c7853605f..fb2b936d33b 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_lookup.c,v 1.39 2010/04/20 22:05:44 tedu Exp $ */
+/* $OpenBSD: ufs_lookup.c,v 1.40 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: ufs_lookup.c,v 1.7 1996/02/09 22:36:06 christos Exp $ */
/*
@@ -1076,7 +1076,7 @@ ufs_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred)
m = DIP(ip, size);
for (off = 0; off < m; off += dp->d_reclen) {
error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off,
- UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, &count, curproc);
/*
* Since we read MINDIRSIZ, residual must
* be 0 unless we're at end of file.
@@ -1145,7 +1145,7 @@ ufs_checkpath(struct inode *source, struct inode *target, struct ucred *cred)
}
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE,
- IO_NODELOCKED, cred, NULL, (struct proc *)0);
+ IO_NODELOCKED, cred, NULL, curproc);
if (error != 0)
break;
# if (BYTE_ORDER == LITTLE_ENDIAN)
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 000c1dbd0e2..40f2afc8f93 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_vnops.c,v 1.95 2010/09/10 16:34:09 thib Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.96 2010/09/23 18:49:39 oga Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@@ -1357,7 +1357,7 @@ ufs_symlink(void *v)
} else
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, NULL,
- (struct proc *)0);
+ curproc);
vput(vp);
return (error);
}