Commit Graph

155 Commits

Author SHA1 Message Date
mlelstv ffb41b3a17 Fix fallout from circleq->tailq transition. 2013-11-24 13:13:12 +00:00
christos 0a77b69ab6 fix unused variable warnings. 2013-10-19 17:16:37 +00:00
dsl a97d5b18ca pstat is a kmem groveller, set -D_KMEMUSER in CPPFLAGS 2013-01-02 10:43:11 +00:00
apb f950d3cf71 The number of active vnodes may grow in between the sysctl call
that figures out the size, and the sysctl call that fetches the data.

Previously, any growth at all would have resulted in this error message:

        pstat: sysctl: KERN_VNODE: Cannot allocate memory

Now allow for growth of 100 vnodes, or 5%, or both.  Growth in
excess of 2% or 6000 vnodes has been observed in practice.  Also
ignore ENOMEM from the second sysctl call, in case the growth was
even more than we anticipated.
2012-11-10 11:01:52 +00:00
riastradh b8c3b27f99 Kill the IN_RENAME in-core inode flag in ufs and ext2fs.
Now that rename works we need not to wave this sort of voodoo at it.

ok dholland
2012-06-04 20:13:47 +00:00
joerg bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
wiz 89152edad2 Fix memory leak in error case. Found by cppcheck. 2011-01-04 09:58:03 +00:00
pooka 70d4493c77 Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs.  User functionality remains the same.
2009-12-05 20:11:01 +00:00
enami 29551a2991 Prevent sign extension when reading device number in ufs1 on disk inode
so that devname(3) correctly converts it to device filename.
2009-11-19 02:52:54 +00:00
joerg dd5fba70d0 Fix markup. 2009-10-14 22:59:11 +00:00
mlelstv d2979fb02a Distinguish between UFS1 and UFS2 inodes by reading the ufsmount structure,
the previous heuristic of comparing the size fields of inode and dinode
failed.
2009-09-16 07:27:41 +00:00
lukem aecc7237da Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare) 2009-04-18 08:05:18 +00:00
mrg 01a13dba2c convert getfiles() to use KERN_FILE2 sysctl.
now it can survive "struct file" changing, as is upcoming.
2009-03-11 06:00:11 +00:00
ad 69f9e17075 Don't bother with file_t::f_iflags any more, as it's not used.
Noted by mrg@.
2009-03-08 12:52:08 +00:00
christos 07b8d9f309 consistently print dev_t's 2008-12-28 23:02:28 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
ad 0565241b89 +#define _KERNEL
+#include <sys/types.h>
+#undef _KERNEL
2008-02-27 15:46:23 +00:00
dyoung d4f4828ee0 Do not #include <sys/device.h> from userland. 2008-02-11 22:43:39 +00:00
ad 64da32e634 Don't decode union vnodes or f_usecount. XXX A lot of this belongs to gdb. 2008-02-11 15:22:43 +00:00
ad 703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
ad 22f711b877 Remove reference to VI_XWANT - it will be gone soon. 2007-12-28 18:08:39 +00:00
dogcow f4c8a4cce7 Turns out we don't actually need to include <sys/namei.h>; since it causes
a compile error, away it goes.
2007-12-09 12:04:06 +00:00
ad c60c05b2ef TS_ASLEEP is gone. 2007-11-19 19:00:30 +00:00
briggs 644890e99d If we're printing totals, don't do all the work of allocating and
copying down the vnodes.
2007-10-20 01:38:45 +00:00
ad 7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
christos 9e211aafa1 Kill MFSNAMELEN 2007-07-17 21:50:07 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
he 5bf65cf9c2 Because this program has _KERNEL defined while including some files,
it now needs <stdbool.h> due to the arm ports.  Longer-term, this
program probably ought to be converted so that it no longer needs
to define _KERNEL.
2007-03-04 17:57:20 +00:00
daniel 83aa19e1b0 Correctly retrieve information from an ext2fs inode's dinode. Fixes
PR 21302.

Ack by christos.
2007-01-06 23:06:18 +00:00
xtraeme d9e9fef5b7 More NQNFS fallout (hi yamt!). 2006-12-28 04:17:51 +00:00
christos 9a150e0221 revert debug flags I accidentally committed before. 2006-12-05 03:52:02 +00:00
christos 11c53ad61c kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
2006-10-30 20:22:53 +00:00
reinoud 0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
christos fb0d335338 Coverity CID 3377: Fix memory leak on error. 2006-05-25 01:49:30 +00:00
elad 35ad67c75e Fix off-by-one found by Coverity, CID 1485. 2006-03-17 21:01:02 +00:00
elad 7d1c72d85d Fix off-by-one found by Coverity, CID 1486. 2006-03-17 20:48:09 +00:00
rpaulo 0dc4f15121 Don't print swap information when reading from kernel dumps. Fixes PR
13418 by Andrew Doran <ad@netbsd.org>.
2005-09-11 16:09:51 +00:00
rpaulo 3f51653817 de-__P() and use ANSI function declarations. 2005-09-02 21:26:47 +00:00
christos c4ee9f6d2e 64 bit inode changes 2005-08-19 02:07:18 +00:00
christos 68a1fbb811 catch up with kernel's constification. 2005-05-30 07:24:31 +00:00
christos b30695cd1d Use the array of dtype names instead of hand-rolling our own. 2004-12-18 08:43:35 +00:00
snj edb93b858a Bump date for last, new sentence, new line, and kill an extra space. 2004-12-09 06:57:19 +00:00
matt d337725eb3 When dumping the file entry, print the usecount and iflags too. 2004-12-09 01:14:59 +00:00
jdc d853cbbaf4 Make pstat -f work on sparc by adjusting the offset of the buffer passed
to sysctl in getfiles().

XXX: Possibly the correct fix is to make sysctl() not return an array which
contains structs with different alignment constraints.
2004-02-22 12:30:11 +00:00
mrg 61b5ab403f bump date for previous 2003-12-21 02:52:02 +00:00
mrg 9bf440d20b support "-g" and "-m" as well as "-k" and "-h". swapctl & swaplist code
from Martin Weber, adapted for pstat by myself.
2003-12-20 13:31:42 +00:00
mrg 5fd013c40d add a "-h" (humanize_number(3)) option to swapctl(8) and pstat(8), from
Martin Weber in PR#23805.

ps: now we only need someone to do ls(1) :-)
2003-12-20 11:22:25 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
mrg 3b06b649fe revert previous 2003-02-11 00:45:02 +00:00