summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_bsd.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old ioctl use and support, once and for all.imp2015-01-061-90/+2
|
* Avoid to check the same cache line/variable from all the lockingattilio2012-01-281-0/+1
| | | | | | | | | | | | | | | | primitives by breaking stop_scheduler into a per-thread variable. Also, store the new td_stopsched very close to td_*locks members as they will be accessed mostly in the same codepaths as td_stopsched and this results in avoiding a further cache-line pollution, possibly. STOP_SCHEDULER() was pondered to use a new 'thread' argument, in order to take advantage of already cached curthread, but in the end there should not really be a performance benefit, while introducing a KPI breakage. In collabouration with: flo Reviewed by: avg MFC after: 3 months (or never) X-MFC: r228424
* Include sys/sbuf.h directly.ae2011-07-111-0/+1
| | | | Reviewed by: pjd
* Add some FEATURE macros for various GEOM classes.netchild2011-02-251-0/+3
| | | | | | | | | | | No FreeBSD version bump, the userland application to query the features will be committed last and can serve as an indication of the availablility if needed. Sponsored by: Google Summer of Code 2010 Submitted by: kibab Reviewed by: silence on geom@ during 2 weeks X-MFC after: to be determined in last commit with code from this project
* Trivial patch to show on which geom has the error been detected.ivoras2008-12-011-1/+2
| | | | | | Submitted by: Rick C. Petty Approved by: gnn (mentor) MFC after: 1 month
* Only attach to a GPT partition if it has the GPT_ENT_TYPE_FREEBSD type.jhb2007-12-061-0/+13
| | | | | | | | XXX: This only works currently with GEOM_GPT which only exists in 6.x. XXX: I didn't add 'mbroffset' support for a GPT partition holding a BSD label as I'm not sure if they use relative or absolute offsets. MFC after: 3 days
* Remove the trailing half of a sentence which was clearly supercededceri2006-05-241-2/+0
| | | | by the preceding one some time during editing.
* Change gctl_set_param() to return an error instead of setting anmarcel2006-04-071-2/+2
| | | | | | | | | | | error on the request. Add a wrapper, gctl_set_param_err(), that sets the error on the request from the error returned by gctl_set_param() and update current callers of gctl_set_param() to call gctl_set_param_err() instead. This makes gctl_set_param() much more usable in situations where the caller knows better what to do with certain (apparent) error conditions and setting an error on the request is not one of the things that need to be done.
* It is unclear who is wrong and who is right, but when operating onsobomax2005-11-301-0/+10
| | | | | | | | | | | | | | | plain file bsdlabel(8) always writes label at a fixed offset from its beginning (512 bytes), regardless of the sector size. At the same time, bsdlabel geom class expects label to be available at the very beginning of the second sector. As a result, images prepared in userland for media with sector size different from 512 bytes (i.e. 2k for cdroms) are not recognized by the tasting mechanism. Solve the problem by always looking for the label at 512-byte offset if we can't find it at the beginning of the second sector and sector size is not 512 bytes.
* Don't pass error value pointer to g_read_data(9) at all if we don'tsobomax2005-11-301-2/+1
| | | | | | have any use of it. Suggested by: pjd
* Check for g_read_data(9) errors properly:sobomax2005-11-301-2/+2
| | | | | | | | | | o The only indication of error condition is NULL value returned by the function; o value pointed to by error argument is undefined in the case when operation completes successfully. Discussed with: phk
* Plug memory leak.pjd2005-03-161-2/+1
| | | | | | | Submitted by: Ted Unangst Found by: Coverity Prevent analysis tool Approved by: phk MFC after: 3 days
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+3
|
* Pass the file->flags down to geom ioctl handlers.phk2004-12-121-1/+6
| | | | | | | | Reject certain ioctls if write permission is not indicated. Bump geom API version. Reported by: Ruben de Groot <mail25@bzerk.org>
* Tag all geom classes in the tree with a version number.phk2004-08-081-0/+1
|
* Use default method initialization on geoms.phk2004-08-081-7/+2
|
* Do not check error code from closing ->access() calls, we know they succeed.phk2004-02-141-1/+1
|
* Remove the absolute count g_access_abs() function since experience hasphk2004-02-121-5/+5
| | | | | | | | | | | | shown that it is not useful. Rename the relative count g_access_rel() function to g_access(), only the name has changed. Change all g_access_rel() calls in our CVS tree to call g_access() instead. Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source code compatibility.
* Simplify the ioctl handling in GEOM.phk2003-09-011-139/+76
| | | | | | | | | | | | | | | This replaces the current ioctl processing with a direct call path from geom_dev() where the ioctl arrives (from SPECFS) to any directly connected GEOM class. The inverse of the above is no longer supported. This is the situation were you have one or more intervening GEOM classes, for instance a BSDlabel on top of a MBR or PC98. If you want to issue MBR or PC98 specific ioctls, you will need to issue them on a MBR or PC98 providers. This paves the way for inviting CD's, FD's and other special cases inside GEOM.
* Use __FBSDID().obrien2003-06-111-2/+3
| | | | Approved by: phk
* Simplify the GEOM OAM api: Drop the request type, and let everythingphk2003-06-011-18/+18
| | | | | | | | hinge on the "verb" parameter which the class gets to interpret as it sees fit. Move the entire request into the kernel and move changed parameters back when done.
* Use bcmp() to compare hash strings.phk2003-06-011-1/+1
|
* Remove unused variables.phk2003-05-311-23/+2
| | | | | | Remove #ifdef notyet which will never become. Found by: FlexeLint
* Remove the G_CLASS_INITIALIZER, we do not need it anymore.phk2003-05-311-1/+0
|
* Fix the WARNING for wrong rawoffset, I tested incompatible units.phk2003-05-061-2/+2
| | | | Approved by: re/jhb
* Don't warn if the rawoffset is zero, that is actually the best value itphk2003-05-051-1/+1
| | | | could have.
* Turn the check that rawoffset == mbroffset into a warning instead.phk2003-05-051-3/+5
|
* Only accept a rawoffset if it is identical to the mbroffset.phk2003-05-041-0/+4
|
* Add a way to read the current mbroffset from a BSD label class.phk2003-05-041-1/+7
|
* Remove debugging printfs which should not have been committed.phk2003-05-041-3/+0
|
* Add a OAM interface for changing the label and writing the boot code.phk2003-05-031-26/+126
|
* Make bsd_disklabel_le_enc calculate the checksum and fill it in.phk2003-05-021-263/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (If there is a legitimate need to correctly encode and pack a disklabel with an invalid checksum custom tools can be built for that.) Make bsd_disklabel_le_dec() validate the magics, number of partitions (against a new parameter) and the checksum. Vastly simplify the logic of the GEOM::BSD class implementation: Let g_bsd_modify() always take a byte-stream label. This simplifies all users, except the ioctl's which now have to convert to a byte-stream first. Their loss. g_bsd_modify() is called with topology held now, and it returns with it held. Always update the md5sum in g_bsd_modify(), otherwise the check is no use after the first modification of the label. Make the MD5 over the bytestream version of the label. Move the rawoffset hack to g_bsd_modify() and remove all the inram/ondisk conversions. Don't configure hotspots in g_bsd_modify(), do it in taste instead, we do not support moving the label to a different location on the fly anyway. This passes all current regression tests.
* Use g_slice_spoiled() rather than g_std_spoiled()phk2003-05-021-2/+2
|
* Rename g_call_me() to g_post_event(), and give it a flagphk2003-04-231-2/+2
| | | | argument to determine if we can M_WAITOK in malloc.
* Make more of the "hotspot" stuff generic:phk2003-04-191-16/+11
| | | | | | | Give the class a way to specify the necessary action for read/delete/write: ALLOW, DENY, START or CALL. Update geom_bsd to use this.
* These two files fell off during my previous commit: put the encodingphk2003-04-171-125/+5
| | | | decoding functions for struct disklabel in a separate .c file.
* Time has run from the "run GEOM in userland" harness, and the new regressionphk2003-04-131-8/+0
| | | | | | | test is built to test GEOM as running in the kernel. This commit is basically "unifdef -D_KERNEL" to remove the mainly #include related code to support the userland-harness.
* Retire the "frontstuff" record keeping, it was no match for thephk2003-04-121-1/+0
| | | | in-band meta-data of BSD labels and a more complex solution will be needed.
* Remove all references to BIO_SETATTR. We will not be using it.phk2003-04-031-2/+0
|
* Use <sys/endian.h> instead of geom_enc.c for endianess-agnostification.phk2003-04-031-81/+82
|
* Add handling for cancelled events in the g_call_me() methods.phk2003-04-021-4/+8
|
* Change events to have an array of "void *" references, and give thephk2003-04-021-4/+4
| | | | | | | | | | | event posting functions varargs to fill these. Attribute g_call_me() to appropriate g_geom's where necessary. Add a flag argument to g_call_me() methods which will be used to signal cancellation of events in the future. This commit should be a no-op.
* 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.
OpenPOWER on IntegriCloud