summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Experimentally don't let go of Giant in geom_disk's done.phk2003-02-061-0/+5
| | | | | | | We may actually be increasing Giant contention doing so because the actual stuff we do is very cheap. Also I am not convinced there is not a tiny window for a race here.
* Implement the new "struct disk" centered API for device drivers.phk2003-02-051-12/+23
| | | | | This commit should not change anything as no device drivers use the new API yet.
* Pave the road to removing the fixed size limit on device nodes:phk2003-02-041-0/+2
| | | | | | | | | | Change the si_name of dev_t's to be a char * and put a private buffer for holding the name at then end of the struct. Initialize si_name to point to the private buffer. Put a KASSERT in geom_disk to prevent overrun on the fake dev_t we still have to generate for the disk_drivers.
* Add a bio_disk pointer for use between geom_disk and the device drivers.phk2003-02-021-2/+2
|
* Add some agility to the disk_create() API:phk2003-01-301-24/+48
| | | | | | | | | | | | | | | | | | | Make passing the methods in a cdevsw structure optional. Move "CANFREE" and "NOGIANT" flags into struct disk instead of the cdevsw which may or may not be there. Rename CANFREE to CANDELETE to match BIO_DELETE operation. Add "OPEN" flag so drivers don't have to provide open/close methods just to maintain such a flag. Add temporary stopgap include of <sys/conf.h> to <sys/disk.h> until the files which have them in the other order are fixed. Add KASSERTS to make sure we don't get fed too many NULL pointers. Clear our geom's softc pointer before we wither.
* NO_GEOM cleanup: Remove sys/disklabel.h include.phk2003-01-301-2/+1
|
* NO_GEOM cleanup: retire disk_invalidate()phk2003-01-301-5/+0
|
* NO_GEOM cleanup: Mark the last arg to disk_create() as unused.phk2003-01-301-1/+1
|
* Add code to repsect the D_NOGIANT flag, should the disk device driver set it.phk2003-01-291-11/+30
| | | | | | NO_GEOM cleanup: remove ifdefs. Still untested.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* disk_dev_synth() is a NO_GEOM hack.phk2003-01-201-9/+0
|
* Remove need for <sys/diskslice.h> but retain numerical compatibilty just in ↵phk2003-01-201-2/+1
| | | | case.
* Constification and some s/int/u_int/ changes.phk2002-12-161-1/+1
|
* Add the remaning part of the new libdisk interaction.phk2002-10-281-0/+5
| | | | | | | WARNING: This is not a published interface, it is a stopgap measure for WARNING: libdisk so we can get 5.0-R out of the door. Sponsored by: DARPA & NAI Labs
* Reduce the GEOM verbosity under bootverbose to something more sufferable.phk2002-10-251-0/+2
| | | | | | | This is not quite the set of information I would want, but the tree where I have the "correct" version is messed up with conflicts. Sponsored by: DARPA & NAI Labs.
* Now that the sectorsize and mediasize are properties of the provider,phk2002-10-201-7/+5
| | | | | | | | | | | don't take the detour over the I/O path to discover them using getattr(), we can just pick them out directly. Do note though, that for now they are only valid after the first open of the underlying disk device due compatibility with the old disk_create() API. This will change in the future so they will always be valid. Sponsored by: DARPA & NAI Labs.
* Make the sectorsize a property of providers so we can include it in the XMLphk2002-10-201-0/+1
| | | | | | output. Sponsored by: DARPA & NAI Labs
* It makes more sense for the fwheads and fwsectors properties to be inphk2002-10-201-1/+1
| | | | the provider stanza rather than the geom stanza.
* Include fwsectors and gfwheads in the XML output for the disks we know.phk2002-10-201-0/+15
| | | | Sponsored by: DARPA & NAI Labs.
* NUL terminate sysctl kern.disksphk2002-10-171-1/+1
|
* The CAM system has it's own ideas of what locks are to be held by whom.phk2002-10-111-19/+24
| | | | | | | | | | | | | So do GEOM. Not a pretty sight. Take all the interesting stuff out of GEOM::disk_create(), and leave just the creation of the fake dev_t. Schedule the topology munging to happen in the g_event thread with g_call_me(). This makes disk_create() pretty lock-agnostic, almost lock-atheist. Tripped over by: peter Sponsored by: DARPA & NAI Labs
* Correctly deal with non-DEVBSIZE drives.phk2002-10-071-4/+9
| | | | | | | | Allow BIO_DELETE through too. This fixes swap-backed md(4) devices. Sponsored by: DARPA & NAI Labs.
* Copyin and copyout are only possible from a process-native thread,phk2002-10-071-24/+8
| | | | | | | | | | | | | | | and therefore we need a way for ioctl handlers to run in that thread in GEOM. Rather than invent a complicated registration system to recognize which ioctl handler to use for a given ioctl, we still schedule all ioctls down the tree as bio transactions but add a special return code that means "call me directly" and have the geom_dev layer do that. Use this for all ioctls that make it as far as a diskdriver to avoid any backwards compatibility problems. Requested by: scottl Sponsored by: DARPA & NAI Labs
* This patch got lost in my trees: Pass setattr down to device driversphk2002-10-051-0/+8
| | | | | | | as well. Detected by: scottl Sponsored by: DARPA & NAI Labs.
* NB: This commit does *NOT* make GEOM the default in FreeBSDphk2002-10-051-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NB: But it will enable it in all kernels not having options "NO_GEOM" Put the GEOM related options into the intended order. Add "options NO_GEOM" to all kernel configs apart from NOTES. In some order of controlled fashion, the NO_GEOM options will be removed, architecture by architecture in the coming days. There are currently three known issues which may force people to need the NO_GEOM option: boot0cfg/fdisk: Tries to update the MBR while it is being used to control slices. GEOM does not allow this as a direct operation. SCSI floppy drives: Appearantly the scsi-da driver return "EBUSY" if no media is inserted. This is wrong, it should return ENXIO. PC98: It is unclear if GEOM correctly recognizes all variants of PC98 disklabels. (Help Wanted! I have neither docs nor HW) These issues are all being worked. Sponsored by: DARPA & NAI Labs.
* Implement the "kern.disks" sysctl in GEOM.phk2002-10-041-1/+38
| | | | | | This makes "mdconfig -l" work again. Sponsored by: DARPA & NAI Labs.
* Properly conditionalize a debugging printf.phk2002-10-041-1/+4
| | | | Sponsored by: DARPA & NAI Labs.
* Don't restrict device drivers ability to sleep in the ioctl method, thisphk2002-10-011-5/+22
| | | | | | | | is actually entirely legal. Do bio's with ioctls in them in a g_call_me() function. Sponsored by: DARPA & NAI Labs
* Retire g_io_fail() and let g_io_deliver() take an error argument instead.phk2002-09-301-3/+2
| | | | Sponsored by: DARPA & NAI Labs.
* Style, whitespace and lint fixes.phk2002-09-281-3/+0
| | | | Sponsored by: DARPA & NAI Labs.
* (This commit touches about 15 disk device drivers in a very consistentphk2002-09-201-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs.
* "Fix" printf format issues by using %jphk2002-09-131-1/+2
| | | | Sponsored by: DARPA & NAI Labs.
* Improve some on the naming.phk2002-06-091-6/+6
| | | | Submitted by: iedowse
* Give the closet-dev_t we hand to the diskdrivers a name.phk2002-05-261-0/+1
|
* Remove the "-class" suffix from classes, they will not be ambiguous.phk2002-05-211-1/+1
| | | | Sponsored by: DARPA & NAI Labs.
* Make kernel dumps work with GEOM.phk2002-04-191-0/+20
| | | | | | | | | | Notice that if the device on which the dump is set is destroyed for any reason, the dump setting is lost. This in particular will happen in the case of spoilage. For instance if you set dump on ad0s1b and open ad0 for writing, ad0s* will be spoilt and the dump setting lost. See geom(4) for more about spoiling. Sponsored by: DARPA & NAI Labs.
* Implement DIOCGFRONTSTUFF ioctl which reports how many bytes from the startphk2002-04-091-0/+2
| | | | | | of the device magic stuff might occupy. Sponsored by: DARPA & NAI Labs.
* In reverence of the 3rd X11 development rule:phk2002-04-081-3/+0
| | | | | | | | | | 3.The only thing worse than generalizing from one example is generalizing from no examples at all. Remove the fwcylinders attribute before anybody gets the idea that we alone have squared the circle. Sponsored by: DARPA & NAI Labs.
* Centralize EOF handling and improve access controls for bio scheduling.phk2002-04-041-0/+2
| | | | Sponsored by: DARPA & NAI Labs
* Move access and orphan member functions from class to geom.phk2002-04-041-4/+2
| | | | Sponsored by: DARPA & NAI Labs
* Initialize a field to cater for ata-raidphk2002-04-021-0/+1
|
* Here follows the new kernel dumping infrastructure.phk2002-03-311-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caveats: The new savecore program is not complete in the sense that it emulates enough of the old savecores features to do the job, but implements none of the options yet. I would appreciate if a userland hacker could help me out getting savecore to do what we want it to do from a users point of view, compression, email-notification, space reservation etc etc. (send me email if you are interested). Currently, savecore will scan all devices marked as "swap" or "dump" in /etc/fstab _or_ any devices specified on the command-line. All architectures but i386 lack an implementation of dumpsys(), but looking at the i386 version it should be trivial for anybody familiar with the platform(s) to provide this function. Documentation is quite sparse at this time, more to come. Details: ATA and SCSI drivers should work as the dump formatting code has been removed. The IDA, TWE and AAC have not yet been converted. Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set the device as dumpdev. To implement the "off" argument, /dev/null is used as the device. Savecore will fail if handed any options since they are not (yet) implemented. All devices marked "dump" or "swap" in /etc/fstab will be scanned and dumps found will be saved to diskfiles named from the MD5 hash of the header record. The header record is dumped in readable format in the .info file. The kernel is not saved. Only complete dumps will be saved. All maintainer rights for this code are disclaimed: feel free to improve and extend. Sponsored by: DARPA, NAI Labs
* Cave in to tradition and rename "methods" to "classes".phk2002-03-261-4/+4
|
* Add a generic and general ioctl pass-through mechanism.phk2002-03-161-14/+28
| | | | It should now be posible to issue ioctls to SCSI CD drives.
* First commit of the GEOM subsystem to make it easier for people tophk2002-03-111-0/+232
test and play with this. This is not yet production quality and should be run only on dedicated test boxes. For people who want to develop transformations for GEOM there exist a set of shims to run geom in userland (ask phk@freebsd.org). Reports of all kinds to: phk@freebsd.org Please include in report: dmesg sysctl debug.geomdot sysctl debug.geomconf Known significant limitations: no kernel dump facility. ioctls severely restricted. Sponsored by: DARPA, NAI Labs
OpenPOWER on IntegriCloud