Commit Graph

5303 Commits

Author SHA1 Message Date
Maxim Konovalov
e3243f2bf4 o Correct URL to ELF header documantation.
PR:		kern/98213
Submitted by:	Robert Gogolok
2006-05-31 13:47:32 +00:00
Ed Maste
af8d1678e1 Add sanity checking for QUEUE(3) TAILQs under INVARIANTS (similar to
the LIST checks).  Races may lead to list corruption, which can be
difficult to unravel in a post-mortem analysis.  These checks verify
that the prev and next pointers are consistent when inserting or
removing elements, thus catching any corruption earlier.
2006-05-26 18:17:53 +00:00
Poul-Henning Kamp
56de0c9a17 Add new CONSOLE_DRIVER macro which takes just the name of the console
and constructs the member function names with CPPs' ##.

Do not include the checkc entry as it is going away.
2006-05-26 10:58:39 +00:00
Poul-Henning Kamp
16b1613a31 GC the cn_dbctl_t hook for consoles, it is unused.
This used to make syscons switch to vty0 when we entered DDB but this
was lost in the KDB shuffle.  We may want to bring it back down the road
but it should be done by calling cn_init_t/cn_term_t instead, possibly
with a flag argument saying "Debugger!"
2006-05-26 10:24:00 +00:00
Poul-Henning Kamp
9806934e47 Be less harsh on brueffers eyes :-) 2006-05-26 10:23:05 +00:00
Poul-Henning Kamp
0aa6cf76bf Remove SI_SUB_CONSOLE, porting from 4.4-Lite is no longer an issue. 2006-05-26 10:00:58 +00:00
Ed Maste
1b861e4a10 QUEUE_MACRO_DEBUG is intended for userland code, so don't include checks
that call panic under it.
2006-05-26 02:26:53 +00:00
Ruslan Ermilov
8df65d80e2 GC long unused hostnamelen and domainnamelen.
Submitted by:	Alex Lyashkov <shadow@psoft.net>
2006-05-24 07:54:42 +00:00
David Xu
7b8d821268 Move flag TDF_UMTXQ into structure umtxq, this eliminates the requirement
of scheduler lock in some umtx code.
2006-05-18 08:43:46 +00:00
Paul Saab
6befa6ae1b Allow concurrent read(2)/readv(2) access to a file.
Lock file offset against multiple read calls.

Submitted by:	ups
Obtained from:	Yahoo!
MFC after:	2 weeks
2006-05-16 07:50:54 +00:00
Olivier Houchard
ef4d5877dd Switch to a 64bit time_t, while it's not a big problem to do so.
Suggested by:	imp
2006-05-15 00:17:27 +00:00
Max Laier
a0a9755e09 Update UPDATING and bump __FreeBSD_version for the ip6fw removal. 2006-05-13 06:08:25 +00:00
John-Mark Gurney
b0d081a0b4 drop D_MEMDISK, not used in the tree... 2006-05-12 19:40:54 +00:00
John Baldwin
73dbd3da73 Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
Tor Egge
5ac6cbfdfb Avoid dereferencing NULL pointer. 2006-05-05 19:32:35 +00:00
Marcel Moolenaar
8f405ed335 Remove the puc-specific hacks. The puc(4) driver now properly uses
the rman(9) interface.
2006-04-28 21:23:09 +00:00
Jeff Roberson
6ca9fcc586 - Add a BO_NEEDSGIANT flag to the bufobj. This flag forces all child
buffers to go on the buf daemon's DIRTYGIANT queue.
 - Set BO_NEEDSGIANT on ffs's devvp since the ffs_copyonwrite handler
   runs in the context of the buf daemon and may require Giant.
2006-04-28 01:05:31 +00:00
Robert Watson
1d82b39143 Reconstitute struct mac_policy_ops by breaking out individual function
pointer prototypes from it into their own typedefs.  No functional or
ABI change.  This allows policies to declare their own function
prototypes based on a common definition from mac_policy.h rather than
duplicating these definitions.

Obtained from:	SEDarwin, SPARTA
MFC after:	1 month
2006-04-26 14:18:55 +00:00
Daniel Eischen
1aaee95a1d Bump __FreeBSD_version to reflect the addition of fcloseall() to libc. 2006-04-22 15:12:50 +00:00
Paul Saab
4f590175b7 Allow for nmbclusters and maxsockets to be increased via sysctl.
An eventhandler is used to update all the various zones that depend
on these values.
2006-04-21 09:25:40 +00:00
John-Mark Gurney
be4db476a6 const'ify resource_spec to note that we won't be changing anything while
releasing resources... also, NULL out the resources as we free them...
2006-04-20 01:44:16 +00:00
John Baldwin
fea3efe5bf Implement rw_try_upgrade() and rw_downgrade(). rw_try_upgrade() makes a
single attempt at upgrading a read lock to a write lock, and rw_downgrade()
converts curthread's write lock into a read lock.
2006-04-19 21:06:52 +00:00
John Baldwin
62375b03cd Update comments to mention that each turnstile contains two queues and to
describe turnstile_disown() and turnstile_empty().
2006-04-18 18:21:38 +00:00
John Baldwin
f1a4b852dc - Bring back turnstile_empty() which can check to see if an individual
queue on a turnstile is empty.
- Add a turnstile_disown() function that allows a thread to give up
  ownership of a turnstile w/o waking up any waiters.
2006-04-18 18:16:54 +00:00
Xin LI
4207c279d4 In vfs_hash_get(): mount point should never be changed
so explicitly constify the mp parameter.

Reviewed by:	phk
2006-04-18 08:05:08 +00:00
John Baldwin
efff0b01b6 Update comments to indicate that locks are held by threads, not processes. 2006-04-17 20:17:09 +00:00
John Baldwin
2971c36136 Add a new module_file() function that returns the linker_file_t associated
with a given module_t.  I use this in some the MOD_LOAD event handler for
some test kernel modules to ask the kernel linker to look up the linker
sets in my test modules. (I use linker sets to generate the list of
possible events that I then signal to execute via a sysctl.  On non-amd64,
ld(8) would resolve the entire linker set, but on amd64 I have to ask the
kernel linker to do it for me, and having the kernel linker do it works on
all archs.)
2006-04-17 19:44:44 +00:00
Sam Leffler
587070382a backout rev 1.74
Requested by:	ssouhlal
2006-04-07 05:16:02 +00:00
Christian S.J. Peron
7935d5382b Introduce a new MAC entry point for label initialization of the NFS daemon's
credential: mac_associate_nfsd_label()

This entry point can be utilized by various Mandatory Access Control policies
so they can properly initialize the label of files which get created
as a result of an NFS operation. This work will be useful for fixing kernel
panics associated with accessing un-initialized or invalid vnode labels.

The implementation of these entry points will come shortly.

Obtained from:	TrustedBSD
Requested by:	mdodd
MFC after:	3 weeks
2006-04-06 23:33:11 +00:00
Suleiman Souhlal
90e72822ac Replace FILEDESC_[UN]LOCK_FAST() with a critical section on UP.
Gives a small but measurable performance improvement.

Submitted by:	Divacky Roman <xdivac02@stud.fit.vutbr.cz>
MFC after:	1 month
2006-04-06 16:27:48 +00:00
David Xu
9d9b92aaf4 WARNS level 4 cleanup, still has work to do. 2006-04-04 02:57:09 +00:00
Robert Watson
bc725eafc7 Chance protocol switch method pru_detach() so that it returns void
rather than an error.  Detaches do not "fail", they other occur or
the protocol flags SS_PROTOREF to take ownership of the socket.

soclose() no longer looks at so_pcb to see if it's NULL, relying
entirely on the protocol to decide whether it's time to free the
socket or not using SS_PROTOREF.  so_pcb is now entirely owned and
managed by the protocol code.  Likewise, no longer test so_pcb in
other socket functions, such as soreceive(), which have no business
digging into protocol internals.

Protocol detach routines no longer try to free the socket on detach,
this is performed in the socket code if the protocol permits it.

In rts_detach(), no longer test for rp != NULL in detach, and
likewise in other protocols that don't permit a NULL so_pcb, reduce
the incidence of testing for it during detach.

netinet and netinet6 are not fully updated to this change, which
will be in an upcoming commit.  In their current state they may leak
memory or panic.

MFC after:	3 months
2006-04-01 15:42:02 +00:00
Robert Watson
ac45e92ff2 Change protocol switch pru_abort() API so that it returns void rather
than an int, as an error here is not meaningful.  Modify soabort() to
unconditionally free the socket on the return of pru_abort(), and
modify most protocols to no longer conditionally free the socket,
since the caller will do this.

This commit likely leaves parts of netinet and netinet6 in a situation
where they may panic or leak memory, as they have not are not fully
updated by this commit.  This will be corrected shortly in followup
commits to these components.

MFC after:      3 months
2006-04-01 15:15:05 +00:00
Robert Watson
c43a4e8a83 Add a comment describing SS_PROTOREF in detail. This will eventually be
in socket(9).

MFC after:	3 months
2006-04-01 10:54:51 +00:00
Søren Schmidt
cd8a592bb3 Make the ATAPI sense data accessible when using the ioctl interface
MFC candidate.
2006-03-31 08:09:05 +00:00
Jeff Roberson
9eee260594 - Define mnt_startzero and mnt_endzero as a range that excludes mnt_mtx
and mnt_lock so that the mountpoint can be explicitly zeroed on
   creation.

Discussed with: tegge
Tested by:      kris
Sponsored by:   Isilon Systems, Inc.
2006-03-31 03:49:16 +00:00
Jeff Roberson
084d64ac21 - Add the B_NEEDSGIANT flag which is only set if the vnode that owns a buf
requires Giant.  It is set in bgetvp and cleared in brelvp.
 - Create QUEUE_DIRTY_GIANT for dirty buffers that require giant.
 - In the buf daemon, only grab giant when processing QUEUE_DIRTY_GIANT and
   only if we think there are buffers in that queue.

Sponsored by:	Isilon Systems, Inc.
2006-03-31 02:56:30 +00:00
Marcel Moolenaar
1d9c4393ff o Don't make the SER_INT_* defines visible to userland. They
are related to internals, not user-visible state.
o  Add a typedef for serdev_intr_t and protect it with !LOCORE.
2006-03-30 17:24:42 +00:00
John Baldwin
8346951353 Style fix. 2006-03-30 15:48:06 +00:00
John Baldwin
1aa4d65200 Move the PC_TO_I() and KCOUNT() macros so they aren't GUPROF specific
since they operate on fields of struct gmonparam which is not GUPROF
specific.

Approved by:	bde
Reported by:	alc
2006-03-29 18:17:03 +00:00
Joseph Koshy
7aa1f640f5 Remove unused symbols. 2006-03-28 16:20:29 +00:00
Dag-Erling Smørgrav
867c089bc7 Revert previous commit at davidxu's insistance. Instead, use __DECONST
(argh!) and rearrange the prototypes to make it clear that _umtx_op()
is not deprecated.
2006-03-28 14:32:38 +00:00
Dag-Erling Smørgrav
b3efbabe87 The undocumented and deprecated system call _umtx_op() takes two pointer
arguments.  The first one is never used (all callers pass in 0); the
second is sometimes used to pass in a struct timespec * which is used as
a timeout and never modified.  Constify that argument so callers can pass
a const struct timespec * without jumping through hoops.
2006-03-28 09:18:34 +00:00
Robert Watson
d9949cb211 Declare regression subtree in sysctl.h so that components outside of
kern_mib.c can easily add regression sysctls.

MFC after:	1 month
2006-03-26 22:29:45 +00:00
Joseph Koshy
49874f6ea3 MFP4: Support for profiling dynamically loaded objects.
Kernel changes:

  Inform hwpmc of executable objects brought into the system by
  kldload() and mmap(), and of their removal by kldunload() and
  munmap().  A helper function linker_hwpmc_list_objects() has been
  added to "sys/kern/kern_linker.c" and is used by hwpmc to retrieve
  the list of currently loaded kernel modules.

  The unused `MAPPINGCHANGE' event has been deprecated in favour
  of separate `MAP_IN' and `MAP_OUT' events; this change reduces
  space wastage in the log.

  Bump the hwpmc's ABI version to "2.0.00".  Teach hwpmc(4) to
  handle the map change callbacks.

  Change the default per-cpu sample buffer size to hold
  32 samples (up from 16).

  Increment __FreeBSD_version.

libpmc(3) changes:

  Update libpmc(3) to deal with the new events in the log file; bring
  the pmclog(3) manual page in sync with the code.

pmcstat(8) changes:

  Introduce new options to pmcstat(8): "-r" (root fs path), "-M"
  (mapfile name), "-q"/"-v" (verbosity control).  Option "-k" now
  takes a kernel directory as its argument but will also work with
  the older invocation syntax.

  Rework string handling in pmcstat(8) to use an opaque type for
  interned strings.  Clean up ELF parsing code and add support for
  tracking dynamic object mappings reported by a v2.0.00 hwpmc(4).

  Report statistics at the end of a log conversion run depending
  on the requested verbosity level.

Reviewed by:	jhb, dds (kernel parts of an earlier patch)
Tested by:	gallatin (earlier patch)
2006-03-26 12:20:54 +00:00
Warner Losh
f9c68c6334 The year field is the 4 digit year (eg, 2006), not 'year - 1900' (eg
106).  Fix the comment to reflect this.
2006-03-24 06:27:34 +00:00
David Xu
177e987e63 Regenerate. 2006-03-23 08:48:37 +00:00
David Xu
53fcc63c10 Add aio_fsync() prototype. 2006-03-23 08:47:28 +00:00
Poul-Henning Kamp
cc548bd9fb Remove nested includes of <sys/_lock.h> and <sys/_mutex.h> which spill into
userland.  The comment indicated that something in userland needed them, but
make universe can't seem to find any traces of it.

Move <sys/queue.h> include up.
2006-03-16 11:19:36 +00:00
Robert Watson
92c07a345e Change soabort() from returning int to returning void, since all
consumers ignore the return value, soabort() is required to succeed,
and protocols produce errors here to report multiple freeing of the
pcb, which we hope to eliminate.
2006-03-16 07:03:14 +00:00