Commit Graph

4053 Commits

Author SHA1 Message Date
yamt 3362d4ed5b fix allocbuf() O(n**2) behaviour where n is number of AGE buffers
by always tracking amount of buffers on a queue.
bump to 2.0H.
2004-09-18 16:37:12 +00:00
yamt 2bf1a4ef17 - add missing function prototypes.
- fix prototype mismatches.
2004-09-18 16:01:03 +00:00
enami 23114636eb Delete m_tag from a mbuf being non-pkthdr mbuf rather than newly becoming
pkthdr mbuf.
2004-09-17 23:24:03 +00:00
enami a3eb2d5952 - proc_alloc() already initializes p_stat to SIDL.
- copy unconditionaly inherited p_flag bits in a single place.
2004-09-17 23:20:21 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
tls 95c72fc3de Add 50Hz support -- this will allow 'options NTP' to work on the Xen port,
once the Xen port's timer interrupts are made somewhat more sane (it "works"
now, but keeps worse time than without the option, ouch)
2004-09-15 04:56:14 +00:00
jdolecek e6e73849a5 g/c rest of COMPAT_AOUT support 2004-09-14 17:25:37 +00:00
jdolecek 023551ef44 gc opt_compat_aout.h include 2004-09-14 17:20:29 +00:00
jdolecek a6894024dd dostatvfs(): zero the statvfs structure before calling filesystem code, so that
unset parts would have defined value and not pass random parts of kernel stack
2004-09-13 20:02:20 +00:00
jdolecek c407d0a5ca copy_statvfs_info(): copy f_namemax too 2004-09-13 19:45:21 +00:00
thorpej 77f08a265c Move the 16/32-bit encode/decode to/from octet stream routines from
kern_uuid.c to sys/endian.h (where FreeBSD has them), and add 64-bit
variants.
2004-09-12 23:17:37 +00:00
jdolecek ca7fc04a65 use 'have_toupper' variable for awk toupper() function existence test, rather
than 'isgawk' - e.g. nawk has toupper() too
2004-09-12 11:24:15 +00:00
yamt 1304a56139 m_split: restore a behaviour on M_PKTHDR, which was unintentionaly
changed when i added m_copyback_cow.
2004-09-11 19:55:19 +00:00
yamt 6a2c652541 regen. 2004-09-10 09:38:17 +00:00
yamt 472da495d3 VOP_BMAP isn't protected by vnode locks these days. 2004-09-10 09:37:41 +00:00
jdolecek 734ccdcf2b fix/adjust comment a little 2004-09-10 06:09:15 +00:00
yamt 7b09a1e089 m_copyback, m_copyback_cow, m_copydata:
- caddr_t -> void *
- constify.
partly from openbsd.
2004-09-08 12:00:28 +00:00
yamt d08391b2a3 buf_trim: a buffer grabbed by getnewbuf() should be clean and anonymous.
thus, there's no need to check and handle B_WANTED here.
2004-09-08 10:20:15 +00:00
yamt e2139bcdc8 add m_copyback_cow and m_makewritable. 2004-09-06 09:43:29 +00:00
manu 6e3c639957 IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
2004-09-04 23:29:44 +00:00
manu 35053e0e8d Recognize bundles as mach-O executables 2004-09-04 23:21:26 +00:00
skrll ab05973128 Use "NULL" instead of "(struct foo *)0". 2004-09-04 07:09:35 +00:00
darrenr 02c34673a3 add a per-socket counter for dropped UDP packets when the internal buffers
are full.
2004-09-03 18:14:09 +00:00
drochner e66ef34b75 split out the check whether a driver supports a given interface
attribure, and add a diagnostic assertion to config_search_loc()
which ensures that a supplied attribute name is correct
2004-08-30 09:48:05 +00:00
thorpej e910f9082e - Define a constant to describe the length of a printed UUID string.
- Clean up the namespace of this module and enable the encode/decode
  functions and printing functions.
- Move the code that actually generates the UUID out of the system call
  routine and into its own function.
2004-08-30 02:56:03 +00:00
itojun 9ac7900a84 bug reported by millert@openbsd:
> Call dom_dispose() for any SCM_RIGHTS message that went through the
> read path rather than recv.  Previously, if an fd was passed via
> sendmsg() but was consumed by the receiver via read() the ref count
> was incremented and never decremented and so the ref count would
> never reach zero even when there was no long any processes holding
> the file open (this was especially bad for locked fds).
2004-08-25 09:03:23 +00:00
drochner 6860e77f9d include <sys/device> explicitely, found by Havard Eidnes 2004-08-19 15:12:36 +00:00
christos 43f6a1ad3b PR/26210: Matthew Mondor: Since revision 1.14 when net-2 was merged,
the code to do receive packet accounting has been disabled for no apparent
reason. Re-enable it.
2004-08-19 12:48:42 +00:00
drochner 4157766364 add a "drvctl" pseudo-device as userland interface to the autoconf
rescan() and detach() functions
2004-08-18 12:19:29 +00:00
drochner d95b59fae8 add a new "DRV" LKM type, and some glue code to make it use the new
autoconf capabilities
2004-08-17 22:38:50 +00:00
drochner 08538dce1b Add some extensions to the autoconf framework to better support
loadable drivers and user controlled attach/detach of devices.
An outline was given in
http://mail-index.NetBSD.org/tech-kern/2004/08/11/0000.html
To cite the relevant parts:
-Add a "child detached" and a "rescan" method (both optional)
 to the device driver. (This is added to the "cfattach" for now
 because this is under the driver writer's control. Logically
 it belongs more to the "cfdriver", but this is automatically
 generated now.)
 The "child detached" is called by the autoconf framework
 during config_detach(), after the child's ca_detach()
 function was called but before the device data structure
 is freed.
 The "rescan" is called explicitely, either after a driver LKM
 was loaded, or on user request (see the "control device" below).
-Add a field to the device instance where the "locators" (in
 terms of the autoconf framework), which describe the actual
 location of the device relatively to the parent bus, can be
 stored. This can be used by the "child detached" function
 for easier bookkeeping (no need to lookup by device instance
 pointer). (An idea for the future is to use this for generation
 of optimized kernel config files - like DEC's "doconfig".)
-Pass the locators tuple describing a device's location to
 various autoconf functions to support the previous. And since
 locators do only make sense in relation to an "interface
 attribute", pass this as well.
-Add helper functions to add/remove supplemental "cfdata"
 arrays. Needed for driver LKMs.

There is some code duplication which will hopefully resolved
when all "submatch"-style functions are changed to accept the
locator argument.
Some more cleanup can take place when config(8) issues more
information about locators, in particular the length and default
values. To be done later.
2004-08-17 22:13:18 +00:00
mycroft 45a21b76f0 Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
  d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
  in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
  FS-specific checks littered throughout the code.  This may be used later to
  make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
  to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
2004-08-15 07:19:54 +00:00
mycroft fbf03babff There is an annoying deadlock that goes like this:
* Process A is closing one file descriptor belonging to a device.  In doing so,
  ffs_update() is called and starts writing a block synchronously.  (Note: This
  leaves the vnode locked.  It also has other instances -- stdin, et al -- of
  the same device open, so v_usecount is definitely non-zero.)
* Process B does a revoke() on the device.  The revoke() has to wait for the
  vnode to be unlocked because ffs_update() is still in progress.
* Process C tries to open() the device.  It wedges in checkalias() repeatedly
  calling vget() because it returns EBUSY immediately.

To fix, this:
* checkalias() now uses LK_SLEEPFAIL rather than LK_NOWAIT.  Therefore it will
  wait for the vnode to become unlocked, but it will recheck that it is on the
  hash list, in case it was in the process of being revoke()d or was revoke()d
  again before we were woken up.
* Since we're relying on the vnode lock to tell us that the vnode hasn't been
  removed from the hash list *anyway*, I have moved the code to remove it into
  the DOCLOSE section of vclean(), inside the vnode lock.

In the example at hand, process A was sh(1), process B was a child of init(8),
and process C was syslogd(8).
2004-08-13 22:48:06 +00:00
hannken bc4af00256 Make it compile again for sparc64/DIAGNOSTIC.
All archs should use `cpuid_t ci_cpuid' ...
2004-08-12 12:15:21 +00:00
christos 5647899427 make the reset time a DIAGNOSTIC, and print the cpu#. 2004-08-11 16:25:51 +00:00
jdolecek 9aba366e0b Linux enforces CLONE_VM if CLONE_SIGHAND in clone(2) is specified,
follow the suit - this is intended to be Linux-compatible call
2004-08-08 11:02:10 +00:00
jdolecek 142def6b36 pass the fork flags down the emulation proc fork hook 2004-08-08 11:00:05 +00:00
christos 0b82702558 PR/26468: Andrew Brown: Setting stopfork can panic the kernel.
When stopfork is set, we need to set p_nrlwps, since we are not going to
ber running.
2004-08-07 03:35:55 +00:00
christos 251940a98f Use the P_ZOMBIE macro instead of open-coding it. No functional change. 2004-08-07 03:34:37 +00:00
enami 8d37dcb7dc The different loop variable is no longer necessary due to recent change. 2004-08-05 22:06:48 +00:00
yamt 1e4aff5d38 add missing wakeups in the cases of lock failure.
from Stephan Uphoff, FreeBSD PR/69964.

(http://www.freebsd.org/cgi/query-pr.cgi?pr=69964)
> The LK_WANT_EXCL and LK_WANT_UPGRADE bits act as mini-locks and can block
> other threads.
> Normally this is not a problem since the mini locks are upgraded to full loc
> and the release of the locks will unblock the other threads.
> However if a thread reset the bits without optaining a full lock
> other threads are not awoken.
> This can happens if obtaining the full lock fails because of a LK_SLEEPFAIL,
> or a signal (if lock priority includes PCATCH .. don't think this is used).
2004-08-04 10:37:08 +00:00
yamt 8b4f43c443 - revert a part of the previous which breaks LK_SPIN locks.
(reported by Nicolas Joly on current-users@)
- propagate the previous to spinlock_acquire_count.
2004-08-04 01:16:06 +00:00
yamt c602229c1a when acquiring an exclusive lock,
ensure that no one else have the same lock.
a patch from Stephan Uphoff, FreeBSD PR/69934.

(http://www.freebsd.org/cgi/query-pr.cgi?pr=69934)
>	Upgrading a lock does not play well together with acquiring
>	an exclusive lock and can lead to two threads being
>	granted exclusive access.
>
>	Problematic sequence:
>	Thread A acquires a previous unlocked lock in shared mode.
>	Thread B tries to acquire the same lock in exclusive mode
>	and blocks.
>	Thread A upgrades its lock - waking up thread B.
>	Thread B wakes up and also acquires the same lock as it only checks
>	if the lock is not shared or if someone wants to upgrade the lock
>	and not if someone already upgraded the lock to an exclusive lock.
2004-08-03 12:08:51 +00:00
jdolecek 41405858b3 bump the number of allowed sections to 1024; e.g. SuSE 9.1 packaged
Mozilla 1.6 has 726 sections
2004-08-01 22:16:19 +00:00
lukem 66ff0c053c Rename LIBCOMPAT* -> SYSLIBCOMPAT*, now that <bsd.own.mk> provides LIBCOMPAT.
Fixes kernel link problem noted by Sebastien Erard.
2004-07-31 00:55:51 +00:00
atatat 91e4762204 The message buffer datum instrumented by KERN_MSGBUFSIZE is actually a
long, not an int, and this causes "problems" on LP64be machines
(sparc64, etc).  Assign the value to a temporary int and instrument
that instead.  Should be fine until someone wants a message buffer
larger than two gigabytes.
2004-07-27 12:46:18 +00:00
yamt 1e19d56b66 m_pulldown: fix mbuf leaks and chain truncation
in the case that m_dup() returns a chain of mbufs.
eg. when you attempt to m_pulldown() the middle of
a large M_EXT mbuf.
2004-07-21 12:09:43 +00:00
yamt 7af0699fdd m_copyback: add an assertion to detect write attempts to a read-only mbuf. 2004-07-21 12:06:46 +00:00
he afe2341535 Cast register type via intptr_t before cast to pointer.
Fixes build problem for evbsh5.
2004-07-20 14:56:10 +00:00
chs 423159120b add support for hppa to the MI scheduler activations kernel code:
- on hppa the stack grows up, so handle that using the STACK_* macros.
2004-07-18 21:29:26 +00:00
mycroft 4605cec510 PRIBIO -> PSOCK. This emulates the pre-sys_pipe behavior, and avoids including
processes blocked on pipe I/O in the load average.
2004-07-17 20:50:08 +00:00
yamt 118553b061 sa_release: NULL out l_savp to avoid having a stale reference to per-vp data.
it matters when an application using SA does exec() an application which also
uses SA.  (firefox 0.9 seems to do this.)
2004-07-06 12:23:40 +00:00
pk a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
manu 26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
yamt fb277865d7 bump sb_timeo from short to int to allow longer timeouts.
especially when hz is high.

while i'm here, bump sb_flags to int, as suggested by
Jason Thorpe and Bill Studenmund.

ride on 2.0G.
2004-07-01 12:42:57 +00:00
yamt 0f3ce64ad4 statclock: don't assume hz==100 when determining frequency to call schedclock. 2004-07-01 12:36:57 +00:00
hannken f59f039ea5 Keep a pointer to the leaf mount. Needed for write gating where a
file system gets suspended and has layered mounts above it.

Welcome to 2.0G

Reviewed by: Bill Studenmund <wrstuden@netbsd.org>
2004-07-01 10:03:29 +00:00
fredb 430f0ecf15 Multiply before divide, correcting a mistake introduced by revision 1.7.
The loss of precision could be significant in some cases.
2004-06-27 15:21:30 +00:00
yamt ce02ffbc68 introduce a new function, cache_lookup_raw(), for filesystems which
want more flexible namecache handling.
it just looks up a dnlc entry and vget() the result vnode.
ie. no automatic entry removal, no automatic vnode locking.

discussed on tech-kern@.
2004-06-27 08:50:44 +00:00
fredb ca3c6f824f Partly back out the last, to avoid a deadlock when microtime() is called
from levels below IPL_CLOCK (pointed out by thorpej). Just take the lock
before reading the time and cycle counter.
2004-06-27 01:36:04 +00:00
chs a4bbde95f7 add a workaround for PR 25664 (failure to map sigcode for Tru64 binaries). 2004-06-27 00:55:08 +00:00
chs a77ca34b8a rearrange the handling of p_textvp so that the ref-counting is correct.
fixes PR 25663.
2004-06-27 00:41:03 +00:00
fredb f17b436426 Take the lock earlier, before reading the cycle counter, so that it
doesn't advance while we're waiting on the lock. In fact, try to take
the lock even before blocking interrupts: the lock is locking "lasttime"
against other callers of cc_microtime(), not against the clock routines,
and if we take a clock interrupt while waiting for the lock, that's one
we don't have to take after the computations, but before returning to
the caller, and that makes the data a little fresher to the caller.

Moreover, inverting the order of splXXX() and simple_lock() permits us
to unblock interrupts before doing the long division.

With this, finally, performance of "ntpd" on my MP i386 seems to be no
worse than on non-MP i386, so this may fix PR kern/24207.
2004-06-26 16:31:33 +00:00
christos 39e498b419 Explain why the comment is a lie. 2004-06-24 15:06:35 +00:00
jonathan 5249b5a2a5 Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c
2004-06-24 04:15:50 +00:00
christos 7e8ca29827 Fix a panic induced by forcing ktrace to inject an emul record on
a ktraced file descriptor that has already been invalidated. Change
all ktrace functions to propagate the error from ktrwrite() and
check for it. Thanks to Pavel Cahyna for finding this and giving
a perfect bug report.

[should be pulled up for 2.0]
2004-06-23 23:05:48 +00:00
christos 0fe4a0b07a Don't check for negative offset in the memory case. 64 bit addresses can
have the high bit set, and thus be interpreted as negative offsets. This
is not a problem because uvm_io() does all the range checks.
2004-06-22 02:06:55 +00:00
hannken 7a5be5a9ff - Add flag L_COWINPROGRESS to struct lwp to avoid recursion when
doing copy-on-write.

- Change VFS_SNAPSHOT() to return the snapshot vnode locked.

- Make the IO path for copy-on-write and snapshot-read more lightweight.
  Avoids deadlocks where vn_rdwr(...READ...) has a shared lock and needs
  to copy-on-write.
  Avoids deadlocks/panics where to clean pages the copy-on-write needs
  to allocate pages for its VOP_PUTPAGES().

L_COWINPROGRESS part approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-06-20 18:55:58 +00:00
thorpej 3183ea47c2 When initializing the buffer cache memory pools where the size <= PAGE_SIZE,
also use the standard allocator on systems that use a direct-mapped memory
segment for mapping pool pages.
2004-06-20 18:29:47 +00:00
thorpej 3cd310ba0f Remove PR_IMMEDRELEASE, since setting the high water mark will achieve
the same thing.

Pointed out back in January by YAMAMOTO Takashi.
2004-06-20 18:19:27 +00:00
thorpej bbbb3183d6 Don't use PR_IMMEDRELEASE on buffer cache pools. Instead, set a high
water mark of 1, which will have the same effect.

Pointed out back in January by YAMAMOTO Takashi.
2004-06-20 18:17:09 +00:00
fredb c6f9967d69 Introduce a variable "cc" to hold the cpu counter delta, rather than
overloading "usec". The counter isn't counting micro-seconds, and using
the same variable to mean two different things is false economy: with
this change, the compiled object is 72 bytes smaller on i386, and the
code is easier to understand, to boot.
2004-06-19 20:02:38 +00:00
yamt 8a2c13021f cache_lookup: avoid to grab two vnode's v_interlock.
just hold a reference (usecount) to a vnode instead.
2004-06-19 18:49:47 +00:00
fredb e89e654031 Fix a typo in the comments. 2004-06-19 18:12:55 +00:00
yamt 79dd9743cd getcleanvnode: fix spurious ENFILE.
try vnode_hold_list if none of vnodes on vnode_free_list are re-usable.
2004-06-19 06:20:02 +00:00
christos c22e4ed8cd ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM 2004-06-18 15:02:29 +00:00
yamt b3384c452e getcleanvnode: don't try to reclaim a vnode marked as VXLOCK.
fix crashes with VOP_RECLAIM implementations which might block.
(eg. layered filesystems)
2004-06-16 12:35:51 +00:00
yamt a0d352ca6d getcleanvnode: add a comment on a VLAYER hack. 2004-06-16 12:32:51 +00:00
jonathan d907e82ddc Fix potential memory leak in sbappendaddrchain():
We do an MGETHDR)() for each mbuf "packet" of the input chain, to hold
the socket address prepended to that "packet".  If those MGETHDR()s
ever failed, we would leak all the successfully-allocated mbuf
headers.  Leak noted by Yamamoto-san (yamt@NetBSD.org); thanks for catching it!

Add socketbuf invariant-checking macros to sbappendaddrchain(), and
replace a stray bcopy() with memcpy(), also as suggested by Yamamoto-san.
2004-06-11 03:46:01 +00:00
he 32381a5299 PAGE_SIZE is apparently not a constant on the sparc port, so don't
use it in a static initializer.  Instead, initialize in signal_init().
2004-06-08 19:35:30 +00:00
lha a9970d44c9 Return directly when pty_alloc_master failes in ptmioctl,
bug-report on current users from Denis Lagno  dlagno at smtp dot ru.
Make debug message in pty_alloc_master to match the code.
2004-06-05 11:23:15 +00:00
skrll b00b102b41 Allow for struct sigacts being greater than PAGE_SIZE on sun2. sun2
-current kernels now work again.

Reviewed by Matt Thomas. Thanks.
2004-06-04 12:23:50 +00:00
nathanw 956448b619 Initialize simple_lock in struct cwd; otherwise, one gets an
uninitialized lock panic at the first use of cwdshare().
2004-06-03 20:35:30 +00:00
pk 69211c6484 cwdfree() signature has been changed to accomodate fine-grained locking. 2004-05-31 15:33:38 +00:00
pk 2560fefc23 Implement mutexes for file descriptor and current working directory access.
Fix a potential race condition when reallocating storage for file descriptors
(even for non-SMP kernels).
Add missing locks for `struct file' ref count updates.
2004-05-31 15:30:55 +00:00
yamt 2fd3d08b3d lockmgr: add a comment about LK_RETRY. 2004-05-31 09:05:10 +00:00
yamt bd2a784b57 vn_lock: add an assertion about usecount. 2004-05-31 09:02:51 +00:00
yamt 59ba83d898 lockmgr: assert that LK_RETRY is not specified. 2004-05-30 20:49:04 +00:00
yamt c2f93eb91f vn_lock: don't pass LK_RETRY to VOP_LOCK. 2004-05-30 20:48:04 +00:00
jonathan d25d3eb263 Rework to make FAST_IPSEC PF_KEY dumps unicast and reliable:
Introduce new socket-layer function sbappendaddrchain() to
sys/kern/uipc_socket2.c: like sbappendaddr(), only takes a chain of
records and appends the entire chain in one pass. sbappendaddrchain()
also takes an `sbprio' argument, which indicates the caller requires
special `reliable' handling of the socket-buffer.  `sbprio' is
described in sys/sys/socketvar.h, although (for now) the different
levels are not yet implemented.

Rework sys/netipsec/key.c PF_KEY DUMP responses to build a chain of
mbuf records, one record per dump response. Unicast the entire chain
to the requestor, with all-or-none semantics.

Changed files;
 	sys/socketvar.h kern/uipc_socket2.c netipsec/key.c
Reviewed by:
	Jason Thorpe, Thor Lancelot Simon, post to tech-kern.

Todo: request pullup to 2.0 branch.  Post-2.0, rework sysctl() API for
dumps to use new record-chain constructors. Actually implement
the distinct service levels in sbappendaddrchain() so we can use them
to make PF_KEY ACQUIRE messages more reliable.
2004-05-27 19:19:00 +00:00
yamt a08da7645d regen. 2004-05-27 12:50:35 +00:00
yamt 9ae9b45731 update to match with the recent reality: getpages doesn't care about
vnode locks.
2004-05-27 12:49:09 +00:00
christos 3d4ca09443 turn off debugging. 2004-05-27 03:56:49 +00:00
christos 917cdbbd9e Unix 98 pty multiplexor device; original code from OpenBSD. 2004-05-27 02:56:38 +00:00
christos 19c4641ff8 (off_t)(long) is wrong when it comes to kernel addresses [because on a 32 bit
machine if the high bit is set they turn negative]. Make an intermediate cast
to unsigned long.
2004-05-26 16:28:05 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 53c625655c Sysctl descriptions under vfs subtree 2004-05-25 04:44:43 +00:00
atatat 4de3747b89 Sysctl descriptions under net subtree (net.key not done) 2004-05-25 04:33:59 +00:00
atatat 5b22e79ada Remaining sysctl descriptions under kern subtree 2004-05-25 04:30:32 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00