summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
Commit message (Collapse)AuthorAgeFilesLines
* NO_GEOM cleanup:phk2003-02-281-54/+10
| | | | | Retire the "dev_t" centric version of the disk mini-layer. Remove now unneeded linkage field in dev_t and struct disk.
* NO_GEOM cleanup:phk2003-02-211-2/+2
| | | | | | | | | | | | | Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly.
* NO_GEOM cleanup:phk2003-02-211-4/+2
| | | | | | | | Change the argument to disk_destroy() to be the same struct disk * as disk_create() takes. This enables drivers to ignore the (now) bogus dev_t which disk_create() returns.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Correctly set bio_data in cloned children when cutting up large requests.tegge2003-02-121-1/+1
|
* Check disk->d_maxsize/dev->si_iosize_max at open time rather than in strategy.phk2003-02-111-10/+7
| | | | Printf a warning and use DFLTPHYS if the drive has not set a size.
* Make a mutex to stop the race coming into geom_disk's done routine.phk2003-02-111-25/+61
| | | | | | | | Cut up requests into smaller bits if they are longer than the drivers disk->d_maxsize or dev->si_iosize_max. Properly handle the race condition when using g_clone_bio() is used without having the single-threadedness of g_down/g_up secure locking.
* Better names for struct disk elements: d_maxsize, d_stripeoffsetphk2003-02-111-0/+2
| | | | | | | | | | | and d_stripesisze; Introduce si_stripesize and si_stripeoffset in struct cdev so we can make the visible to clustering code. Add stripesize and stripeoffset to providers. DTRT with stripesize and stripeoffset in various places in GEOM.
* Propagate DISKFLAG_CANDELETE from struct disk to G_PF_CANDELETE on thephk2003-02-111-8/+11
| | | | provider.
* Check return value of g_clone_bio().phk2003-02-061-0/+4
|
* 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
OpenPOWER on IntegriCloud