summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_bsd.c
Commit message (Collapse)AuthorAgeFilesLines
* Premptively change initializations of struct g_class to use C99phk2003-03-241-3/+2
| | | | | sparse struct initializations before we extend the struct with new OAM related member functions.
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-181-1/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Fix yet another fallout of our M_* song and dance.phk2003-03-101-1/+1
|
* Mark some args unused so this compiles in userland.phk2003-01-281-1/+1
|
* Implement DIOCBSDBB ioctl which overwrites first BBSIZE bytes of BSDphk2003-01-261-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | labeled disk. This is complicated by the fact that BBSIZE is greater than the PAGE_SIZE limit ioctl inflicts on arguments which are automatically copied in. As long as we don't need access to userland memory (copyin/out) we can deal with the ioctl using g_callme() which executes it from the GEOM event thread. Once we need copyin/out, we need to return the bio with EDIRIOCTL in order to make geom_dev call us back in the original process context where copyin will work. Unfortunately, that results in us getting called with Giant, so we have to DROP_GIANT/PICKUP_GIANT around the code where we diddle GEOMs internals. Sometimes you just can't win... ... But it does make geom_bsd.c an almost complete example of the GEOM beastiarium.
* Fix typo.phk2003-01-131-1/+1
|
* Output the fstype of each partition in a disklabel in the configurationjhb2003-01-101-0/+7
| | | | text similar to the way that the MBR module dumps its slice types.
* BSD disklabels expose the controling label though the 'c' partition, andphk2003-01-061-12/+26
| | | | | | | | | | some trick is necessary to prevent further BSD geoms from attaching to that. Our old trick was to make sure we don't attach to a geom from the "BSD" class, but this doesn't work if an intermediary geom obscures this fact. Instead, calculate the MD5 checksum of the label we target and ask if anybody below us loves that label. If they do we don't. Coded by: gordon.
* Constification and some s/int/u_int/ changes.phk2002-12-161-7/+7
|
* Don't interpret the hotspots relative to all slices on a slicer, butphk2002-12-131-1/+4
| | | | relative to the parent device.
* Use the hotspot code to prevent people from overwriting their disklabelphk2002-12-021-11/+90
| | | | | | with stuff which would ruin the day for any open parititons. Approved by: re
* Always recalculate the SRM checksum if the label is at 64 bytes offset.phk2002-11-081-3/+13
| | | | Tested by: jhb
* Fix to support pc98.nyan2002-11-071-0/+5
| | | | | | It is mostly merged from MBR specific part. Reviewed by: phk
* Add more compatibility junk.phk2002-10-281-8/+18
|
* Now that the sectorsize and mediasize are properties of the provider,phk2002-10-201-13/+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/+2
| | | | | | output. Sponsored by: DARPA & NAI Labs
* Style(9) and english(9) fixes.phk2002-10-201-55/+54
| | | | Submitted by: schweikh
* Fix argument order mistake when decoding disklabels from on-disk format.phk2002-10-051-1/+1
| | | | | Detected by: jhay Sponsored by: DARPA & NAI Labs.
* Don the asbestos underwear and add the code which lets DIOCWDINFOphk2002-09-301-7/+23
| | | | | | write modified disklabels back to disk. Sponsored by: DARPA & NAI Labs.
* Retire g_io_fail() and let g_io_deliver() take an error argument instead.phk2002-09-301-8/+12
| | | | Sponsored by: DARPA & NAI Labs.
* Extensively rework the geom_bsd method, put a lot of comments in, bettingphk2002-09-271-104/+424
| | | | | | | | | | | | | | | | | | | | | | | | | | | | that this will make people use this for their future copy&paste operations. Rework the detection of raw-disk offsets in disklabels. This actually unearthed a number of bugs in the (now) previous version. Also accept labels which don't have a magic RAW_PART, provided they don't confuse us too much. Change the order of our sanity-checks on labels found on disks to be more robust. Check against MAXPARTITIONS in our sanity-check and reject disklabels we cannot cope with. Create new g_bsd_modify() function to implment disklabel modifying ioctls. Implement DIOCSDINFO and DIOCWDINFO with the provision that the latter still not writes your change back to disk. I didn't have the nerves for that yet. In the start routine, use g_call_me() for complex ioctls to prevent sleeping. Sponsored by: DARPA & NAI Labs.
* Add the new g_slice_config() call, which can add/delete/change a slice,phk2002-09-271-0/+4
| | | | | | | | | with support for trying, doing and forcing. This will eventually replace g_slice_addslice() which gets changed from grabbing topology to requing it in this commit as well. Sponsored by: DARPA & NAI Labs.
* Correctly en/decode MAXPARTITIONS partitions.phk2002-09-271-16/+8
| | | | Sponsored by: DARPA & NAI Labs.
* "Fix" printf format issues by using %jphk2002-09-131-2/+3
| | | | Sponsored by: DARPA & NAI Labs.
* Remove "magicspace". It looks good on paper, it doesn't work in practice.phk2002-09-061-13/+1
| | | | Sponsored by: DARPA & NAI Labs.
* Improve some on the naming.phk2002-06-091-1/+1
| | | | Submitted by: iedowse
* Change the registration of magic spaces so it does its own memory management.phk2002-06-051-9/+7
| | | | Sponsored by: DARPA & NAI Labs.
* Introduce the concept of "magic spaces", and implement them in most ofphk2002-05-211-1/+15
| | | | | | | | | | | | | | | | the relevant classes. Some methods may implement various "magic spaces", this is reserved or magic areas on the disk, set a side for various and sundry purposes. A good example is the BSD disklabel and boot code on i386 which occupies a total of four magic spaces: boot1, the disklabel, the padding behind the disklabel and boot2. The reason we don't simply tell people to write the appropriate stuff on the underlying device is that (some of) the magic spaces might be real-time modifiable. It is for instance possible to change a disklabel while partitions are open, provided the open partitions do not get trampled in the process. Sponsored by: DARPA & NAI Labs.
* Remove the "-class" suffix from classes, they will not be ambiguous.phk2002-05-211-1/+1
| | | | Sponsored by: DARPA & NAI Labs.
* Generalize a bit: we don't need separate functions to find the i386 andphk2002-05-191-33/+9
| | | | | | alpha disklabels, just one function which is told where to look. Sponsored by: DARPA & NAI Labs.
* Implement the GEOMGETCONF ioctl which returns vital stats for thephk2002-04-231-12/+21
| | | | | | current device in XML in an sbuf. Sponsored by: DARPA & NAI Labs
* Implement DIOCGFRONTSTUFF ioctl which reports how many bytes from the startphk2002-04-091-10/+11
| | | | | | of the device magic stuff might occupy. Sponsored by: DARPA & NAI Labs.
* Move access and orphan member functions from class to geom.phk2002-04-041-2/+0
| | | | Sponsored by: DARPA & NAI Labs
* Retire the bogus ioctl DIOCGPART in toto.phk2002-04-021-11/+0
| | | | | | | Once again we can notice that badly thought out hacks ferment and infect far more code than initially expected. Sponsored by: DARPA and NAI Labs.
* In the absense of any smarter way to do this, cast various printfphk2002-03-281-1/+1
| | | | arguments to silence printf format warnings.
* Calculate the checksum the right place for alpha. The fact that thisphk2002-03-271-1/+1
| | | | | worked for the beast disklabel only goes to show how weak a simple parity really is.
* Eliminate some thread pointers which do not make sense anymore.phk2002-03-261-6/+6
| | | | | Split private parts of geom.h into geom_int.h. The latter should never be included in class implemtations.
* Cave in to tradition and rename "methods" to "classes".phk2002-03-261-7/+7
|
* Make the BSD method width/endian agnostic and support alphaphk2002-03-241-11/+187
| | | | | | architecture labels as well. Sponsored by: DARPA, NAI Labs.
* Make this compile in the userland-regression testsuite again.phk2002-03-171-13/+3
|
* Add a generic and general ioctl pass-through mechanism.phk2002-03-161-1/+23
| | | | 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/+257
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