Commit Graph

190 Commits

Author SHA1 Message Date
lukem 0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
thorpej b7d2ca250a Fix signed/unsigned comparison warnings. 2002-11-07 08:13:10 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
christos 6f3945a88d MNT_GETARGS support 2002-09-21 18:10:34 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
soren 178d83d503 Die, qaddr_t, die! - mnt_data in struct mount is already effectively
a void *, so stop pretending otherwise.
2002-07-30 07:40:07 +00:00
drochner f5b492e186 use CD session offset from the disklabel, if present 2002-05-27 16:44:37 +00:00
thorpej 37dc008ca3 Cleanup how file system configuration information is declared, grouping
related information together, with the file system code itself.

This is just low-hanging fruit -- more to come.
2002-04-16 23:14:05 +00:00
drochner fe52be52a6 Add the actual session offset to the volume size. This makes
a) the "df" output not an underestimate (Multisession cd filesystems can
   refer to data in previous sessions)
b) some checks where a block number is compared against the volume size
   succeed - I got mysterious misbehaviour with RR extensions
2002-03-26 19:04:23 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
perry 2928420f88 delint -- you can't cast an lvalue 2001-11-17 18:56:46 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
sommerfeld 9ce108757e use fifo_putpages 2001-09-22 22:49:32 +00:00
chs 520b477a5a check early for reads beyond EOF. 2001-09-22 22:44:08 +00:00
chs 64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
chs adf5d360a7 add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl.  file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value.  the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
2001-09-15 16:12:54 +00:00
chs f0af9f581b add getpages/putpages entries for spec vnodes. 2001-08-17 05:54:36 +00:00
wiz a9356936b4 seperate -> separate 2001-07-22 13:33:58 +00:00
jdolecek aa912c8ec5 Call inittodr(0) on end of cd9660_mountroot(), so that system time is properly
reset to value presented by system battery-backed clock.
Fixes kern/13364 by Rob Quinn.
2001-07-07 14:53:55 +00:00
toshii 4866f1a22b Fix typo. s/extention/extension/ 2001-07-05 08:38:24 +00:00
mrg c13e3a6693 use _KERNEL_OPT 2001-05-30 11:40:35 +00:00
chs 45701591c6 add a genfs_mmap() and change all of the disk-based filesystems
to implement VOP_MMAP() with the genfs version, in preparation for
actually using this VOP.
2001-05-28 02:50:51 +00:00
fvdl ad5dcb280f Same change as in the UFS code: unlock vnode before setting v_op
to spec_vnode_ops. From Bill Studenmund.
2001-03-23 21:10:48 +00:00
chs 060e70db41 min() -> MIN(), max() -> MAX().
fixes more problems with file offsets > 4GB.
2001-02-27 04:37:44 +00:00
tsutsui 5fcd0b2c38 Declare prtactive extern. 2001-02-03 12:48:43 +00:00
jdolecek d3660a5f79 make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const 2001-01-22 13:18:29 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
enami 7daeeec54d Set the size of vnode so that reading cdrom over nfs works. 2000-12-21 03:42:43 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
thorpej e6f6181e82 NBPG -> PAGE_SIZE 2000-11-14 22:26:32 +00:00
ad 642267bcc7 Update for hashinit() change. 2000-11-08 14:28:12 +00:00
thorpej b94e29816f MALLOC()/FREE() are not to be used for variable sized allocations. 2000-08-03 03:39:52 +00:00
jdolecek 24c327fe78 Add an option to do case-insensitive lookups even on Rock-Ridge CD-ROMS.
Add 'rrcaseins' option to mount_cd9660(8).

This addresses kern/2419 by Jason Downs.
2000-07-15 21:40:42 +00:00
jdolecek e7d7ef2275 one less - though we don't have 'notrans', we have 'nomaplcase' now 2000-07-15 21:37:50 +00:00
jdolecek 943f329ed7 add a new mount flag ISOFSMNT_NOCASETRANS - if set, the file names are not
translated to lower case
2000-05-27 16:03:55 +00:00
scw f27dcc92e2 Apply a late patch submitted by the author of PR kern/7951 (Joachim
Kuebart) which modifies the behaviour of cd9660 filesystem support to
favour using RockRidge extensions in place of Joliet if both formats
are present on a CD-ROM.
2000-05-10 20:35:35 +00:00
augustss 1469ed1614 Kill more register declarations. 2000-03-30 12:13:30 +00:00
simonb 289a50f572 Delete redundant decl of isodirino(), it's in cd9660_extern.h. 2000-03-30 02:11:09 +00:00
simonb bd11640b2c Remove redundant decl of rootvp - it's in <sys/systm.h>. 2000-03-29 04:03:08 +00:00
simonb 9ff7681a33 Don't need to include <sys/conf.h> here. 2000-03-29 03:43:31 +00:00
jdolecek 89015c4648 Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading. This fixes random panics
when LKM for filesystem using pools was loaded and unloaded several
times.

For each leaf filesystem, add appropriate vfs_done routine.
2000-03-16 18:08:17 +00:00
scw ebb1e2f6d4 Add calls to vn_lock() and VOP_UNLOCK() around the VOP_CLOSE() call
in iso_mountfs() to avoid a "panic: lockmgr: locking against myself"
when vrele() is called due to the mount having failed.

This fixes PR/9058.
2000-01-11 09:04:50 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
enami fee96e1746 Check if the type of device node isn't VBAD before touching v_specinfo. If
the device vnode is revoked, the field is NULL and touching it causes null
pointer derefercence.
1999-10-20 14:32:09 +00:00
wrstuden e682a080e9 In spec_close(), if we're not doing a non-blocking close and VXLOCK is
not set, unlock the vnode before calling the device's close routine and
relock it after it returns. tty close routines will sleep waiting for
buffers to drain, which won't happen often times as the other side needs
to grab the vnode lock first.

Make all unmount routines lock the device vnode before calling VOP_CLOSE().
1999-10-16 23:53:26 +00:00
jdolecek 16cafff36c Adapt to cache_lookup() changes (forgot to commit it yesterday) 1999-09-06 10:10:05 +00:00
wrstuden 169a5eda2d Pull in changes which parallel rev 1.22 -> 1.25 of ufs_lookup(). 1999-08-04 18:40:47 +00:00
wrstuden 3bf14d81e9 Add support for fcntl(2) to generate VOP_FCNTL calls. Any fcntl
call with F_FSCTL set and F_SETFL calls generate calls to a new
fileop fo_fcntl. Add genfs_fcntl() and soo_fcntl() which return 0
for F_SETFL and EOPNOTSUPP otherwise. Have all leaf filesystems
use genfs_fcntl().

Reviewed by: thorpej
Tested by: wrstuden
1999-08-03 20:19:16 +00:00
wrstuden 976aedb7ac Adjust mountroot routines to vrele rootvp in case of mount error. Closes
PR 7977 by Neil Carson, <neil@brini.com>.
1999-07-17 01:08:28 +00:00