Commit Graph

284 Commits

Author SHA1 Message Date
phk
1b989193f4 vnops megacommit
1.  Use the default function to access all the specfs operations.
2.  Use the default function to access all the fifofs operations.
3.  Use the default function to access all the ufs operations.
4.  Fix VCALL usage in vfs_cache.c
5.  Use VOCALL to access specfs functions in devfs_vnops.c
6.  Staticize most of the spec and fifofs vnops functions.
7.  Make UFS panic if it lacks bits of the underlying storage handling.
1997-10-15 13:24:07 +00:00
phk
edde284e45 Hmm, realign the vnops into two columns. 1997-10-15 10:05:29 +00:00
phk
1069b4583e Stylistic overhaul of vnops tables.
1. Remove comment stating the blatantly obvious.
        2. Align in two columns.
        3. Sort all but the default element alphabetically.
        4. Remove XXX comments pointing out entries not needed.
1997-10-15 09:22:02 +00:00
phk
d38c0e3213 Last major round (Unless Bruce thinks of somthing :-) of malloc changes.
Distribute all but the most fundamental malloc types.  This time I also
remembered the trick to making things static:  Put "static" in front of
them.

A couple of finer points by:	bde
1997-10-12 20:26:33 +00:00
phk
3002600191 Distribute and statizice a lot of the malloc M_* types.
Substantial input from:	bde
1997-10-11 18:31:40 +00:00
kato
f067b60f38 Clustered read and write are switched at mount-option level.
1. Clustered I/O is switched by the MNT_NOCLUSTERR and MNT_NOCLUSTERW
   bits of the mnt_flag.  The sysctl variables, vfs.foo.doclusterread
   and vfs.foo.doclusterwrite are deleted.  Only mount option can
   control clustered I/O from userland.
2. When foofs_mount mounts block device, foofs_mount checks D_CLUSTERR
   and D_CLUSTERW bits of the d_flags member in the block device switch
   table.  If D_NOCLUSTERR / D_NOCLUSTERW are set, MNT_NOCLUSTERR /
   MNT_NOCLUSTERW bits will be set.  In this case, MNT_NOCLUSTERR and
   MNT_NOCLUSTERW cannot be cleared from userland.
3. Vnode driver disables both clustered read and write.
4. Union filesystem disables clutered write.

Reviewed by:	bde
1997-09-27 13:40:20 +00:00
dyson
46d4489773 Change the M_NAMEI allocations to use the zone allocator. This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half.  The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs.  Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.
1997-09-21 04:24:27 +00:00
phk
2f2ff76e69 Executing binaries on a nullfs (or nullfs-based) filesystem results in
a trap.
PR:		3104
Reviewed by:	phk
Submitted by:	Dan Walters hannibal@cyberstation.net
1997-09-18 18:33:23 +00:00
peter
43726a5e93 Convert select -> poll.
Delete 'always succeed' select/poll handlers, replaced with generic call.
Flag missing vnode op table entries.
1997-09-14 02:58:12 +00:00
phk
de0078c767 Fix a type in a comment and remove some checks now done centrally. 1997-09-10 19:44:36 +00:00
phk
6e1c77bafa This stuff is now done centrally. 1997-09-10 19:43:15 +00:00
bde
291e109fed Removed yet more vestiges of config-time swap configuration and/or
cleaned up nearby cruft.
1997-09-07 16:21:11 +00:00
bde
bab4d1583f Staticized. 1997-09-07 06:46:34 +00:00
bde
b1c7917c66 Some staticized variables were still declared to be extern. 1997-09-07 05:27:26 +00:00
kato
347336b3e2 Support read-only mount. 1997-09-04 03:14:49 +00:00
bde
ec06a8cbcf Removed unused #includes. 1997-09-02 20:06:59 +00:00
kato
b91306ebeb Include "opt_ddb.h" only when NULLFS_DIAGNOSTIC is defined. 1997-08-28 00:44:43 +00:00
kato
51cc097afa Fixed NULLFS_DIAGNOSTIC stuff. 1997-08-27 08:44:43 +00:00
phk
18071ea4d3 Uncut&paste cache_lookup().
This unifies several times in theory indentical 50 lines of code.

The filesystems have a new method: vop_cachedlookup, which is the
meat of the lookup, and use vfs_cache_lookup() for their vop_lookup
method.  vfs_cache_lookup() will check the namecache and pass on
to the vop_cachedlookup method in case of a miss.

It's still the task of the individual filesystems to populate the
namecache with cache_enter().

Filesystems that do not use the namecache will just provide the
vop_lookup method as usual.
1997-08-26 07:32:51 +00:00
dyson
387bc7a58f Back out some incorrect changes that was worse than the original bug. 1997-08-26 04:36:27 +00:00
kato
ffaf1996a4 Added a sysctl arg, vfs.cd9660.doclusterread. Deleted debug and
!FreeBSD code arround cluster read stuff.
1997-08-25 10:26:18 +00:00
dyson
c4846f2d74 This is a trial improvement for the vnode reference count while on the vnode
free list problem.  Also, the vnode age flag is no longer used by the
vnode pager.  (It is actually incorrect to use then.)  Constructive
feedback welcome -- just be kind.
1997-08-22 03:56:37 +00:00
wollman
c07b59bf2b Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs.  (Socket buffers are the one exception.)  A number
of kernel APIs needed to get fixed in order to make this happen.  Also,
fix three protocol families which kept PCBs in mbufs to not malloc them
instead.  Delete some old compatibility cruft while we're at it, and add
some new routines in the in_cksum family.
1997-08-16 19:16:27 +00:00
kato
94c40ee122 Added DIAGNOSTIC routine to test inconsistency of vnode when cnp
points `.'.

Obtained from:	NetBSD
1997-08-15 02:36:28 +00:00
kato
20d8e0fed2 Deleted unused code which adjust UN_UNLOCK flag. 1997-08-15 02:35:00 +00:00
kato
14df8fa6f4 If the user doesn't have read permission, union_copyup should not copy
a file to upper layer.

Reviewed by:	Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp>
1997-08-14 03:57:46 +00:00
kato
f14cc75316 Backed out part of previous change. The example of -b mount in
manpage works again.
1997-08-14 03:52:27 +00:00
kato
69f3239838 Fixed vnode corruption by undefined case in union_lookup(). When
uerror == 0 && lerror == EACCES, lowervp == NULLVP and union_allocvp
doesn't find existing union node and new union node is created.

Sicne it is dificult to cover all the case, union_lookup always
returns when union_lookup1() returns EACCES.

Submitted by:	Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp>
Obtained from:	NetBSD/pc98
1997-08-12 07:18:59 +00:00
sef
70eff1f337 Check permissions for fp regs as well as normal regs. 1997-08-12 05:23:51 +00:00
sef
169e0822bf Fix procfs security hole -- check permissions on meaningful I/Os (namely,
reading/writing of mem and regs).  Also have to check for the requesting
process being group KMEM -- this is a bit of a hack, but ps et al need it.

Reviewed by:	davidg
1997-08-12 04:34:30 +00:00
bde
2b60d80b5b Removed unused #includes. 1997-08-02 14:33:27 +00:00
alex
6c7b4daebe More comment cleanup. 1997-06-26 17:12:59 +00:00
alex
0807c535d3 Typo police. 1997-06-26 16:13:56 +00:00
alex
0835dca454 Style fix my previous commit. 1997-06-26 16:12:53 +00:00
alex
8628d27490 Block all write operations to /proc/1/* when securelevel > 0.
The additional check in procfs_ctl.c could be backed out, but
I'm leaving it in for good measure.

Reviewed by:	Theo de Raadt <deraadt@OpenBSD.org>
1997-06-21 16:09:49 +00:00
tegge
d8a754a14d Don't remove the controlling tty from the session if the vnode is being
cleaned. This should help for PR kern/3581.
1997-05-29 13:29:13 +00:00
peter
b8ce5e7105 Fix some warnings (missing prototypes, wrong "generic" args etc)
umapfs uses one of nullfs's functions...
1997-05-25 04:50:02 +00:00
phk
fb0e4c639b Remove redundant check for vp == dvp (done in VFS before calling). 1997-05-17 18:32:53 +00:00
kato
6d01a1befe 1. Added cast and parenthesis in block size calculaion in
union_statfs().
2. staticized union vops.

Submitted by:	Doug Rabson <dfr@nlsystems.com>
1997-05-07 14:37:32 +00:00
joerg
4e9d193f50 Hide the kernel-only stuff inside #ifdef KERNEL.
XXX should be #ifdef _KERNEL
XXX^2 the !KERNEL part should probably be moved out into a publically
      visible header file anyway.
1997-05-07 13:23:04 +00:00
joerg
44d6c224e8 Oops. The function cd9660_mountroot() is gone, but i've committed an
even more bogus prototype for it in my previous commit.
1997-05-04 16:17:49 +00:00
joerg
6dc62fd0d2 This mega-commit brings the following:
. It makes cd9660 root f/s working again.
. It makes CD9660 a new-style option.
. It adds support to mount an ISO9660 multi-session CD-ROM as the root
  filesystem (the last session actually, but that's what is expected
  behaviour).

Sigh.  The CDIOREADTOCENTRYS did a copyout() of its own, and thus has
been unusable for me for this work.  Too bad it didn't simply stuff
the max 100 entries into the struct ioc_read_toc_entry, but relied on
a user supplied data buffer instead. :-(  I now had to reinvent the
wheel, and created a CDIOREADTOCENTRY ioctl command that can be used
in a kernel context.

While doing this, i noticed the following bogosities in existing CD-ROM
drivers:

wcd:	This driver is likely to be totally bogus when someone tries
	two succeeding CDIOREADTOCENTRYS (or now CDIOREADTOCENTRY)
	commands with requesting MSF format, since it apparently
	operates on an internal table.

scd:	This driver apparently returns just a single TOC entry only for
	the CDIOREADTOCENTRYS command.

I have only been able to test the CDIOREADTOCENTRY command with the
cd(4) driver.  I hereby request the respective maintainers of the
other CD-ROM drivers to verify my code for their driver.  When it
comes to merging this CD-ROM multisession stuff into RELENG_2_2 i will
only consider drivers where i've got a confirmation that it actually
works.
1997-05-04 15:24:23 +00:00
kato
6d4ed1002a Fixed panic message in union_lock(): union_link --> union_lock. 1997-05-03 01:55:19 +00:00
kato
3543c94e94 Access correct union mount point in union_access. Old vnode is saved
in savedvp variable and it is used for the argument of
MOUNTTOUNIONMOUNT().  I didn't realize ap->a_vp is modified before
MOUNTTOUNIONMOUNT(), so the change by revision 1.22 is incorrect.
1997-05-02 03:21:54 +00:00
sos
0480684d63 Remove the dependancy on DEV_BSIZE, now specfs works on != 512byte
sector devices given that the fs uses a blocksize of at least a physical
sector size.
1997-05-01 19:12:22 +00:00
joerg
a6e0ddf7d7 For multi-session CD-ROMs, we have to account for previous sessions as
well in volume_space_size.  Otherwise, NFS exports won't work.
1997-04-29 17:11:51 +00:00
joerg
e56a1536bf Add support for ISO9660 multi-session CD-ROMs. This is just nothing
but searching the directory on something else than the default
location.

NB: this comprises an interface change to the mount_cd9660(8)
utility (commit will follow).  You need to rebuild both.

I've got similar patches for RELENG_2_2, should i commit them too?
1997-04-29 15:52:53 +00:00
kato
8ed1e5f090 Revised fix for locking violation when unionfs calls vput with
UN_KLOCK flag.

When UN_KLOCK is set, VOP_UNLOCK should keep uppervp locked and clear
UN_ULOCK flag.  To do this, when UN_KLOCK is set, (1) union_unlock
clears UN_ULOCK and does not clear UN_KLOCK, (2) union_lock() does not
access uppervp and does not clear UN_KLOCK, and (3) callers of
vput/VOP_UNLOCK should clear UN_KLOCK.  For example, vput becomes:

	SETKLOCK(union_node);
	vput(vnode);
	CLEARKLOCK(union_node);

where SETKLOCK macro sets UN_KLOCK and CLEARKLOCK macro clears
UN_KLOCK.
1997-04-29 02:06:07 +00:00
alex
137a8b8024 Removed bogon from previous commit: doubly included sys/systm.h. 1997-04-27 21:32:21 +00:00
alex
f000c2c35f Prevent debugger attachment to init when securelevel > 0.
Noticed by:	Brian Buchanan <brian@wasteland.calbbs.com>
1997-04-27 19:02:37 +00:00