summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-12/+2
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* Give ccd a cloning function.phk2000-08-291-8/+32
|
* Move the truncation code out of vn_open and into the open system callmckusick2000-07-041-2/+3
| | | | | | | | | | after the acquisition of any advisory locks. This fix corrects a case in which a process tries to open a file with a non-blocking exclusive lock. Even if it fails to get the lock it would still truncate the file even though its open failed. With this change, the truncation is done only after the lock is successfully acquired. Obtained from: BSD/OS
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-1/+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
* Convert to struct bio instead of struct buf.phk2000-05-011-90/+75
|
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-151-5/+6
| | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-021-6/+7
| | | | | | | | | | | | | (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.
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-201-11/+5
| | | | | | | | 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.
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-201-9/+11
| | | | | | | | | | | | | | | | | | | | | 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.
* Remove #if NCCD > 0 - it's guaranteed to be true by config if ccd.c ispeter2000-01-291-2/+0
| | | | being compiled. (NCCD is used elsewhere though :-( )
* Cleanup some remaining bdev fluff.phk2000-01-161-35/+6
|
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-3/+1
| | | | Suggested by: bde
* Remove unused variableeivind1999-12-211-1/+0
|
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-6/+13
|
* Revamp the devstat priority system. All disks now have the same priority.ken1999-12-081-2/+2
| | | | | | | | | | | | | | | | | | The same goes for CD drivers and tape drivers. In systems with mixed IDE and SCSI, devices in the same priority class will be sorted in attach order. Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of drivers have been modified to use that priority. This includes the necessary changes to all drivers, except the ATA drivers. Soren will modify those separately. This does not include and does not require any change in the devstat version number, since no known userland applications use the priority enumerations. Reviewed by: msmith, sos, phk, jlemon, mjacob, bde
* Convert various pieces of code to use vn_isdisk() rather than checkingphk1999-11-221-12/+1
| | | | | | | | for vp->v_type == VBLK. In ccd: we don't need to call VOP_GETATTR to find the type of a vnode. Reviewed by: sos
* Remove the devsw magic from DEV_MODULE()phk1999-11-071-1/+2
|
* Removal of sys/device.hn_hibma1999-10-051-1/+0
| | | | | | | | | | | | | - Move intrhook stuff into kernel.h - Remove all occurrences of #device <device.h> - Add kernel.h were necessary (nowhere) - delete device.h This file contained the structures for cfdata (old style config) and is no longer used. It was included by most drivers. It confuses the remote debugger as the definition of 'struct device' in device.h is found before the one in bus_private.h.
* Correct typo in comment. putccdbuf() releases a buffer, it doesn't allocate ↵grog1999-09-271-1/+1
| | | | one.
* Buffer locking code failed to use BUF_KERNPROC and BUF_UNLOCK anddillon1999-09-271-1/+34
| | | | | | | | | BUF_LOCKFREE a buffer prior to physically freeing it. While these bugs did not cause a crash, they might in the future. Added eof handling for unlabeled partitions. Submitted by: Tor.Egge@fast.no
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | 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
* Cleanup CCD quite a bit, including adding clarifying comments.dillon1999-09-231-147/+357
| | | | | | | | | | | | | | | Enhance MIRROR code. Add a few more sanity checks and implement a zone-based disk selector to make use of both disks when reading. Also implement a read fail-over. If a read error occurs on one disk, the I/O is retried on the other. NOTE: CCD's mirroring support cannot deal with write errors properly in regards to recovery, meaning that 'old' data under a write error may be read non-deterministically if you reboot after a write error, and CCD certainly cannot deal with a disk changeout. And it still can't. Use vinum if you are really serious about mirroring. CCD basically just implements a poor-man's mirror.
* Fix ccdiodone code. The code was using cbp->cb_buf.b_bcount todillon1999-09-231-1/+10
| | | | | | sum the total amount of I/O issued to determine when all the I/O has completed. This fails when the EOF boundry occurs in the middle of an I/O. Using cbp->cb_buf.b_bufsize works better.
* Fix bug in pseudo-geometry calculation code that assumed a sector sizedillon1999-09-231-1/+1
| | | | smaller then 1024 bytes.
* Use devstat_end_transaction_buf() rather than Use devstat_end_transaction()phk1999-09-181-8/+1
|
* Changes to centralise the default blocksize behaviour.julian1999-09-091-4/+0
| | | | | | More likely to follow. Submitted by: phk@freebsd.org
* Revert a bunch of contraversial changes by PHK. Afterjulian1999-09-031-0/+1
| | | | | | | | | | 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.
* Make bdev userland access work like cdev userland access unlessphk1999-08-301-1/+0
| | | | | | | | | | 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
|
* Initialize the dev->si_bsize fields.phk1999-08-261-1/+5
| | | | | Submitted by: tegge Reviewed by: phk
* Spring cleaning around strategy and disklabels/slices:phk1999-08-141-4/+4
| | | | | | | | | | | | | | 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.
* Use the vn_todev() function, rather than VOP_GETATTRphk1999-07-181-20/+2
|
* Fix 2nd arg to udev2dev() call in ccd.cphk1999-07-171-2/+2
|
* Initialize and hold locks for ccd generated bufs..peter1999-06-271-3/+6
| | | | Obtained from: Matt Dillon <dillon@backplane.com>
* This commit should be a extensive NO-OP:phk1999-05-301-6/+21
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Continue where Julian left off in July 1998:phk1999-05-071-2/+2
| | | | | | | | | | | | | | 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.)
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-071-16/+2
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* Don't use <sys/disk.h>phk1999-05-061-34/+27
|
* Fixed variable overflow problem.dg1999-03-111-5/+5
| | | | Obtained from: NetBSD via Mark J. Taylor <mtaylor@cybernet.com>
* Don't forget to remove devstat entries when takingmjacob1999-03-101-1/+6
| | | | down the CCD device.
* Set the devstat priority for ccd devices to DEVSTAT_PRIORITY_CCDken1999-02-181-2/+2
| | | | instead of DEVSTAT_PRIORITY_OTHER.
* Add a prioritization field to the devstat_add_entry() call so thatken1999-02-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | peripheral drivers can determine where in the devstat(9) list they are inserted. This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and any ports that depend on the devstat code, since the size of the devstat structure has changed. The devstat version number has been incremented as well to reflect the change. This sorts devices in the devstat list in "more interesting" to "less interesting" order. So, for instance, da devices are now more important than floppy drives, and so will appear before floppy drives in the default output from systat, iostat, vmstat, etc. The order of devices is, for now, kept in a central table in devicestat.h. If individual drivers were able to make a meaningful decision on what priority they should be at attach time, we could consider splitting the priority information out into the various drivers. For now, though, they have no way of knowing that, so it's easier to put them in an easy to find table. Also, move the checkversion() call in vmstat(8) to a more logical place. Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and for putting up with the long time it has taken me to commit it. Bruce did object somewhat to the central priority table (he would rather the priorities be distributed in each driver), so his objection is duly noted here. Reviewed by: bde, obrien
* Fix warnings preparing for -Wall -Wcast-qualdillon1999-01-271-17/+17
| | | | | Also disable one usb module in LINT due to fatal compilation errors, temporary.
* Convert ccd to a proper module vs. something started by PSEUDO_SET().peter1999-01-221-14/+30
|
* Update system to new device statistics code.gibbs1998-09-151-48/+18
| | | | | Submitted by: "Kenneth D. Merry" <ken@plutotech.com> mike@smith.net.au (Mike Smith)
* Make struct buf->b_offset reflect the real byte offset which gotsos1998-08-191-1/+2
| | | | | in via the uio struct. This enables device drivers to use != DEV_BSIZE blocking on devices with wierd sector/block sizes (ie CDROM's).
* There is no such thing any more as "struct bdevsw".julian1998-07-041-8/+22
| | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind.
* VOP_STRATEGY grows an (struct vnode *) argumentjulian1998-07-041-3/+3
| | | | | | as the value in b_vp is often not really what you want. (and needs to be frobbed). more cleanups will follow this. Reviewed by: Bruce Evans <bde@freebsd.org>
OpenPOWER on IntegriCloud