aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/specfs
Commit message (Collapse)AuthorAgeFilesLines
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileRuslan Ermilov2001-05-231-838/+0
| | | | | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles. Notes: svn path=/head/; revision=77031
* Introduce a global lock for the vm subsystem (vm_mtx).Alfred Perlstein2001-05-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb Notes: svn path=/head/; revision=76827
* Backed out previous commit. It cause massive filesystem corruption,Bruce Evans2001-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | not to mention a compile-time warning about the critical function becoming unused, by replacing spec_bmap() with vop_stdbmap(). ntfs seems to have the same bug. The factor for converting specfs block numbers to physical block numbers is 1, but vop_stdbmap() uses the bogus factor btodb(ap->a_vp->v_mount->mnt_stat.f_iosize), which is 16 for ffs with the default block size of 8K. This factor is bogus even for vop_stdbmap() -- the correct factor is related to the filesystem blocksize which is not necessarily the same to the optimal i/o size. vop_stdbmap() was apparently cloned from nfs where these sizes happen to be the same. There may also be a problem with a_vp->v_mount being null. spec_bmap() still checks for this, but I think the checks in specfs are dead code which used to support block devices. Notes: svn path=/head/; revision=76146
* Add a vop_stdbmap(), and make it part of the default vop vector.Poul-Henning Kamp2001-04-291-1/+0
| | | | | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations. Notes: svn path=/head/; revision=76131
* Revert consequences of changes to mount.h, part 2.Greg Lehey2001-04-291-2/+0
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=76117
* Correct #includes to work with fixed sys/mount.h.Greg Lehey2001-04-231-0/+2
| | | | Notes: svn path=/head/; revision=75858
* Fixes to track snapshot copy-on-write checking in the specinfoKirk McKusick2001-03-071-2/+2
| | | | | | | | | structure rather than assuming that the device vnode would reside in the FFS filesystem (which is obviously a broken assumption with the device filesystem). Notes: svn path=/head/; revision=73942
* Extend kqueue down to the device layer.Jonathan Lemon2001-02-151-0/+19
| | | | | | | Backwards compatible approach suggested by: peter Notes: svn path=/head/; revision=72521
* Another round of the <sys/queue.h> FOREACH transmogriffer.Poul-Henning Kamp2001-02-041-2/+1
| | | | | | | | Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=72012
* Add a BUF_KERNPROC() in the BIO_DELETE path.Poul-Henning Kamp2001-01-301-0/+1
| | | | | | | This seems to fix the problem which md(4) backed filesystems exposed. Notes: svn path=/head/; revision=71829
* This patch reestablishes the spec_fsync() guarentee that synchronousMatthew Dillon2001-01-291-7/+16
| | | | | | | | | | | | | | | | | | | fsyncs, which typically occur during unmounting, will drain all dirty buffers even if it takes multiple passes to do so. The guarentee was mangled by the last patch which solved a problem due to -current disabling interrupts while holding giant (which caused an infinite spin loop waiting for I/O to complete). -stable does not have either patch, but has a similar bug in the original spec_fsync() code which is triggered by a bug in the softupdates umount code, a fix for which will be committed to -current as soon as Kirk stamps it. Then both solutions will be MFC'd to -stable. -stable currently suffers from a combination of the softupdates bug and a small window of opportunity in the original spec_fsync() code, and -stable also suffers from the spin-loop bug but since interrupts are enabled the spin resolves itself in a few milliseconds. Notes: svn path=/head/; revision=71777
* Fix a lockup problem that occurs with 'cvs update'. specfs's fsync canMatthew Dillon2000-12-301-0/+13
| | | | | | | | | get into the same sort of infinite loop that ffs's fsync used to get into, probably due to background bitmap writes. The solution is the same. Notes: svn path=/head/; revision=70528
* This implements a better launder limiting solution. There was a solutionMatthew Dillon2000-12-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | in 4.2-REL which I ripped out in -stable and -current when implementing the low-memory handling solution. However, maxlaunder turns out to be the saving grace in certain very heavily loaded systems (e.g. newsreader box). The new algorithm limits the number of pages laundered in the first pageout daemon pass. If that is not sufficient then suceessive will be run without any limit. Write I/O is now pipelined using two sysctls, vfs.lorunningspace and vfs.hirunningspace. This prevents excessive buffered writes in the disk queues which cause long (multi-second) delays for reads. It leads to more stable (less jerky) and generally faster I/O streaming to disk by allowing required read ops (e.g. for indirect blocks and such) to occur without interrupting the write stream, amoung other things. NOTE: eventually, filesystem write I/O pipelining needs to be done on a per-device basis. At the moment it is globalized. Notes: svn path=/head/; revision=70374
* Take VBLK devices further out of their missery.Poul-Henning Kamp2000-11-021-9/+2
| | | | | | | This should fix the panic I introduced in my previous commit on this topic. Notes: svn path=/head/; revision=68259
* Blow away the v_specmountpoint define, replacing it with what it wasEivind Eklund2000-10-091-5/+5
| | | | | | | defined as (rdev->si_mountpoint) Notes: svn path=/head/; revision=66886
* Fix panic when removing open device (found by bp@)Poul-Henning Kamp2000-08-241-3/+11
| | | | | | | | | | | | | | | Implement subdirs. Build the full "devicename" for cloning functions. Fix panic when deleted device goes away. Collaps devfs_dir and devfs_dirent structures. Add proper cloning to the /dev/fd* "device-"driver. Fix a bug in make_dev_alias() handling which made aliases appear multiple times. Use devfs_clone to implement getdiskbyname() Make specfs maintain the stat(2) timestamps per dev_t Notes: svn path=/head/; revision=65051
* Introduce vop_stdinactive() and make it the default if no vop_inactivePoul-Henning Kamp2000-08-181-15/+1
| | | | | | | | | is declared. Sort and prune a few vop_op[]. Notes: svn path=/head/; revision=64819
* This patch corrects the first round of panics and hangs reportedKirk McKusick2000-07-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the new snapshot code. Update addaliasu to correctly implement the semantics of the old checkalias function. When a device vnode first comes into existence, check to see if an anonymous vnode for the same device was created at boot time by bdevvp(). If so, adopt the bdevvp vnode rather than creating a new vnode for the device. This corrects a problem which caused the kernel to panic when taking a snapshot of the root filesystem. Change the calling convention of vn_write_suspend_wait() to be the same as vn_start_write(). Split out softdep_flushworklist() from softdep_flushfiles() so that it can be used to clear the work queue when suspending filesystem operations. Access to buffers becomes recursive so that snapshots can recursively traverse their indirect blocks using ffs_copyonwrite() when checking for the need for copy on write when flushing one of their own indirect blocks. This eliminates a deadlock between the syncer daemon and a process taking a snapshot. Ensure that softdep_process_worklist() can never block because of a snapshot being taken. This eliminates a problem with buffer starvation. Cleanup change in ffs_sync() which did not synchronously wait when MNT_WAIT was specified. The result was an unclean filesystem panic when doing forcible unmount with heavy filesystem I/O in progress. Return a zero'ed block when reading a block that was not in use at the time that a snapshot was taken. Normally, these blocks should never be read. However, the readahead code will occationally read them which can cause unexpected behavior. Clean up the debugging code that ensures that no blocks be written on a filesystem while it is suspended. Snapshots must explicitly label the blocks that they are writing during the suspension so that they do not cause a `write on suspended filesystem' panic. Reorganize ffs_copyonwrite() to eliminate a deadlock and also to prevent a race condition that would permit the same block to be copied twice. This change eliminates an unexpected soft updates inconsistency in fsck caused by the double allocation. Use bqrelse rather than brelse for buffers that will be needed soon again by the snapshot code. This improves snapshot performance. Notes: svn path=/head/; revision=63788
* Add snapshots to the fast filesystem. Most of the changes supportKirk McKusick2000-07-111-4/+18
| | | | | | | | | | | | | | | | | | | | | | | the gating of system calls that cause modifications to the underlying filesystem. The gating can be enabled by any filesystem that needs to consistently suspend operations by adding the vop_stdgetwritemount to their set of vnops. Once gating is enabled, the function vfs_write_suspend stops all new write operations to a filesystem, allows any filesystem modifying system calls already in progress to complete, then sync's the filesystem to disk and returns. The function vfs_write_resume allows the suspended write operations to begin again. Gating is not added by default for all filesystems as for SMP systems it adds two extra locks to such critical kernel paths as the write system call. Thus, gating should only be added as needed. Details on the use and current status of snapshots in FFS can be found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness is not included here. Unless and until you create a snapshot file, these changes should have no effect on your system (famous last words). Notes: svn path=/head/; revision=62976
* Pull the rug under block mode devices. they return ENXIO on open(2) now.Poul-Henning Kamp2000-07-031-3/+3
| | | | Notes: svn path=/head/; revision=62472
* Virtualizes & untangles the bioops operations vector.Poul-Henning Kamp2000-06-161-3/+2
| | | | | | | Ref: Message-ID: <18317.961014572@critter.freebsd.dk> To: current@ Notes: svn path=/head/; revision=61724
* before this commit, specfs reported disk partitionsJonathan M. Bresler2000-06-121-1/+1
| | | | | | | | | | | | using decimal major and minor numbers. "ls -l" reports disk partitions using decimal major numbers and hex minor numbers. make specfs use decimal major numbers and hex minor numbers, just like "ls -l" Notes: svn path=/head/; revision=61572
* Change the "bdev-whiner" to whine when open is attempted and extendPoul-Henning Kamp2000-05-091-0/+9
| | | | | | | the deadline a month. Notes: svn path=/head/; revision=60281
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-051-0/+1
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-1/+1
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()Poul-Henning Kamp2000-03-201-3/+3
| | | | | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts. Notes: svn path=/head/; revision=58349
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Eliminate the undocumented, experimental, non-delivering and highlyPoul-Henning Kamp2000-03-161-2/+0
| | | | | | | dangerous MAX_PERF option. Notes: svn path=/head/; revision=58132
* Give vn_isdisk() a second argument where it can return a suitable errno.Poul-Henning Kamp2000-01-101-5/+6
| | | | | | | Suggested by: bde Notes: svn path=/head/; revision=55756
* Remove unused #includes.Poul-Henning Kamp1999-12-081-4/+0
| | | | | | | Obtained from: http://bogon.freebsd.dk/include Notes: svn path=/head/; revision=54292
* Collect read and write counts for filesystems. This new codeKirk McKusick1999-12-011-0/+21
| | | | | | | | | | | | | | | | | drops the counting in bwrite and puts it all in spec_strategy. I did some tests and verified that the counts collected for writes in spec_strategy is identical to the counts that we previously collected in bwrite. We now also get read counts (async reads come from requests for read-ahead blocks). Note that you need to compile a new version of mount to get the read counts printed out. The old mount binary is completely compatible, the only reason to install a new mount is to get the read counts printed. Submitted by: Craig A Soules <soules+@andrew.cmu.edu> Reviewed by: Kirk McKusick <mckusick@mckusick.com> Notes: svn path=/head/; revision=53975
* Next step in the device cleanup process.Poul-Henning Kamp1999-11-091-321/+78
| | | | | | | | | | | Correctly lock vnodes when calling VOP_OPEN() from filesystem mount code. Unify spec_open() for bdev and cdev cases. Remove the disabled bdev specific read/write code. Notes: svn path=/head/; revision=53059
* Oops, a bit too hasty there.Poul-Henning Kamp1999-11-081-3/+0
| | | | Notes: svn path=/head/; revision=53016
* Various cleanups.Poul-Henning Kamp1999-11-081-27/+14
| | | | Notes: svn path=/head/; revision=53010
* Use vop_panic() instead of spec_badop().Poul-Henning Kamp1999-11-071-23/+11
| | | | Notes: svn path=/head/; revision=52971
* Remove the iskmemdev() function. Make it the responsibility of the mem.cPoul-Henning Kamp1999-11-071-3/+1
| | | | | | | drivers to enforce the securelevel checks. Notes: svn path=/head/; revision=52967
* Remove specfs::vop_lookup() There is no code path which can call it.Poul-Henning Kamp1999-11-011-18/+0
| | | | Notes: svn path=/head/; revision=52728
* useracc() the prequel:Poul-Henning Kamp1999-10-291-1/+0
| | | | | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument. Notes: svn path=/head/; revision=52635
* A tentative agreement has been reached in regards to a procedureMatthew Dillon1999-10-201-7/+0
| | | | | | | | | | | | | | | | | | | | | | to remove 'b'lock devices. The agreement is, essentially, that block devices will be collapsed into character devices as a first step (though I don't particularly agree), and raw device names 'rxxx' will become simply 'xxx' in devfs in the second step (i.e. no 'rxxx' names will exist). The renaming will not effect the original /dev and the expectation is that devfs will eventually (but not immediately) become the standard way to access devices in the system. If it is determined that a reimplementation of block device access characteristics is beneficial, a number of alternatives will be possible that do not involve resurrecting the 'b'lock device class. For example, an ioctl() that might be made on an open character device descriptor or a generic buffered overlay device. This commit removes the blockdev disablement sysctl which does not apply to the solution that was reached. Notes: svn path=/head/; revision=52399
* Change the default for the vfs.bdev_buffered sysctl to zero.Poul-Henning Kamp1999-10-181-1/+1
| | | | | | | | | | | | | | | | | | This means that access to block devices nodes will act the same as char device nodes for disk-like devices. If you encounter problems after this, where programs accessing disks directly fail to operate, please use the following command to revert to previous behaviour: sysctl -w vfs.bdev_buffered=1 And verify that this was indeed the cause of your trouble. See the mail-archives of the arch@FreeBSD.org list for background. Notes: svn path=/head/; revision=52385
* Add a couple of strategic KASSERTsPoul-Henning Kamp1999-10-081-0/+6
| | | | Notes: svn path=/head/; revision=52034
* Add back sysctl vfs.enable_userblk_ioPoul-Henning Kamp1999-10-081-0/+7
| | | | Notes: svn path=/head/; revision=52032
* Warn once per driver about dev_t's not registered with make_dev().Poul-Henning Kamp1999-10-041-0/+9
| | | | Notes: svn path=/head/; revision=51929
* Move the buffered read/write code out of spec_{read|write} and intoPoul-Henning Kamp1999-10-041-181/+210
| | | | | | | | | | | | | | two new functions spec_buf{read|write}. Add sysctl vfs.bdev_buffered which defaults to 1 == true. This sysctl can be used to experimentally turn buffered behaviour for bdevs off. I should not be changed while any blockdevices are open. Remove the misplaced sysctl vfs.enable_userblk_io. No other changes in behaviour. Notes: svn path=/head/; revision=51926
* Remove v_maxio from struct vnode.Poul-Henning Kamp1999-09-291-7/+0
| | | | | | | | | Replace it with mnt_iosize_max in struct mount. Nits from: bde Notes: svn path=/head/; revision=51797
* Remove a warning check which was too general.Poul-Henning Kamp1999-09-251-3/+1
| | | | Notes: svn path=/head/; revision=51662
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-09-251-2/+2
| | | | | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags Notes: svn path=/head/; revision=51658
* This patch clears the way for removing a number of tty relatedPoul-Henning Kamp1999-09-251-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags Notes: svn path=/head/; revision=51654
* Kill the cdevsw->d_maxio field.Poul-Henning Kamp1999-09-221-8/+10
| | | | | | | | | | | | d_maxio is replaced by the dev->si_iosize_max field which the driver should be set in all calls to cdevsw->d_open if it has a better idea than the system wide default. The field is a generic dev_t field (ie: not disk specific) so that tapes and other devices can use physio as well. Notes: svn path=/head/; revision=51558
* Fix handling of a device EOF that occurs in the middle of a block. TheMatthew Dillon1999-09-201-7/+66
| | | | | | | | | | | | transfer size calculation was incorrect resulting in the last read being potentially larger then the actual extent of the device. EOF and write handling has not yet been fixed. Reviewed by: Tor.Egge@fast.no Notes: svn path=/head/; revision=51485