summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
Commit message (Collapse)AuthorAgeFilesLines
* This commit fixes various 64bit portability problems required fordfr1998-06-073-6/+6
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Make flushing dirty pages work correctly on filesystems thatdyson1998-05-211-2/+3
| | | | | | unexpectedly do not complete writes even with sync I/O requests. This should help the behavior of mmaped files when using softupdates (and perhaps in other circumstances also.)
* Disallow reading the current kernel stack. Only the user structure andtegge1998-05-193-10/+38
| | | | | the current registers should be accessible. Reviewed by: David Greenman <dg@root.com>
* Cleanup after Garret, include unpch.h to get at various macros..sos1998-05-171-1/+2
|
* In the words of the submitter:msmith1998-05-073-100/+89
| | | | | | | | | | | | | | | | | | | --------- Make callers of namei() responsible for releasing references or locks instead of having the underlying filesystems do it. This eliminates redundancy in all terminal filesystems and makes it possible for stacked transport layers such as umapfs or nullfs to operate correctly. Quality testing was done with testvn, and lat_fs from the lmbench suite. Some NFS client testing courtesy of Patrik Kudo. vop_mknod and vop_symlink still release the returned vpp. vop_rename still releases 4 vnode arguments before it returns. These remaining cases will be corrected in the next set of patches. --------- Submitted by: Michael Hancock <michaelh@cet.co.jp>
* As described by the submitter:msmith1998-05-069-76/+9
| | | | | | | | | | | | | Reverse the VFS_VRELE patch. Reference counting of vnodes does not need to be done per-fs. I noticed this while fixing vfs layering violations. Doing reference counting in generic code is also the preference cited by John Heidemann in recent discussions with him. The implementation of alternative vnode management per-fs is still a valid requirement for some filesystems but will be revisited sometime later, most likely using a different framework. Submitted by: Michael Hancock <michaelh@cet.co.jp>
* Tighten up management of memory and swap space during map allocation,dyson1998-04-291-13/+27
| | | | | | | deallocation cycles. This should provide a measurable improvement on swap and memory allocation on loaded systems. It is unlikely a complete solution. Also, provide more map info with procfs. Chuck Cranor spurred on this improvement.
* Make the devfs SLICE option a standard type option.julian1998-04-201-4/+8
| | | | (hopefully it will go away eventually anyhow)
* Add changes and code to implement a functional DEVFS.julian1998-04-196-71/+152
| | | | | | | | | | | | | | | | | | | | | This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned.
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-176-14/+14
|
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-1/+3
| | | | used.
* Add two new functions, get{micro|nano}time.phk1998-03-265-28/+17
| | | | | | | | | | | | They are atomic, but return in essence what is in the "time" variable. gettime() is now a macro front for getmicrotime(). Various patches to use the two new functions instead of the various hacks used in their absence. Some puntuation and grammer patches from Bruce. A couple of XXX comments.
* If lowervp is NULLVP, vap was clobbered.kato1998-03-171-2/+2
| | | | | Submitted by: Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp> Obtained from: NetBSD/pc98
* Free the vnode in the failure case of vop_symlink()julian1998-03-101-1/+2
| | | | Suggested by: Michaelh@cet.co.jp
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-082-10/+11
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* Initialize b_resid, and also print out better diagnostics on I/Odyson1998-03-081-7/+19
| | | | errors. This will allow for better tracking of user error reports.
* This mega-commit is meant to fix numerous interrelated problems. Theredyson1998-03-071-31/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has been some bitrot and incorrect assumptions in the vfs_bio code. These problems have manifest themselves worse on NFS type filesystems, but can still affect local filesystems under certain circumstances. Most of the problems have involved mmap consistancy, and as a side-effect broke the vfs.ioopt code. This code might have been committed seperately, but almost everything is interrelated. 1) Allow (pmap_object_init_pt) prefaulting of buffer-busy pages that are fully valid. 2) Rather than deactivating erroneously read initial (header) pages in kern_exec, we now free them. 3) Fix the rundown of non-VMIO buffers that are in an inconsistent (missing vp) state. 4) Fix the disassociation of pages from buffers in brelse. The previous code had rotted and was faulty in a couple of important circumstances. 5) Remove a gratuitious buffer wakeup in vfs_vmio_release. 6) Remove a crufty and currently unused cluster mechanism for VBLK files in vfs_bio_awrite. When the code is functional, I'll add back a cleaner version. 7) The page busy count wakeups assocated with the buffer cache usage were incorrectly cleaned up in a previous commit by me. Revert to the original, correct version, but with a cleaner implementation. 8) The cluster read code now tries to keep data associated with buffers more aggressively (without breaking the heuristics) when it is presumed that the read data (buffers) will be soon needed. 9) Change to filesystem lockmgr locks so that they use LK_NOPAUSE. The delay loop waiting is not useful for filesystem locks, due to the length of the time intervals. 10) Correct and clean-up spec_getpages. 11) Implement a fully functional nfs_getpages, nfs_putpages. 12) Fix nfs_write so that modifications are coherent with the NFS data on the server disk (at least as well as NFS seems to allow.) 13) Properly support MS_INVALIDATE on NFS. 14) Properly pass down MS_INVALIDATE to lower levels of the VM code from vm_map_clean. 15) Better support the notion of pages being busy but valid, so that fewer in-transit waits occur. (use p->busy more for pageouts instead of PG_BUSY.) Since the page is fully valid, it is still usable for reads. 16) It is possible (in error) for cached pages to be busy. Make the page allocation code handle that case correctly. (It should probably be a printf or panic, but I want the system to handle coding errors robustly. I'll probably add a printf.) 17) Correct the design and usage of vm_page_sleep. It didn't handle consistancy problems very well, so make the design a little less lofty. After vm_page_sleep, if it ever blocked, it is still important to relookup the page (if the object generation count changed), and verify it's status (always.) 18) In vm_pageout.c, vm_pageout_clean had rotted, so clean that up. 19) Push the page busy for writes and VM_PROT_READ into vm_pageout_flush. 20) Fix vm_pager_put_pages and it's descendents to support an int flag instead of a boolean, so that we can pass down the invalidate bit.
* Fix certain kinds of block device operations. For example, tunefs ondyson1998-03-041-9/+4
| | | | a block device shouldn't crash the system anymore.
* The intent is to get rid of WILLRELE in vnode_if.src by makingmsmith1998-03-019-9/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a complement to all ops that return a vpp, VFS_VRELE. This is initially only for file systems that implement the following ops that do a WILLRELE: vop_create, vop_whiteout, vop_mknod, vop_remove, vop_link, vop_rename, vop_mkdir, vop_rmdir, vop_symlink This is initial DNA that doesn't do anything yet. VFS_VRELE is implemented but not called. A default vfs_vrele was created for fs implementations that use the standard vnode management routines. VFS_VRELE implementations were made for the following file systems: Standard (vfs_vrele) ffs mfs nfs msdosfs devfs ext2fs Custom union umapfs Just EOPNOTSUPP fdesc procfs kernfs portal cd9660 These implementations may change as VOP changes are implemented. In the next phase, in the vop implementations calls to vrele and the vrele part of vput will be moved to the top layer vfs_vnops and made visible to all layers. vput will be replaced by unlock in these cases. Unlocking will still be done in the per fs layer but the refcount decrement will be triggered at the top because it doesn't hurt to hold a vnode reference a little longer. This will have minimal impact on the structure of the existing code. This will only be done for vnode arguments that are released by the various fs vop implementations. Wider use of VFS_VRELE will likely require restructuring of the code. Reviewed by: phk, dyson, terry et. al. Submitted by: Michael Hancock <michaelh@cet.co.jp>
* Deleted KLOCK-hack.kato1998-02-263-29/+7
|
* Deleted unused variable.kato1998-02-101-2/+1
|
* Undo UN_KLOCK hack except union_allocvp(). Now, vput() doesn't lockkato1998-02-103-54/+32
| | | | the vnode.
* Staticize.eivind1998-02-094-11/+11
|
* Fixed pagefault when cred == NOCRED.kato1998-02-072-14/+24
| | | | PR: 5632
* Fixed number of entries in gid-mapfile.kato1998-02-071-2/+2
| | | | PR: 5640
* Back out DIAGNOSTIC changes.eivind1998-02-0610-28/+10
|
* Workarround for DIAGNOSTIC kernel's panic in union_lookup().kato1998-02-061-1/+7
| | | | | Union_removed_upper() clobbers cache when file is removed. Upper vp will be removed by union_reclaim().
* 1) Start using a cleaner and more consistant page allocator insteaddyson1998-02-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | of the various ad-hoc schemes. 2) When bringing in UPAGES, the pmap code needs to do another vm_page_lookup. 3) When appropriate, set the PG_A or PG_M bits a-priori to both avoid some processor errata, and to minimize redundant processor updating of page tables. 4) Modify pmap_protect so that it can only remove permissions (as it originally supported.) The additional capability is not needed. 5) Streamline read-only to read-write page mappings. 6) For pmap_copy_page, don't enable write mapping for source page. 7) Correct and clean-up pmap_incore. 8) Cluster initial kern_exec pagin. 9) Removal of some minor lint from kern_malloc. 10) Correct some ioopt code. 11) Remove some dead code from the MI swapout routine. 12) Correct vm_object_deallocate (to remove backing_object ref.) 13) Fix dead object handling, that had problems under heavy memory load. 14) Add minor vm_page_lookup improvements. 15) Some pages are not in objects, and make sure that the vm_page.c can properly support such pages. 16) Add some more page deficit handling. 17) Some minor code readability improvements.
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-0410-10/+28
|
* Declare the variable `i' when UMAP_DIAGNOSTIC is defined.kato1998-02-031-1/+4
|
* Make the debug options new-style.eivind1998-01-313-4/+10
| | | | | This also zaps a DPT option from lint; it wasn't referenced from anywhere.
* Fixed typo in comment.kato1998-01-251-2/+2
|
* VM level code cleanups.dyson1998-01-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Start using TSM. Struct procs continue to point to upages structure, after being freed. Struct vmspace continues to point to pte object and kva space for kstack. u_map is now superfluous. 2) vm_map's don't need to be reference counted. They always exist either in the kernel or in a vmspace. The vmspaces are managed by reference counts. 3) Remove the "wired" vm_map nonsense. 4) No need to keep a cache of kernel stack kva's. 5) Get rid of strange looking ++var, and change to var++. 6) Change more data structures to use our "zone" allocator. Added struct proc, struct vmspace and struct vnode. This saves a significant amount of kva space and physical memory. Additionally, this enables TSM for the zone managed memory. 7) Keep ioopt disabled for now. 8) Remove the now bogus "single use" map concept. 9) Use generation counts or id's for data structures residing in TSM, where it allows us to avoid unneeded restart overhead during traversals, where blocking might occur. 10) Account better for memory deficits, so the pageout daemon will be able to make enough memory available (experimental.) 11) Fix some vnode locking problems. (From Tor, I think.) 12) Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp. (experimental.) 13) Significantly shrink, cleanup, and make slightly faster the vm_fault.c code. Use generation counts, get rid of unneded collpase operations, and clean up the cluster code. 14) Make vm_zone more suitable for TSM. This commit is partially as a result of discussions and contributions from other people, including DG, Tor Egge, PHK, and probably others that I have forgotten to attribute (so let me know, if I forgot.) This is not the infamous, final cleanup of the vnode stuff, but a necessary step. Vnode mgmt should be correct, but things might still change, and there is still some missing stuff (like ioopt, and physical backing of non-merged cache files, debugging of layering concepts.)
* Delete unused code in union_fsync().kato1998-01-221-6/+1
|
* - Move SETKLOC and CLEARKLOCK macros into uion.h.kato1998-01-203-10/+33
| | | | | | | | | | - Set UN_ULOCK in union_lock() when UN_KLOCK is set. Caller expects that vnode is locked correctly, and may call another function which expects locked vnode and may unlock the vnode. - Do not assume the behavior of inside functions in FreeBSD's vfs_suber.c is same as 4.4BSD-Lite2. Vnode may be locked in vget() even though flag is zero. (Locked vnode is, of course, unlocked before returning from vget.)
* Workarround for locking violation while recycling vnode which union fskato1998-01-181-4/+14
| | | | used in freelist.
* Improve and revise fixes for locking violation.kato1998-01-182-33/+52
| | | | Obtained from: NetBSD/pc98
* Make our v_usecount vnode reference count work identically to thedyson1998-01-063-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | original BSD code. The association between the vnode and the vm_object no longer includes reference counts. The major difference is that vm_object's are no longer freed gratuitiously from the vnode, and so once an object is created for the vnode, it will last as long as the vnode does. When a vnode object reference count is incremented, then the underlying vnode reference count is incremented also. The two "objects" are now more intimately related, and so the interactions are now much less complex. When vnodes are now normally placed onto the free queue with an object still attached. The rundown of the object happens at vnode rundown time, and happens with exactly the same filesystem semantics of the original VFS code. There is absolutely no need for vnode_pager_uncache and other travesties like that anymore. A side-effect of these changes is that SMP locking should be much simpler, the I/O copyin/copyout optimizations work, NFS should be more ponderable, and further work on layered filesystems should be less frustrating, because of the totally coherent management of the vnode objects and vnodes. Please be careful with your system while running this code, but I would greatly appreciate feedback as soon a reasonably possible.
* Use CHECKIO in procfs_ioctl() to ensure that any changes in UID/GID resultsef1998-01-061-1/+4
| | | | in the expected failure.
* add copyrightsjulian1998-01-024-17/+102
|
* Fixed missing initialization of mp->mnt_stat. At least vm depends onbde1998-01-013-3/+6
| | | | | | at least mp->mnt_stat.f_iosize being nonzero. PR: 5212
* Fixed a missing/misplaced/misstyled prototype.bde1997-12-302-4/+4
|
* Lots of improvements, including restructring the caching and managementdyson1997-12-291-10/+3
| | | | | | | | | | | | | | of vnodes and objects. There are some metadata performance improvements that come along with this. There are also a few prototypes added when the need is noticed. Changes include: 1) Cleaning up vref, vget. 2) Removal of the object cache. 3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore. 4) Correct some missing LK_RETRY's in vn_lock. 5) Correct the page range in the code for msync. Be gentle, and please give me feedback asap.
* Unspammed nested include of <vm/vm_zone.h>.bde1997-12-272-3/+4
|
* Clear the p_stops field on change of user/group id, unless the correctsef1997-12-201-3/+13
| | | | | | | | | flag is set in the p_pfsflags field. This, essentially, prevents an SUID proram from hanging after being traced. (E.g., "truss /usr/bin/rlogin" would fail, but leave rlogin in a stopevent state.) Yet another case where procctl is (hopefully ;)) no longer needed in the general case. Reviewed by: bde (thanks bruce :))
* Set the sender's low watermark to match the maximum size for atomicbde1997-12-191-1/+2
| | | | writes that we advertise (PIPE_BUF = 512).
* Add support for poll(2) on files. vop_nopoll() now returns POLLNVALwollman1997-12-151-5/+20
| | | | | | | | | | | | | | | | | | | if one of the new poll types is requested; hopefully this will not break any existing code. (This is done so that programs have a dependable way of determining whether a filesystem supports the extended poll types or not.) The new poll types added are: POLLWRITE - file contents may have been modified POLLNLINK - file was linked, unlinked, or renamed POLLATTRIB - file's attributes may have been changed POLLEXTEND - file was extended Note that the internal operation of poll() means that it is impossible for two processes to reliably poll for the same event (this could be fixed but may not be worth it), so it is not possible to rewrite `tail -f' to use poll at this time.
* Fixed EOF handing.bde1997-12-131-8/+2
| | | | | | | | | | | | | | | | | | 1. SS_CANTRCVMORE was initially set on the wrong socket, so reads when there has never been a writer on the socket did not return 0. Note that such reads are only possible if the fifo was opened in (O_RDONLY | O_NONBLOCK) mode. 2. SS_CANTSENDMORE was initially set on the wrong socket, but this was harmless because the wrong socket is never sent from and there is no need to set the flag initially on the right socket (since open in (O_WRONLY | O_NONBLOCK) mode fails if there is no reader...). 3. SS_CANTRCVMORE was cleared when read() returns. This broke the case where read() returns 0 - subsequent reads are supposed to return 0 until a writer appears. There is no need to clear the flag when read() returns, since it is cleared correctly when a writer appears.
* Restored fifo_pathconf() from rev.1.32. vop_stdpathconf() is toobde1997-12-131-2/+32
| | | | | | | | | general to be of much use. Using it here weakened the _PC_MAX_CANON, _PC_MAX_INPUT and _PC_VDISABLE cases. fifo_pathconf() is not quite correct either. _PC_CHOWN_RESTRICTED and _PC_LINK_MAX should be handled by the host file system. For directories, the host file system should let us handle _PC_PIPE_BUF.
* Change the ioctls for procfs around a bit; in particular, whever possible,sef1997-12-131-3/+4
| | | | | | | | | | | | | | change from ioctl(fd, PIOC<foo>, &i); to ioctl(fd, PIOC<foo>, i); This is going from the _IOW to _IO ioctl macro. The kernel, procctl, and truss must be in synch for it all to work (not doing so will get errors about inappropriate ioctl's, fortunately). Hopefully I didn't forget anything :).
OpenPOWER on IntegriCloud