pstat.c (50479) | pstat.c (53452) |
---|---|
1/*- 2 * Copyright (c) 1980, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)pstat.c 8.16 (Berkeley) 5/9/95"; 43#endif 44static const char rcsid[] = | 1/*- 2 * Copyright (c) 1980, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)pstat.c 8.16 (Berkeley) 5/9/95"; 43#endif 44static const char rcsid[] = |
45 "$FreeBSD: head/usr.sbin/pstat/pstat.c 50479 1999-08-28 01:35:59Z peter $"; | 45 "$FreeBSD: head/usr.sbin/pstat/pstat.c 53452 1999-11-20 10:00:46Z phk $"; |
46#endif /* not lint */ 47 48#include <sys/param.h> 49#include <sys/time.h> 50#include <sys/vnode.h> 51#include <sys/ucred.h> 52#define KERNEL 53#include <sys/file.h> --- 618 unchanged lines hidden (view full) --- 672#define VNODESZ sizeof(struct vnode) 673 674 KGET(V_NUMV, numvnodes); 675 if ((vbuf = malloc((numvnodes + 20) * (VPTRSZ + VNODESZ))) == NULL) 676 errx(1, "malloc"); 677 bp = vbuf; 678 evbuf = vbuf + (numvnodes + 20) * (VPTRSZ + VNODESZ); 679 KGET(V_MOUNTLIST, mountlist); | 46#endif /* not lint */ 47 48#include <sys/param.h> 49#include <sys/time.h> 50#include <sys/vnode.h> 51#include <sys/ucred.h> 52#define KERNEL 53#include <sys/file.h> --- 618 unchanged lines hidden (view full) --- 672#define VNODESZ sizeof(struct vnode) 673 674 KGET(V_NUMV, numvnodes); 675 if ((vbuf = malloc((numvnodes + 20) * (VPTRSZ + VNODESZ))) == NULL) 676 errx(1, "malloc"); 677 bp = vbuf; 678 evbuf = vbuf + (numvnodes + 20) * (VPTRSZ + VNODESZ); 679 KGET(V_MOUNTLIST, mountlist); |
680 for (num = 0, mp = mountlist.cqh_first; ; mp = mp_next) { | 680 for (num = 0, mp = TAILQ_FIRST(&mountlist); ; mp = mp_next) { |
681 KGET2(mp, &mount, sizeof(mount), "mount entry"); | 681 KGET2(mp, &mount, sizeof(mount), "mount entry"); |
682 mp_next = mount.mnt_list.cqe_next; | 682 mp_next = TAILQ_NEXT(&mount, mnt_list); |
683 for (vp = mount.mnt_vnodelist.lh_first; 684 vp != NULL; vp = vp_next) { 685 KGET2(vp, &vnode, sizeof(vnode), "vnode"); 686 vp_next = vnode.v_mntvnodes.le_next; 687 if ((bp + VPTRSZ + VNODESZ) > evbuf) 688 /* XXX - should realloc */ 689 errx(1, "no more room for vnodes"); 690 memmove(bp, &vp, VPTRSZ); 691 bp += VPTRSZ; 692 memmove(bp, &vnode, VNODESZ); 693 bp += VNODESZ; 694 num++; 695 } | 683 for (vp = mount.mnt_vnodelist.lh_first; 684 vp != NULL; vp = vp_next) { 685 KGET2(vp, &vnode, sizeof(vnode), "vnode"); 686 vp_next = vnode.v_mntvnodes.le_next; 687 if ((bp + VPTRSZ + VNODESZ) > evbuf) 688 /* XXX - should realloc */ 689 errx(1, "no more room for vnodes"); 690 memmove(bp, &vp, VPTRSZ); 691 bp += VPTRSZ; 692 memmove(bp, &vnode, VNODESZ); 693 bp += VNODESZ; 694 num++; 695 } |
696 if (mp == mountlist.cqh_last) | 696 if (mp == TAILQ_LAST(&mountlist, mntlist)) |
697 break; 698 } 699 *avnodes = num; 700 return ((struct e_vnode *)vbuf); 701} 702 703char hdr[] = 704" LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC\n"; --- 339 unchanged lines hidden --- | 697 break; 698 } 699 *avnodes = num; 700 return ((struct e_vnode *)vbuf); 701} 702 703char hdr[] = 704" LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC\n"; --- 339 unchanged lines hidden --- |