Commit Graph

98 Commits

Author SHA1 Message Date
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
thorpej a06b275edc Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget().  Turns out
  that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
  and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
  above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
  just to appease the above.
2003-06-29 18:43:21 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
simonb 33b48b0823 Micro-optimisation- move the "pgs == NULL" check from the previous
change to immediately after the malloc call.  This can't fail in
the non-malloc case.

Reviewd by YAMAMOTO Takashi.
2003-06-17 04:17:37 +00:00
yamt 424a10b9cc genfs_getpages: if number of pages requested is >16,
use malloc/free for array of pointers to vm_page.
otherwise, use on-stack array as used to.
this change fixes assertion failure when nfsd gets a big read request
that isn't aligned with filesystem block.
discussed on tech-kern.
2003-06-15 16:14:46 +00:00
tls 85c8cfb533 Correct use of MAXBSIZE where MAXPHYS was intended. This is a necessary
first step towards per-device MAXPHYS, and has the beneficial side effect
of allowing clustering to MAXPHYS even on systems that need to run with
a reduced MAXBSIZE to get more metadata buffers.
2003-04-23 00:55:17 +00:00
christos 80ecd573c0 PR/1796: John Kohl: statfs misbehaves under chrooted environments.
- Under chroot it displays only the visible filesystems with appropriate paths.
- The statfs f_mntonname gets adjusted to contain the real path from root.
- While was there, fixed a bug in ext2fs, locking problems with vfs_getfsstat(),
  and factored out some of the vfsop statfs() code to copy_statfs_info(). This
  fixes the problem where some filesystems forgot to set fsid.
- Made coda look more like a normal fs.
2003-04-16 21:44:18 +00:00
jdolecek 98f212db7d use former genfs_eopnotsupp_rele() as genfs_eopnotsupp(), so that vnodes
are vput()/vrele()d as necessary - some filesystems did use the wrong
one for some ops, and it's just safer to not take the chance

based on suggestion by Bill Studenmund
2003-04-10 21:53:32 +00:00
jdolecek 1ac1ffed36 improve genfs_eopnotsupp_rele() so that's usable for vop_rename,
which uses WILLPUT for member which may be NULL
handle correctly dvp == vp case for WILLPUT members, so this works
  for vop_remove, vop_rename

thanks Bill Studenmund for code&comments on this
2003-04-10 21:34:12 +00:00
thorpej eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
perseant b397c875ae Add code to UBCify LFS. This is still behind "#ifdef LFS_UBC" for now
(there are still some details to work out) but expect that to go
away soon.  To support these basic changes (creation of lfs_putpages,
lfs_gop_write, mods to lfs_balloc) several other changes were made, to
wit:

* Create a writer daemon kernel thread whose purpose is to handle page
  writes for the pagedaemon, but which also takes over some of the
  functions of lfs_check().  This thread is started the first time an
  LFS is mounted.

* Add a "flags" parameter to GOP_SIZE.  Current values are
  GOP_SIZE_READ, meaning that the call should return the size of the
  in-core version of the file, and GOP_SIZE_WRITE, meaning that it
  should return the on-disk size.  One of GOP_SIZE_READ or
  GOP_SIZE_WRITE must be specified.

* Instead of using malloc(...M_WAITOK) for everything, reserve enough
  resources to get by and use malloc(...M_NOWAIT), using the reserves if
  necessary.  Use the pool subsystem for structures small enough that
  this is feasible.  This also obsoletes LFS_THROTTLE.

And a few that are not strictly necessary:

* Moves the LFS inode extensions off onto a separately allocated
  structure; getting closer to LFS as an LKM.  "Welcome to 1.6O."

* Unified GOP_ALLOC between FFS and LFS.

* Update LFS copyright headers to correct values.

* Actually cast to unsigned in lfs_shellsort, like the comment says.

* Keep track of which segments were empty before the previous
  checkpoint; any segments that pass two checkpoints both dirty and
  empty can be summarily cleaned.  Do this.  Right now lfs_segclean
  still works, but this should be turned into an effectless
  compatibility syscall.
2003-02-17 23:48:08 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
christos 3908d39e06 step 3. Assign lwp properly if null, so that we can PHOLD without segfaulting. 2003-01-21 00:01:14 +00:00
thorpej b78f59b443 Merge the nathanw_sa branch. 2003-01-18 08:51:40 +00:00
yamt bbbe3e07d7 genfs_compat_gop_write: set uio_iovcnt correctly. 2002-11-15 14:01:57 +00:00
yamt ac3a01e67e use B_ASYNC for children of nested buffers in genfs_getpages.
ok'ed by Chuck Silvers.
2002-10-25 05:44:41 +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
fvdl eb485a7e27 Use B_ASYNC in the !PGO_SYNCIO case. Gets back most, if not all, NFS
read throughput performance lost since the introduction of UBC. Spotted
by YAMAMOTO Takashi, many thanks to him.
2002-10-21 15:21:35 +00:00
enami 9e1deeab34 Add missing pageq lock while uvm_pagefree() is called (either directly
or indirectly).  Reviewed by chuq.
2002-05-29 11:04:39 +00:00
enami 1578726840 Just give up to do readahead rather than waiting busy pages.
While I'm here, added few patchable variable so that one can
easily measure readahead behaviour.
2002-05-18 02:54:57 +00:00
perseant 3fa1c8abe9 Protect v_synclist with splbio(); note that LIST_REMOVE is not an idempotent
operation if more than one LIST_REMOVE happens on interrupt, so both the test
for VONWORKLIST and the LIST_REMOVE(vp, v_synclist) need to be in splbio().
2002-05-14 19:37:18 +00:00
enami 293906a53a Redo rev. 1.57 a bit different way; don't use `tpg' since it may be freed.
Subtract the number of pages behind us when calculating new offset instead.
2002-05-10 07:51:37 +00:00
enami 911c9febb2 Don't modify the local variable `n' in genfs_putpages(). It should contain
the number of elements in the page array at the beginning of every iteration.
2002-05-10 02:51:44 +00:00
enami e3cc9c0682 When traversing by list, if the page next to us is a page in the cluster,
advance the pointer.
2002-05-09 07:22:09 +00:00
enami fabaf9a730 - In genfs_putpages(), no need to restrict the cluster within the given
region.
- In uvm_aio_aiodone(), remove assertions no longer true.
2002-05-09 07:14:37 +00:00
enami 8876669f4c Since npages may includes number of pages behind us, we can't use it to
update current offset.  Instead, use the last page in the run of pages
to calculate new offset.
2002-05-06 00:42:22 +00:00
enami e6513c283e Stylistic change; introduce new local variable and use it instead of
sprinkling different expression to test if we're pagedaemon.
2002-05-06 00:18:15 +00:00
enami 6335b88f05 We don't need to re-activate page in genfs_putpages() when GOP_WRITE returns
ENOMEM (temporary memory shortage) since it is already handled in
uvm_aio_aiodone() for both async/sync case.  Discussed with chuq.
2002-04-26 03:57:31 +00:00
enami 6cfcfb947c genfs_{compat_}getpages(): For PGO_LOCKED request, it is safe to return
read only page if it was due to read fault.  This avoid many unnecessary
read fault introduced by recent nfs_bio.c change.  Reviewed by chuq.
2002-04-16 06:05:05 +00:00
enami 08625200a0 KNF and other misc. cosmetic changes. 2002-04-16 06:00:46 +00:00
chs 72c455ce83 in genfs_compat_getpages(), clear any part of a page that
VOP_READ() doesn't fill in (eg. because it's past EOF).
2002-03-22 03:51:51 +00:00
atatat 31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
chs a51be40dcb don't yield the cpu in genfs_putpages() if we're the pagedaemon.
pointed out by enami.  fixes PR 15784.
2002-03-02 06:58:01 +00:00
enami 9a623b9870 Don't use MALLOC for variable sized allocation. 2002-02-20 06:16:22 +00:00
chs 96f907f394 fix two problems:
- when yielding the cpu while using the vnode's page list, use a marker page
   to keep our place in the list (like the other cases where we drop the lock).
 - wait until no one else has the page busy before deciding if the page needs
   to be cleaned.  a page will be dirty while it's being initialized but will
   be marked clean before PG_BUSY is cleared.
both found by enami.
2002-02-19 15:49:39 +00:00
enami fe24174a3b Don't bother to subtract 0. 2002-02-13 05:20:41 +00:00
enami 52a2a21502 Don't leave junk in pgs[] array since it will be passed to uvn_findpages()
again.
2002-02-12 01:08:12 +00:00
chs 0365a63944 in genfs_putpages():
- yield the cpu if we've taken too long.
 - when traversing by offset, skip over any pages that we clustered.
2002-01-26 02:44:27 +00:00
chs 03ea276e84 in genfs_gop_write(), actually set the B_ASYNC flag on buffers that we're
not going to wait for.  this doesn't matter for real devices since we call
VOP_STRATEGY() directly, but NFS uses this flag to decide whether or not
to hand the buffer off to an nfsiod thread.
2001-12-31 06:44:58 +00:00
chs 64b0c2adbb in genfs_putpages(), we must wait for any pending write i/os to complete
if the putpages request is synchronous.
2001-12-31 06:40:08 +00:00
chs 40bf5f0e12 add some compatibility routines to allow mmap() to work non-UBCified
filesystems (in the same non-coherent fashion that they worked before).
2001-12-18 07:49:36 +00:00
chs 4d14671458 add VOP_GETPAGES and VOP_PUTPAGES methods for layered filesystems.
drop the interlock on the upper layer, acquire the interlock on the
lower layer.
2001-12-06 04:29:23 +00:00
chs 5a690c92a1 add a VOP_PUTPAGES method for all the filesystems that don't have pages,
just unlock the interlock.
2001-12-06 04:27:40 +00:00
christos 420771d7cc PR/14781: Matthew Fredette: Clamp the number of read-ahead pages to 16 because
other code has this limit. Also while I am here, convert the magic 16 into
a #define constant and use it in the appropriate places. This is a temporary
fix, since all this read-ahead business is XXXUBC anyway.
2001-11-30 15:18:39 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem e4b00f433c add RCSIDs 2001-11-10 13:33:40 +00:00
enami 6e46b6ec2c s/genfs_do_putpages/genfs_gop_write/ in uvmhist. 2001-10-03 14:13:08 +00:00
chs 4111c37251 when zeroing pages past EOF, don't zero the page containing EOF if it
already contains valid data.  should fix PRs 13361 and 13436.
2001-09-21 07:52:25 +00:00
chs 5f5ac77eff add a forward decl for struct vm_page. 2001-09-15 22:38:40 +00:00