Commit Graph

514 Commits

Author SHA1 Message Date
simonb c475865f39 Just use the "time" variable in the *_getattr functions instead of a call
to (the potentially expensive) microtime().
2002-08-03 04:52:44 +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
chs e697956ce6 we can't use the vnode's v_usecount to track how many times the vnode
has been VOP_OPEN()'d.  if the fifo is being accessed via a layered fs,
v_usecount is always one (representing the hold by the layered vnode)
regardless of how many times the vnode has been opened.  instead, keep a
separate counter for opens.  fixes PR 17195 and probably 17724.
2002-07-27 16:43:36 +00:00
jdolecek 02eb342b57 Make sure that the pointer to old parent process for ptraced children
gets reset properly when the old parent exits before the child. A flag
is set in old parent process when the child is reparented in ptrace(2).
If it's set when process is exiting, all running processes have their
'old parent process' pointer checked and reset if appropriate. Also
change to use 'struct proc *' pointer directly, rather than pid_t.
This fixes security/14444 by David Sainty.

Reviewed by Christos Zoulas.
2002-07-25 20:04:02 +00:00
jdolecek 9c55530336 Properly detect error in kernfs_xread().
Fixes kern/10278 by IWAMOTO Toshihiro, though implemented different way.

While here, clean up some int vs. size_t confusion, make
kernfs_x{read|write}() static and g/c some #if 0 stuff.
2002-07-19 18:35:44 +00:00
wiz 4b20971f01 Spell acquire with a 'c'. 2002-07-10 23:16:32 +00:00
lukem b8e7104984 be consistent about how va_[acm]time is set to the current time
(inspired by how procfs does it)
2002-07-05 03:24:06 +00:00
lukem 20657af5c3 set vap->va_ctime to vap->va_atime (the current time),
rather than vap->va_ctime (which is a no-op).
2002-07-05 02:02:00 +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
matt ea5cd1699b Extern speclisth 2002-05-12 20:42:03 +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
thorpej f1f51aa2b8 Move code shared by procfs and the kernel proper out of procfs and
into the kernel proper (renaming functions from procfs_* to process_*).
2002-05-09 15:44: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
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
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
jdolecek 83bb6f6dd7 Changes to make it less likely to need to be revisited later again:
* fdesc_attr(): don't panic for 'unknown' descriptor types, rather use
  (*fp->f_ops->fo_stat)() hook, as for DTYPE_SOCKET and DTYPE_PIPE
  XXX perhaps use different vnode type than VBAD for these?
* fdesc_setattr(): just return 0 regardless of type, rather than paniccing
  for 'unknown' descriptor types
2002-04-02 17:46:06 +00:00
jmc 70ba374a66 Treat pipes like sockets and don't do setattr on them 2002-04-02 10:34:54 +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
christos 5ff60a19d9 Don't hide the real return code with EPERM. 2002-01-12 18:51:56 +00:00
christos 5266303896 When checking for permissions, include the P_INEXEC test and return
EAGAIN if the process is exec'ing.
2002-01-12 18:51:31 +00:00
christos 67c310f08c Apply the same P_INEXEC test to avoid the execve/trace problem using
the procfs ptrace calls.
2002-01-11 22:02:56 +00:00
chs 2776bd066f add the entry for layer_getpages() to the VOP tables of the
layered file systems that need it.
2002-01-04 07:19:33 +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 8e9cdbbd63 replace "vnode" and "vtext" with "file" and "exec" in uvmexp field names. 2001-12-09 03:07:43 +00:00
chs 0931f31deb add a VOP_PUTPAGES method for all the filesystems that don't have pages.
do all the work for destroying syncfs vnodes in vfs_deallocate_syncvnode()
to make some new assertions work out.
2001-12-06 04:30:49 +00:00
chs 1361ca58eb be consistent, clear VONWORKLST when we take a syncer vnode off the
syncer list.
2001-12-06 04:29:55 +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
thorpej 03efee5585 * Allow machine-dependent code to specify hooks for ptrace(2)
(__HAVE_PTRACE_MACHDEP) and procfs (__HAVE_PROCFS_MACHDEP).
  These changes will allow platforms like x86 (XMM) and PowerPC
  (AltiVec) to export extended register sets in a sane manner.

* Use __HAVE_PTRACE_MACHDEP to export x86 XMM registers (standard
  FP + SSE/SSE2) using PT_{GET,SET}XMMREGS (in the machdep
  ptrace request space).
* Use __HAVE_PROCFS_MACHDEP to export x86 XMM registers via
  /proc/N/xmmregs in procfs.
2001-12-05 00:58:05 +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 7b7e3f6b7e Wrap long line and remove name of argument from function prototype. 2001-11-07 04:56:09 +00:00