summaryrefslogtreecommitdiffstats
path: root/sys/miscfs/specfs
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate the undocumented, experimental, non-delivering and highlyphk2000-03-161-2/+0
| | | | dangerous MAX_PERF option.
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-5/+6
| | | | Suggested by: bde
* Remove unused #includes.phk1999-12-081-4/+0
| | | | Obtained from: http://bogon.freebsd.dk/include
* Collect read and write counts for filesystems. This new codemckusick1999-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>
* Next step in the device cleanup process.phk1999-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.
* Oops, a bit too hasty there.phk1999-11-081-3/+0
|
* Various cleanups.phk1999-11-081-27/+14
|
* Use vop_panic() instead of spec_badop().phk1999-11-071-23/+11
|
* Remove the iskmemdev() function. Make it the responsibility of the mem.cphk1999-11-071-3/+1
| | | | drivers to enforce the securelevel checks.
* Remove specfs::vop_lookup() There is no code path which can call it.phk1999-11-011-18/+0
|
* useracc() the prequel:phk1999-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.
* A tentative agreement has been reached in regards to a proceduredillon1999-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.
* Change the default for the vfs.bdev_buffered sysctl to zero.phk1999-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.
* Add a couple of strategic KASSERTsphk1999-10-081-0/+6
|
* Add back sysctl vfs.enable_userblk_iophk1999-10-081-0/+7
|
* Warn once per driver about dev_t's not registered with make_dev().phk1999-10-041-0/+9
|
* Move the buffered read/write code out of spec_{read|write} and intophk1999-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.
* Remove v_maxio from struct vnode.phk1999-09-291-7/+0
| | | | | | Replace it with mnt_iosize_max in struct mount. Nits from: bde
* Remove a warning check which was too general.phk1999-09-251-3/+1
|
* Remove five now unused fields from struct cdevsw. They should neverphk1999-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
* This patch clears the way for removing a number of tty relatedphk1999-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
* Kill the cdevsw->d_maxio field.phk1999-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.
* Fix handling of a device EOF that occurs in the middle of a block. Thedillon1999-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
* Step one of replacing devsw->d_maxio with si_bsize_max.phk1999-09-201-3/+9
| | | | | | | | Rename dev->si_bsize_max to si_iosize_max and set it in spec_open if the device didn't. Set vp->v_maxio from dev->si_bsize_max in spec_open rather than in ufs_bmap.c
* Add vfs.enable_userblk_io sysctl to control whether user reads and writesdillon1999-09-171-4/+9
| | | | | | | | | | | | | | | | | | to buffered block devices are allowed. The default is to be backwards compatible, i.e. reads and writes are allowed. The idea is for a larger crowd to start running with this disabled and see what problems, if any, crop up, and then to change the default to off and see if any problems crop up in the next 6 months prior to potentially removing support entirely. There are still a few people, Julian and myself included, who believe the buffered block device access from usermode to be useful. Remove use of vnode->v_lastr from buffered block device I/O in preparation for removal of vnode->v_lastr field, replacing it with the already existing seqcount metric to detect sequential operation. Reviewed by: Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com>
* Changes to centralise the default blocksize behaviour.julian1999-09-091-2/+8
| | | | | | More likely to follow. Submitted by: phk@freebsd.org
* Print out the device name when there is an uninitialised IO size or IO errorjulian1999-09-031-2/+3
| | | | | | in spec_getpages(). Submitted by: phk suggested the idea.
* Add a catchall to set default blocksize values for disk like devices.julian1999-09-031-5/+13
| | | | Submitted by: phk@freebsd.org
* Revert a bunch of contraversial changes by PHK. Afterjulian1999-09-031-44/+33
| | | | | | | | | | a quick think and discussion among various people some form of some of these changes will probably be recommitted. The reversion requested was requested by dg while discussions proceed. PHK has indicated that he can live with this, and it has been agreed that some form of some of these changes may return shortly after further discussion.
* Set the buffersize for non BSDFFS labeled partitions tophk1999-08-311-4/+4
| | | | | | max(dev->si_bsize_phys, BLKDEV_IOSIZE). Requested by: davidg
* Make buffered acces to bdevs from userland controllable withphk1999-08-311-8/+18
| | | | a sysctl vfs.bdev_access.
* Make bdev userland access work like cdev userland access unlessphk1999-08-301-29/+30
| | | | | | | | | | the highly non-recommended option ALLOW_BDEV_ACCESS is used. (bdev access is evil because you don't get write errors reported.) Kill si_bsize_best before it kills Matt :-) Use the specfs routines rather having cloned copies in devfs.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* Fix comment to match reality..julian1999-08-251-1/+2
| | | | vop_strategy gets a vnode argument these days.
* Add the (inline) function vm_page_undirty for clearing the dirty bitmaskalc1999-08-171-3/+3
| | | | | | | | of a vm_page. Use it. Submitted by: dillon
* Spring cleaning around strategy and disklabels/slices:phk1999-08-141-3/+3
| | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
* Add support for device drivers which want to track all open/closephk1999-08-131-59/+18
| | | | | | | | | | | | | | | operations. This allows a device driver better insight into what is going on that the current: proc1: open /dev/foo R/O devsw->open( R/O, proc1 ) proc2: open /dev/foo R/W devsw->open( R/W, proc2 ) proc2: close /* nothing, but device is really only R/O open */ proc1: close devsw->close( R/O, proc1 )
* Remove spec_getattr(), which as far as I can tell can never be called from ↵phk1999-08-131-3/+1
| | | | the current code-paths, and if it were, would panic on any unmounted bdev.
* The bdevsw() and cdevsw() are now identical, so kill the former.phk1999-08-131-9/+9
|
* s/v_specinfo/v_rdev/phk1999-08-131-6/+6
|
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-08-082-79/+1
| | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part.
* Now a dev_t is a pointer to struct specinfo which is shared by all specdevphk1999-07-202-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vnodes referencing this device. Details: cdevsw->d_parms has been removed, the specinfo is available now (== dev_t) and the driver should modify it directly when applicable, and the only driver doing so, does so: vn.c. I am not sure the logic in checking for "<" was right before, and it looks even less so now. An intial pool of 50 struct specinfo are depleted during early boot, after that malloc had better work. It is likely that fewer than 50 would do. Hashing is done from udev_t to dev_t with a prime number remainder hash, experiments show no better hash available for decent cost (MD5 is only marginally better) The prime number used should not be close to a power of two, we use 83 for now. Add new checkalias2() to get around the loss of info from dev2udev() in bdevvp(); The aliased vnodes are hung on a list straight of the dev_t, and speclisth[SPECSZ] is unused. The sharing of struct specinfo means that the v_specnext moves into the vnode which grows by 4 bytes. Don't use a VBLK dev_t which doesn't make sense in MFS, now we hang a dummy cdevsw on B/Cmaj 253 so that things look sane. Storage overhead from all of this is O(50k). Bump __FreeBSD_version to 400009 The next step will add the stuff needed so device-drivers can start to hang things from struct specinfo
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-5/+5
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Remove an unused variable.dt1999-06-011-2/+1
|
* Simplify cdevsw registration.phk1999-05-311-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-112-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-21/+24
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-071-11/+11
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* remove b_proc from struct buf, it's (now) unused.phk1999-05-061-3/+2
| | | | Reviewed by: dillon, bde
OpenPOWER on IntegriCloud