Commit Graph

600 Commits

Author SHA1 Message Date
hannken a3a898ff0f Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>
2003-10-15 11:28:59 +00:00
dsl b03412ca14 Set vnode size of character disk devices to that of the partition when they
are opened (was always done for block devices).
This means that fstat will report the partition size and hence newfs
needn't grovel into the disklabel to find the filesystem size.
2003-10-15 08:41:26 +00:00
yamt 589e82f2ba terminate snprintb 'new' format strings correctly.
(fixes overrun in mount_*)
2003-10-03 16:34:31 +00:00
mycroft 88dd794c62 Put pfsnode in the #ifdef _KERNEL too, so this actually compiles. 2003-09-27 15:32:50 +00:00
darcy 566d30be44 Changes as discussed with itojun on tech-kern. I have modified the enums
to have KFS or PFS differentiators.  Further I have wrapped the enum in
procfs in "#ifdef _KERNEL" as it is done in kernfs.

To see the discussion go to http://mail-index.NetBSD.org/tech-kern/2003/09/
and look for "Mismatched enums in include files" in the list.
2003-09-27 13:29:02 +00:00
atatat ce41526125 Make kernfs peacefully co-exist with procfs. 2003-09-26 03:08:18 +00:00
yamt 61d5d4362b fix a bug of lfs.
genfs_getpages() can read in more blocks than it should due to faked filesize
of lfs_gop_size().  it's a security problem and it makes gcc3 "internal error"

to fix this,
- in genfs_getpages(), always calculate diskeof and memeof separately
  so that filesystems (in this case, lfs) can use different strategies
  for them.
- introduce GOP_SIZE_MEM flag and use it to request in-core filesize.
  (it was an intention of GOP_SIZE_READ,
  but after the above change _READ is not a straightforward name)

after this, no one uses GOP_SIZE_{READ,WRITE} anymore but leave them for now.
2003-09-24 10:22:53 +00:00
jdolecek a034152027 move dupfd from struct proc to struct lwp - it's per-LWP, not per-process; we
use curlwp where the lwp is not directly available, i.e. in device open
routines

briefly discussed on tech-kern
2003-09-13 08:32:10 +00:00
itojun d963f70264 check before deref kfs_kt 2003-09-10 10:22:45 +00:00
dan d12b78f6df Make /kern/. have linkcount 2 in non-IPSEC case, 4 in IPSEC case.
Thanks to Valeriy E. Ushakov.
2003-09-10 09:59:47 +00:00
itojun 836dd0e3ef check if rootdev/rrootdev actually exists. 2003-09-10 03:56:33 +00:00
itojun e0517a16a6 fix permission of /kern/hostname to 0644 2003-09-10 03:42:07 +00:00
dan 843d91726f test against kt to get the right node of the given type, from enami@ 2003-09-10 03:31:29 +00:00
simonb 6ab489653d 8 spaces is evil, convert to tab. 2003-09-10 03:24:38 +00:00
dan 7e5137f372 Make vnode times on /kern/boottime be the boot time, not "now".
Handy because ls(1) helpfully converts the time to human-readable
format when printing, and because shell tools like "test -nt" and
"find -newer" can be used against it.

"Inspired" by a discussion about removing lockfiles older than the
last reboot, and Al Crooks' handy observation that a close
approximation can be found with /var/run/dmesg.boot

While here, notice that a lot of the kernfs structures and naming
changed suddenly, and though it seems a clear improvement, there was no
mention in commit logs.
2003-09-10 00:45:22 +00:00
itojun 23da4bd394 remove non-precise comment 2003-09-08 10:54:14 +00:00
itojun 8ca90bd4e4 add /kern/ipsecsa and /kern/ipsecsp, which can be inspected by setkey(8).
it allows easier access to ipsecsa/sp.  it works around problem where
setkey -D does not work with large number of ipsec SAs due to socket buffer
size.
2003-09-08 06:51:53 +00:00
itojun dca8daa76d remove meaningless line (variable overwritten 2 lines below) 2003-09-07 00:25:04 +00:00
matt e3bf7b7e7d Adjust to the new calling convention of unp_connect2. 2003-09-04 04:30:25 +00:00
matt ecf95073f1 Change the behavor of AF_LOCAL connect() to sleep until the server has
accepted the connection.  This can prevent a client from overwhelming a
server.
2003-09-03 21:30:12 +00:00
he 25d9b10ee9 Add casts of LINUX_USRSTACK and USRSTACK to handle the cases
where these are not constants.
2003-08-21 23:00:07 +00:00
christos c626c860b1 LINUX_USRSTACK is only defined on i386. Thanks Izumi! 2003-08-09 16:28:49 +00:00
christos a24080409e Only choose the linux usrstack if the netbsd usrstack was higher. 2003-08-09 14:17:28 +00:00
christos 9897a5425c Change the way we compute the top of the stack. This makes java-1.4.2 work. 2003-08-09 13:44:39 +00:00
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
thorpej 3a56e3ea7e Adjust for ktrace/lwp changes. 2003-06-29 02:16:59 +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
hannken 5c19a0665c Change "%qu" to "PRIu64" to make it compile on sparc64. 2003-05-29 08:13:41 +00:00
christos 210944c7de Add /proc/<pid>/stat for linux compat. j2sdk1.4.2 depends on it. 2003-05-28 18:03:15 +00:00
nakayama bbdab69970 Add breaks which were forgotten in rev. 1.2 change.
Inspired from a report by HIRATSUKA Kouichirou in tech-pkg-ja mailing list.
2003-05-08 13:46:50 +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 d864ba0136 fix lkm malloc lossage. 2003-04-22 17:14:12 +00:00
christos 4e4a4c7bc9 Make the mode of /proc/<pid>/fd dr-x------ 2003-04-18 23:19:24 +00:00
christos 11cc5eb2c6 Make symlinks for directories that point to the actual directory.
Make symlinks to [kqueue] and [misc] for kqueue and misc fds.
2003-04-18 21:55:35 +00:00
jdolecek b7b5aac957 change PROCFS_FILENO() to use 5 bits for 'type', since there are more than
16 types nowadays (i.e. Pfd is 17)
2003-04-18 10:00:19 +00:00
jdolecek f331bb3205 do not show nodes corresponding to directory descriptors for process
in fd/ subdirectory, nor allow lookup/open for the nodes
this fixes PR kern/21187 for good, and also avoids interesting directory
locking issues
2003-04-17 20:50:46 +00:00
jdolecek 884bdfdbaf procfs_readdir(): in Pfd case, only show descriptors of types we want
how to represent (vnodes, fifo, pipes); also use fd_getfile() et al

this avoids annoying EOPNOTSUPP error messages from ls -F and such
2003-04-17 20:33:17 +00:00
jdolecek be4c900d41 procfs_lookup(): use fd_getfile() et al in Pfd case 2003-04-17 20:19:18 +00:00
jdolecek ed9a5a7448 use fd_getfile() in procfs_getfp(), and FILE_USE()/FILE_UNUSE() the
returned file descriptor pointer appropriately
2003-04-17 19:04:25 +00:00
jdolecek b5bca36101 g/c, it's outdated and the info wouldn't belong here anyway 2003-04-17 18:14:57 +00:00
jdolecek 64b598bf33 make some local arrays/variables static + const 2003-04-17 18:08:28 +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
dsl b2aefec351 Remove pointless check against PID_MAX. Let pfind() do the validation.
(The new pid allocation code may decide to allocate pids above PID_MAX.)
2003-04-05 23:32:52 +00:00
martin b38f12bdd4 Fix a race condition where a writer could already have closed the fifo
before the reader woke up - this made the reader loop again, waiting
for another writer, even though there was input available.

Thanks to Jaromir for spotting the real cause and sugesting a solution.

This should fix PR port-sparc64/20283.
2003-03-17 00:06:24 +00:00