diff options
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/deadfs/dead_vnops.c | 4 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 6 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfs_vfsops.c | 7 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfs_vnops.c | 35 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfsdefs.h | 3 | ||||
-rw-r--r-- | sys/miscfs/fdesc/fdesc_vfsops.c | 10 | ||||
-rw-r--r-- | sys/miscfs/fdesc/fdesc_vnops.c | 6 | ||||
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 3 | ||||
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 13 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_vnops.c | 6 | ||||
-rw-r--r-- | sys/miscfs/portal/portal_vnops.c | 14 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 6 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_map.c | 5 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_mem.c | 4 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_status.c | 39 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_subr.c | 7 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 8 | ||||
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 16 | ||||
-rw-r--r-- | sys/miscfs/umapfs/umap_subr.c | 23 | ||||
-rw-r--r-- | sys/miscfs/umapfs/umap_vnops.c | 4 | ||||
-rw-r--r-- | sys/miscfs/union/union.h | 5 | ||||
-rw-r--r-- | sys/miscfs/union/union_subr.c | 86 | ||||
-rw-r--r-- | sys/miscfs/union/union_vnops.c | 4 |
23 files changed, 119 insertions, 195 deletions
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index 4e3853ce54c50..6e810f8071a6e 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: dead_vnops.c,v 1.24 1998/08/23 11:43:29 bde Exp $ + * $Id: dead_vnops.c,v 1.23 1997/12/15 03:09:44 wollman Exp $ */ #include <sys/param.h> @@ -188,7 +188,7 @@ dead_ioctl(ap) { if (!chkvnlock(ap->a_vp)) - return (ENOTTY); + return (EBADF); return (VCALL(ap->a_vp, VOFFSET(vop_ioctl), ap)); } diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 7839645da0ac4..c43a01109d299 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_tree.c,v 1.57 1998/11/26 18:50:23 eivind Exp $ + * $Id: devfs_tree.c,v 1.55 1998/07/04 22:30:22 julian Exp $ */ @@ -56,7 +56,7 @@ static MALLOC_DEFINE(M_DEVFSNODE, "DEVFS node", "DEVFS node"); static MALLOC_DEFINE(M_DEVFSNAME, "DEVFS name", "DEVFS name"); devnm_p dev_root; /* root of the backing tree */ -static struct mount *devfs_hidden_mount; +struct mount *devfs_hidden_mount; int devfs_up_and_going; /* @@ -1129,7 +1129,7 @@ devfs_add_devswf(void *devsw, int minor, int chrblk, uid_t uid, * this function is exported.. see sys/devfsext.h * \***********************************************************************/ void * -devfs_makelink(void *original, char *fmt, ...) +devfs_link(void *original, char *fmt, ...) { devnm_p new_dev; devnm_p orig = (devnm_p) original; diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index 95ae9579719bf..f2751708b8a5f 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vfsops.c,v 1.34 1998/10/31 15:31:23 peter Exp $ + * $Id: devfs_vfsops.c,v 1.32 1998/09/07 13:17:00 bde Exp $ * */ @@ -258,6 +258,7 @@ static int devfs_sync(struct mount *mp, int waitfor,struct ucred *cred,struct proc *p) { register struct vnode *vp, *nvp; + struct timeval tv; int error, allerror = 0; DBPRINT(("sync ")); @@ -281,7 +282,7 @@ loop: nvp = vp->v_mntvnodes.le_next; if (VOP_ISLOCKED(vp)) continue; - if (TAILQ_EMPTY(&vp->v_dirtyblkhd)) + if ( vp->v_dirtyblkhd.lh_first == NULL) continue; if (vp->v_type == VBLK) { if (vget(vp, LK_EXCLUSIVE, p)) @@ -293,8 +294,6 @@ loop: } #ifdef NOTYET else { - struct timeval tv; - tv = time; /* VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */ VOP_UPDATE(vp, &tv, &tv, 0); diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index e9bdc2a36c72c..213a8677c4de2 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vnops.c,v 1.64 1998/12/15 23:46:59 eivind Exp $ + * $Id: devfs_vnops.c,v 1.60 1998/09/04 08:06:56 dfr Exp $ */ @@ -639,6 +639,9 @@ devfs_xwrite(struct vop_write_args *ap) struct ucred *a_cred; } */ { + dn_p file_node; + int error; + switch (ap->a_vp->v_type) { case VREG: return(EINVAL); @@ -1285,6 +1288,16 @@ devfs_print(struct vop_print_args *ap) * pseudo ops * \**************************************************************************/ +/* + * /devfs vnode unsupported operation + */ +static int +devfs_enotsupp(void *junk) +{ + + return (EOPNOTSUPP); +} + /*proto*/ void devfs_dropvnode(dn_p dnp) @@ -1324,7 +1337,8 @@ static int devfs_open( struct vop_open_args *ap) { struct proc *p = ap->a_p; - struct vnode *vp = ap->a_vp; + struct vnode *bvp, *vp = ap->a_vp; + dev_t bdev, dev = (dev_t)vp->v_rdev; int error; dn_p dnp; @@ -1373,7 +1387,7 @@ devfs_read( struct vop_read_args *ap) daddr_t bn, nextbn; long bsize, bscale; struct partinfo dpart; - int n, on; + int n, on, majordev; d_ioctl_t *ioctl; int error = 0; dev_t dev; @@ -1519,11 +1533,11 @@ devfs_write( struct vop_write_args *ap) bp = getblk(vp, bn, bsize, 0, 0); else error = bread(vp, bn, bsize, NOCRED, &bp); + n = min(n, bsize - bp->b_resid); if (error) { brelse(bp); return (error); } - n = min(n, bsize - bp->b_resid); error = uiomove((char *)bp->b_data + on, n, uio); if (n + on == bsize) bawrite(bp); @@ -1641,8 +1655,8 @@ devfs_fsync(struct vop_fsync_args *ap) */ loop: s = splbio(); - for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { - nbp = TAILQ_NEXT(bp, b_vnbufs); + for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { + nbp = bp->b_vnbufs.le_next; if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -1664,7 +1678,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0); } #ifdef DIAGNOSTIC - if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { + if (vp->v_dirtyblkhd.lh_first) { vprint("devfs_fsync: dirty", vp); splx(s); goto loop; @@ -1763,8 +1777,11 @@ static int devfs_close(struct vop_close_args *ap) { register struct vnode *vp = ap->a_vp; - int error; - dn_p dnp; + struct proc *p = ap->a_p; + dev_t dev = vp->v_rdev; + d_close_t *devclose; + int mode, error; + dn_p dnp; if (error = devfs_vntodn(vp,&dnp)) return error; diff --git a/sys/miscfs/devfs/devfsdefs.h b/sys/miscfs/devfs/devfsdefs.h index 43ae38b5d5579..9144c3dd925e3 100644 --- a/sys/miscfs/devfs/devfsdefs.h +++ b/sys/miscfs/devfs/devfsdefs.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfsdefs.h,v 1.17 1998/09/30 20:33:46 sos Exp $ + * $Id: devfsdefs.h,v 1.16 1998/07/05 23:10:22 julian Exp $ */ #ifdef DEVFS_DEBUG #define DBPRINT(A) printf(A) @@ -202,6 +202,7 @@ struct dev_vn_data devnm_p back; }; +extern struct vnodeops spec_vnodeops,devfs_vnodeops; /* * Prototypes for DEVFS virtual filesystem operations */ diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c index 881be49c8168d..de6f03d062e47 100644 --- a/sys/miscfs/fdesc/fdesc_vfsops.c +++ b/sys/miscfs/fdesc/fdesc_vfsops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * - * $Id: fdesc_vfsops.c,v 1.16 1998/09/07 13:17:00 bde Exp $ + * $Id: fdesc_vfsops.c,v 1.15 1998/05/06 05:29:33 msmith Exp $ */ /* @@ -55,8 +55,13 @@ static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure"); +static int fdesc_fhtovp __P((struct mount *mp, struct fid *fhp, + struct mbuf *nam, struct vnode **vpp, + int *exflagsp, struct ucred **credanonp)); static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, struct proc *p)); +static int fdesc_quotactl __P((struct mount *mp, int cmd, uid_t uid, + caddr_t arg, struct proc *p)); static int fdesc_start __P((struct mount *mp, int flags, struct proc *p)); static int fdesc_unmount __P((struct mount *mp, int mntflags, struct proc *p)); @@ -64,6 +69,9 @@ static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); static int fdesc_sync __P((struct mount *mp, int waitfor, struct ucred *cred, struct proc *p)); +static int fdesc_vget __P((struct mount *mp, ino_t ino, + struct vnode **vpp)); +static int fdesc_vptofh __P((struct vnode *vp, struct fid *fhp)); /* * Mount the per-process file descriptors (/dev/fd) diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index fb8f4a169f25f..a8ec1765814c3 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.39 1998/12/07 21:58:31 archie Exp $ + * $Id: fdesc_vnops.c,v 1.37 1998/06/10 21:21:28 dfr Exp $ */ /* @@ -84,6 +84,8 @@ static int fdesc_attr __P((int fd, struct vattr *vap, struct ucred *cred, struct proc *p)); static int fdesc_badop __P((void)); static int fdesc_getattr __P((struct vop_getattr_args *ap)); +static struct fdcache * + fdesc_hash __P((int ix)); static int fdesc_inactive __P((struct vop_inactive_args *ap)); static int fdesc_ioctl __P((struct vop_ioctl_args *ap)); static int fdesc_lookup __P((struct vop_lookup_args *ap)); @@ -193,7 +195,7 @@ fdesc_lookup(ap) char *pname = cnp->cn_nameptr; struct proc *p = cnp->cn_proc; int nfiles = p->p_fd->fd_nfiles; - unsigned fd = -1; + unsigned fd; int error; struct vnode *fvp; char *ln; diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 49f7288f69094..c30ed0147f92a 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95 - * $Id: kernfs_vfsops.c,v 1.23 1998/09/07 13:17:01 bde Exp $ + * $Id: kernfs_vfsops.c,v 1.22 1998/05/06 05:29:33 msmith Exp $ */ /* @@ -56,6 +56,7 @@ static MALLOC_DEFINE(M_KERNFSMNT, "KERNFS mount", "KERNFS mount structure"); dev_t rrootdev = NODEV; +static int cdevvp __P((dev_t dev, struct vnode **vpp)); static void kernfs_get_rrootdev __P((void)); static int kernfs_init __P((struct vfsconf *vfsp)); static int kernfs_mount __P((struct mount *mp, char *path, caddr_t data, diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 81261a9009208..4280ef1db733b 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95 - * $Id: kernfs_vnops.c,v 1.36 1998/12/04 22:54:51 archie Exp $ + * $Id: kernfs_vnops.c,v 1.34 1998/06/25 16:54:18 dt Exp $ */ /* @@ -106,9 +106,11 @@ static int nkern_targets = sizeof(kern_targets) / sizeof(kern_targets[0]); static int kernfs_access __P((struct vop_access_args *ap)); static int kernfs_badop __P((void)); +static int kernfs_enotsupp __P((void)); static int kernfs_getattr __P((struct vop_getattr_args *ap)); static int kernfs_inactive __P((struct vop_inactive_args *ap)); static int kernfs_lookup __P((struct vop_lookup_args *ap)); +static int kernfs_pathconf __P((struct vop_pathconf_args *ap)); static int kernfs_print __P((struct vop_print_args *ap)); static int kernfs_read __P((struct vop_read_args *ap)); static int kernfs_readdir __P((struct vop_readdir_args *ap)); @@ -131,13 +133,13 @@ kernfs_xread(kt, buf, len, lenp) case KTT_TIME: { struct timeval tv; microtime(&tv); - snprintf(buf, len, "%ld %ld\n", tv.tv_sec, tv.tv_usec); + sprintf(buf, "%ld %ld\n", tv.tv_sec, tv.tv_usec); break; } case KTT_INT: { int *ip = kt->kt_data; - snprintf(buf, len, "%d\n", *ip); + sprintf(buf, "%d\n", *ip); break; } @@ -179,7 +181,7 @@ kernfs_xread(kt, buf, len, lenp) } case KTT_AVENRUN: - snprintf(buf, len, "%lu %lu %lu %ld\n", + sprintf(buf, "%lu %lu %lu %ld\n", (u_long)averunnable.ldavg[0], (u_long)averunnable.ldavg[1], (u_long)averunnable.ldavg[2], averunnable.fscale); break; @@ -233,6 +235,7 @@ kernfs_lookup(ap) struct proc *p = cnp->cn_proc; struct kern_target *kt; struct vnode *fvp; + int nameiop = cnp->cn_nameiop; int error, i; #ifdef KERNFS_DIAGNOSTIC @@ -371,6 +374,7 @@ kernfs_getattr(ap) { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; + struct timeval tv; int error = 0; char strbuf[KSTRING]; @@ -455,6 +459,7 @@ kernfs_read(ap) char strbuf[KSTRING]; int off = uio->uio_offset; int error, len; + char *cp; if (vp->v_type == VDIR) return (EOPNOTSUPP); diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index b2e1b63af9553..1398e34325394 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -37,11 +37,11 @@ * * Ancestors: * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vnops.c,v 1.29 1998/07/04 20:45:33 julian Exp $ + * $Id: null_vnops.c,v 1.28 1998/06/10 06:34:56 peter Exp $ * ...and... * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project * - * $Id: null_vnops.c,v 1.29 1998/07/04 20:45:33 julian Exp $ + * $Id: null_vnops.c,v 1.28 1998/06/10 06:34:56 peter Exp $ */ /* @@ -523,6 +523,8 @@ null_unlock(ap) struct proc *a_p; } */ *ap; { + struct vnode *vp = ap->a_vp; + vop_nounlock(ap); ap->a_flags &= ~LK_INTERLOCK; return (null_bypass((struct vop_generic_args *)ap)); diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c index 819d636a20c23..11a1e84a1a487 100644 --- a/sys/miscfs/portal/portal_vnops.c +++ b/sys/miscfs/portal/portal_vnops.c @@ -35,7 +35,7 @@ * * @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95 * - * $Id: portal_vnops.c,v 1.34 1998/12/07 21:58:32 archie Exp $ + * $Id: portal_vnops.c,v 1.32 1998/06/10 06:34:57 peter Exp $ */ /* @@ -68,6 +68,7 @@ static int portal_fileid = PORTAL_ROOTFILEID+1; static int portal_badop __P((void)); static void portal_closefd __P((struct proc *p, int fd)); static int portal_connect __P((struct socket *so, struct socket *so2)); +static int portal_enotsupp __P((void)); static int portal_getattr __P((struct vop_getattr_args *ap)); static int portal_inactive __P((struct vop_inactive_args *ap)); static int portal_lookup __P((struct vop_lookup_args *ap)); @@ -444,6 +445,7 @@ portal_getattr(ap) { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; + struct timeval tv; bzero(vap, sizeof(*vap)); vattr_null(vap); @@ -575,6 +577,16 @@ portal_print(ap) /* + * Portal vnode unsupported operation + */ +static int +portal_enotsupp() +{ + + return (EOPNOTSUPP); +} + +/* * Portal "should never get here" operation */ static int diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 619e1b23ed8b4..b727e16543aa0 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -37,7 +37,7 @@ * @(#)procfs.h 8.9 (Berkeley) 5/14/95 * * From: - * $Id: procfs.h,v 1.20 1998/07/07 04:08:44 bde Exp $ + * $Id: procfs.h,v 1.19 1998/05/19 00:00:13 tegge Exp $ */ /* @@ -56,8 +56,7 @@ typedef enum { Pnote, /* process notifier */ Pnotepg, /* process group notifier */ Pmap, /* memory map */ - Ptype, /* executable type */ - Pcmdline /* command line */ + Ptype /* executable type */ } pfstype; /* @@ -155,7 +154,6 @@ int procfs_doctl __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct int procfs_dostatus __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); int procfs_dotype __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); -int procfs_docmdline __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); /* Return 1 if process has special kernel digging privileges */ int procfs_kmemaccess __P((struct proc *)); diff --git a/sys/miscfs/procfs/procfs_map.c b/sys/miscfs/procfs/procfs_map.c index 4dae10a6fdc0e..1a865e6690427 100644 --- a/sys/miscfs/procfs/procfs_map.c +++ b/sys/miscfs/procfs/procfs_map.c @@ -36,7 +36,7 @@ * * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * - * $Id: procfs_map.c,v 1.17 1998/04/29 04:28:22 dyson Exp $ + * $Id: procfs_map.c,v 1.16 1998/02/06 12:13:41 eivind Exp $ */ #include <sys/param.h> @@ -153,8 +153,7 @@ case OBJT_DEVICE: * format: * start, end, resident, private resident, cow, access, type. */ - snprintf(mebuffer, sizeof(mebuffer), - "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n", + sprintf(mebuffer, "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n", entry->start, entry->end, resident, privateresident, id, (entry->protection & VM_PROT_READ)?"r":"-", diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index 22d8f74228764..c1012f1cb2535 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -37,7 +37,7 @@ * * @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 * - * $Id: procfs_mem.c,v 1.34 1998/07/15 02:32:19 bde Exp $ + * $Id: procfs_mem.c,v 1.33 1998/06/07 17:11:57 dfr Exp $ */ /* @@ -253,7 +253,7 @@ procfs_rwmem(curp, p, uio) /* * release the page and the object */ - vm_page_unwire(m, 1); + vm_page_unwire(m); vm_object_deallocate(object); object = NULL; diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c index 3176a64400644..3f1cccf39f3ec 100644 --- a/sys/miscfs/procfs/procfs_status.c +++ b/sys/miscfs/procfs/procfs_status.c @@ -37,7 +37,7 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 * * From: - * $Id: procfs_status.c,v 1.11 1998/07/11 07:45:45 bde Exp $ + * $Id: procfs_status.c,v 1.10 1997/08/02 14:32:17 bde Exp $ */ #include <sys/param.h> @@ -147,40 +147,3 @@ procfs_dostatus(curp, p, pfs, uio) return (error); } - -int -procfs_docmdline(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; -{ - char *ps; - int xlen; - int error; - char psbuf[256]; - - if (uio->uio_rw != UIO_READ) - return (EOPNOTSUPP); - - /* - * For now, this is a hack. To implement this fully would require - * groping around in the process address space to follow argv etc. - */ - ps = psbuf; - bcopy(p->p_comm, ps, MAXCOMLEN); - ps[MAXCOMLEN] = '\0'; - ps += strlen(ps); - - ps += sprintf(ps, "\n"); - - xlen = ps - psbuf; - xlen -= uio->uio_offset; - ps = psbuf + uio->uio_offset; - xlen = min(xlen, uio->uio_resid); - if (xlen <= 0) - error = 0; - else - error = uiomove(ps, xlen, uio); - return (error); -} diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index 813232cb5fb32..2156b12b04533 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -36,7 +36,7 @@ * * @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95 * - * $Id: procfs_subr.c,v 1.21 1997/12/12 03:33:43 sef Exp $ + * $Id: procfs_subr.c,v 1.20 1997/12/09 05:03:41 sef Exp $ */ #include <sys/param.h> @@ -181,7 +181,6 @@ loop: case Ptype: case Pmap: case Pstatus: - case Pcmdline: pfs->pfs_mode = (VREAD) | (VREAD >> 3) | (VREAD >> 6); @@ -283,10 +282,6 @@ procfs_rw(ap) rtval = procfs_dotype(curp, p, pfs, uio); break; - case Pcmdline: - rtval = procfs_docmdline(curp, p, pfs, uio); - break; - default: rtval = EOPNOTSUPP; break; diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index daab08f2c2408..8a6230eabf015 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.62 1998/12/04 22:54:51 archie Exp $ + * $Id: procfs_vnops.c,v 1.60 1998/06/25 16:54:41 dt Exp $ */ /* @@ -101,7 +101,6 @@ static struct proc_target { { DT_REG, N("notepg"), Pnotepg, NULL }, { DT_REG, N("map"), Pmap, procfs_validmap }, { DT_REG, N("etype"), Ptype, procfs_validtype }, - { DT_REG, N("cmdline"), Pcmdline, NULL }, #undef N }; static const int nproc_targets = sizeof(proc_targets) / sizeof(proc_targets[0]); @@ -529,7 +528,7 @@ procfs_getattr(ap) vap->va_uid = 0; vap->va_gid = 0; vap->va_size = vap->va_bytes = - snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); + sprintf(buf, "%ld", (long)curproc->p_pid); break; } @@ -574,7 +573,6 @@ procfs_getattr(ap) case Pstatus: case Pnote: case Pnotepg: - case Pcmdline: vap->va_nlink = 1; vap->va_uid = procp->p_ucred->cr_uid; vap->va_gid = procp->p_ucred->cr_gid; @@ -946,7 +944,7 @@ procfs_readlink(ap) if (VTOPFS(ap->a_vp)->pfs_fileno != PROCFS_FILENO(0, Pcurproc)) return (EINVAL); - len = snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); + len = sprintf(buf, "%ld", (long)curproc->p_pid); return (uiomove((caddr_t)buf, len, ap->a_uio)); } diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index ff0f347546b7a..f32a9f15033ee 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.77 1998/12/07 21:58:33 archie Exp $ + * $Id: spec_vnops.c,v 1.73 1998/09/05 14:13:12 phk Exp $ */ #include <sys/param.h> @@ -257,7 +257,7 @@ spec_read(ap) daddr_t bn, nextbn; long bsize, bscale; struct partinfo dpart; - int n, on; + int n, on, majordev; d_ioctl_t *ioctl; int error = 0; dev_t dev; @@ -285,7 +285,8 @@ spec_read(ap) return (EINVAL); bsize = BLKDEV_IOSIZE; dev = vp->v_rdev; - if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL && + if ((majordev = major(dev)) < nblkdev && + (ioctl = bdevsw[majordev]->d_ioctl) != NULL && (*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 && dpart.part->p_fstype == FS_BSDFFS && dpart.part->p_frag != 0 && dpart.part->p_fsize != 0) @@ -379,11 +380,11 @@ spec_write(ap) bp = getblk(vp, bn, bsize, 0, 0); else error = bread(vp, bn, bsize, NOCRED, &bp); + n = min(n, bsize - bp->b_resid); if (error) { brelse(bp); return (error); } - n = min(n, bsize - bp->b_resid); error = uiomove((char *)bp->b_data + on, n, uio); if (n + on == bsize) bawrite(bp); @@ -476,8 +477,8 @@ spec_fsync(ap) */ loop: s = splbio(); - for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { - nbp = TAILQ_NEXT(bp, b_vnbufs); + for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { + nbp = bp->b_vnbufs.le_next; if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -499,7 +500,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0); } #ifdef DIAGNOSTIC - if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { + if (vp->v_dirtyblkhd.lh_first) { vprint("spec_fsync: dirty", vp); splx(s); goto loop; @@ -605,6 +606,7 @@ spec_close(ap) } */ *ap; { register struct vnode *vp = ap->a_vp; + struct proc *p = ap->a_p; dev_t dev = vp->v_rdev; d_close_t *devclose; int mode, error; diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c index 4974f03c110c6..fc4d5eb4575ad 100644 --- a/sys/miscfs/umapfs/umap_subr.c +++ b/sys/miscfs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 * - * $Id: umap_subr.c,v 1.15 1998/11/09 09:21:25 peter Exp $ + * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $ */ #include <sys/param.h> @@ -259,7 +259,7 @@ umap_node_create(mp, targetvp, newvpp) * Take another reference to the alias vnode */ #ifdef UMAPFS_DIAGNOSTIC - vprint("umap_node_create: exists", aliasvp); + vprint("umap_node_create: exists", ap->umap_vnode); #endif /* VREF(aliasvp); */ } else { @@ -352,18 +352,22 @@ umap_mapids(v_mount, credp) struct mount *v_mount; struct ucred *credp; { - int i; + int i, unentries, gnentries; + u_long *groupmap, *usermap; uid_t uid; gid_t gid; if (credp == NOCRED) return; + unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries; + usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]); + gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries; + groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]); + /* Find uid entry in map */ - uid = (uid_t) umap_findid(credp->cr_uid, - MOUNTTOUMAPMOUNT(v_mount)->info_mapdata, - MOUNTTOUMAPMOUNT(v_mount)->info_nentries); + uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries); if (uid != -1) credp->cr_uid = uid; @@ -375,9 +379,7 @@ umap_mapids(v_mount, credp) /* Find gid entry in map */ - gid = (gid_t) umap_findid(credp->cr_gid, - MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, - MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); + gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries); if (gid != -1) credp->cr_gid = gid; @@ -391,8 +393,7 @@ umap_mapids(v_mount, credp) i = 0; while (credp->cr_groups[i] != 0) { gid = (gid_t) umap_findid(credp->cr_groups[i], - MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, - MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); + groupmap, gnentries); if (gid != -1) credp->cr_groups[i++] = gid; diff --git a/sys/miscfs/umapfs/umap_vnops.c b/sys/miscfs/umapfs/umap_vnops.c index 893e1e54ad90d..a41a575bf4108 100644 --- a/sys/miscfs/umapfs/umap_vnops.c +++ b/sys/miscfs/umapfs/umap_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)umap_vnops.c 8.6 (Berkeley) 5/22/95 - * $Id: umap_vnops.c,v 1.25 1998/07/30 17:40:45 bde Exp $ + * $Id: umap_vnops.c,v 1.24 1998/07/04 20:45:34 julian Exp $ */ /* @@ -386,6 +386,8 @@ umap_unlock(ap) struct proc *a_p; } */ *ap; { + struct vnode *vp = ap->a_vp; + vop_nounlock(ap); ap->a_flags &= ~LK_INTERLOCK; return (null_bypass((struct vop_generic_args *)ap)); diff --git a/sys/miscfs/union/union.h b/sys/miscfs/union/union.h index 6a4aa226203e2..4deb6d42fa2cf 100644 --- a/sys/miscfs/union/union.h +++ b/sys/miscfs/union/union.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union.h 8.9 (Berkeley) 12/10/94 - * $Id: union.h,v 1.12 1998/02/26 03:23:51 kato Exp $ + * $Id: union.h,v 1.11 1998/02/10 03:32:03 kato Exp $ */ struct union_args { @@ -114,9 +114,6 @@ extern void union_removed_upper __P((struct union_node *un)); extern struct vnode *union_lowervp __P((struct vnode *)); extern void union_newsize __P((struct vnode *, off_t, off_t)); -extern int (*union_dircheckp) __P((struct proc *, struct vnode **, - struct file *)); - #define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data)) #define VTOUNION(vp) ((struct union_node *)(vp)->v_data) #define UNIONTOV(un) ((un)->un_vnode) diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c index 7559b6e205fb5..c54d86b6a4192 100644 --- a/sys/miscfs/union/union_subr.c +++ b/sys/miscfs/union/union_subr.c @@ -35,19 +35,16 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.20 (Berkeley) 5/20/95 - * $Id: union_subr.c,v 1.35 1998/12/07 21:58:34 archie Exp $ + * $Id: union_subr.c,v 1.30 1998/05/07 04:58:36 msmith Exp $ */ #include <sys/param.h> #include <sys/systm.h> -#include <sys/kernel.h> #include <sys/vnode.h> #include <sys/namei.h> #include <sys/malloc.h> #include <sys/fcntl.h> -#include <sys/file.h> #include <sys/filedesc.h> -#include <sys/module.h> #include <sys/mount.h> #include <sys/stat.h> #include <vm/vm.h> @@ -307,9 +304,10 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache) struct union_node *un = 0; struct vnode *xlowervp = NULLVP; struct union_mount *um = MOUNTTOUNIONMOUNT(mp); - int hash = 0; + int hash; int vflag; int try; + int klocked; if (uppervp == NULLVP && lowervp == NULLVP) panic("union: unidentifiable allocation"); @@ -773,7 +771,7 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen) vrele(dvp); else { zfree(namei_zone, cn->cn_pnbuf); - cn->cn_pnbuf = NULL; + cn->cn_pnbuf = '\0'; } return (error); @@ -1140,79 +1138,3 @@ out: VOP_UNLOCK(vp, 0, p); return (nvp); } - -/* - * Module glue to remove #ifdef UNION from vfs_syscalls.c - */ -static int -union_dircheck(struct proc *p, struct vnode **vp, struct file *fp) -{ - int error = 0; - - if ((*vp)->v_op == union_vnodeop_p) { - struct vnode *lvp; - - lvp = union_dircache(*vp, p); - if (lvp != NULLVP) { - struct vattr va; - - /* - * If the directory is opaque, - * then don't show lower entries - */ - error = VOP_GETATTR(*vp, &va, fp->f_cred, p); - if (va.va_flags & OPAQUE) { - vput(lvp); - lvp = NULL; - } - } - - if (lvp != NULLVP) { - error = VOP_OPEN(lvp, FREAD, fp->f_cred, p); - if (error) { - vput(lvp); - return (error); - } - VOP_UNLOCK(lvp, 0, p); - fp->f_data = (caddr_t) lvp; - fp->f_offset = 0; - error = vn_close(*vp, FREAD, fp->f_cred, p); - if (error) - return (error); - *vp = lvp; - return -1; /* goto unionread */ - } - } - if (((*vp)->v_flag & VROOT) && ((*vp)->v_mount->mnt_flag & MNT_UNION)) { - struct vnode *tvp = *vp; - *vp = (*vp)->v_mount->mnt_vnodecovered; - VREF(*vp); - fp->f_data = (caddr_t) *vp; - fp->f_offset = 0; - vrele(tvp); - return -1; /* goto unionread */ - } - return error; -} - -static int -union_modevent(module_t mod, int type, void *data) -{ - switch (type) { - case MOD_LOAD: - union_dircheckp = union_dircheck; - break; - case MOD_UNLOAD: - union_dircheckp = NULL; - break; - default: - break; - } - return 0; -} -static moduledata_t union_mod = { - "union_dircheck", - union_modevent, - NULL -}; -DECLARE_MODULE(union_dircheck, union_mod, SI_SUB_VFS, SI_ORDER_ANY); diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 87fda6d6cc81e..2bcd1ee794f03 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.58 1998/07/04 20:45:35 julian Exp $ + * $Id: union_vnops.c,v 1.57 1998/05/07 04:58:38 msmith Exp $ */ #include <sys/param.h> @@ -205,7 +205,7 @@ union_lookup(ap) struct proc *p = cnp->cn_proc; int lockparent = cnp->cn_flags & LOCKPARENT; struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount); - struct ucred *saved_cred = NULL; + struct ucred *saved_cred; int iswhiteout; struct vattr va; |