summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_slice.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC Alexander Motin's GEOM direct dispatch work:scottl2014-01-071-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r256603: Introduce new function devstat_end_transaction_bio_bt(), adding new argument to specify present time. Use this function to move binuptime() out of lock, substantially reducing lock congestion when slow timecounter is used. r256606: Move g_io_deliver() out of the lock, as required for direct dispatch. Move g_destroy_bio() out too to reduce lock scope even more. r256607: Fix passing uninitialized bio_resid argument to g_trace(). r256610: Add unmapped I/O support to GEOM RAID. r256830: Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping temporary mapped buffer. That fixes double unmap if biodone() called twice for the same BIO (but with different done methods). r256880: Merge GEOM direct dispatch changes from the projects/camlock branch. When safety requirements are met, it allows to avoid passing I/O requests to GEOM g_up/g_down thread, executing them directly in the caller context. That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid several context switches per I/O. r259247: Fix bug introduced at r256607. We have to recalculate bp_resid here since sizes of original and completed requests may differ due to end of media. Testing of the stable/10 merge was done by Netflix, but all of the credit goes to Alexander and iX Systems. Submitted by: mav Sponsored by: iX Systems
* MFC r256724:trasz2013-12-131-1/+1
| | | | | | | | | | | | Make geom_label(4) resize-aware. This fixes a situation when "gpart resize" would resize a partition, but label providers - e.g. /dev/gptid/XXX - would stay the same size. MFC r256766: Fix build with gcc by spelling unused format string as "unused" instead of NULL. Sponsored by: The FreeBSD Foundation
* geom_slice.c and its consumers like GEOM_LABEL are not touching the datamav2013-03-261-0/+8
| | | | | unless hotspots are used. Pass G_PF_ACCEPT_UNMAPPED flag through except such rare cases (obsolete GEOM_SUNLABEL and GEOM_BSD).
* - Don't pass geom and provider names as format strings.jh2012-11-201-1/+1
| | | | | | | - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev(). Reviewed by: pjd
* Remove unneeded G_PF_CANDELETE flag.ed2012-08-281-1/+0
| | | | | This flag is only used by GEOM so it can be propagated to the character device's SI_CANDELETE. Unfortunately, SI_CANDELETE seems to do nothing.
* Implement media change notification for DA and CD removable media devices.mav2012-07-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It includes three parts: 1) Modifications to CAM to detect media media changes and report them to disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes Asynchronous Notification mechanism to receive events from hardware. Active polling with TEST UNIT READY commands with 3 seconds period is used for incapable hardware. After that both CD and DA drivers work the same way, detecting two conditions: "NOT READY: Medium not present" after medium was detected previously, and "UNIT ATTENTION: Not ready to ready change, medium may have changed". First one reported to disk(9) as media removal, second as media insert/change. To reliably receive second event new AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by generic error handling code in cam_periph_error(). 2) Modifications to GEOM core to handle media remove and change events. Media removal handled by spoiling all consumers attached to the provider. Media change event also schedules provider retaste after spoiling to probe new media. New flag G_CF_ORPHAN was added to consumers to reflect that consumer is in process of destruction. It allows retaste to create new geom instance of the same class, while previous one is still dying. 3) Modifications to some GEOM classes: DEV -- to report media change events to devd; VFS -- to handle spoiling same as orphan to prevent accessing replaced media. PART class already handles spoiling alike to orphan. Reviewed by: silence on geom@ and scsi@ Tested by: avg Sponsored by: iXsystems, Inc. / PC-BSD MFC after: 2 months
* Fix orphan() methods of several GEOM classes to not assume that theretrasz2012-07-071-3/+1
| | | | | | | | | is an error set on the provider. With GEOM resizing, class can become orphaned when it doesn't implement resize() method and the provider size decreases. Reviewed by: mav Sponsored by: FreeBSD Foundation
* Change the way in which zero stripesize is handled. Instead of reportingmav2010-01-061-4/+4
| | | | | | | | | zero stripeoffset in such case (as if device has no stripes), report offset from the beginning of the media (as if device has single infinite stripe). This gives partitioning tools information, required to guess better partition alignment, in case if hardware doesn't report it's stripe size. For example, it should give disklabel info about odd offset made by fdisk.
* Add sbuf_new_auto as a shortcut for the very common case of creating ades2008-08-091-1/+1
| | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks
* Handle GEOM::ident attribute by attaching 'sX' string at the end of identpjd2007-05-051-0/+32
| | | | | | received from the underlying provider, where X is pp->index value. OK'ed by: phk
* Implement BIO_FLUSH handling by simply passing it down to the components.pjd2006-10-311-0/+2
| | | | Sponsored by: home.pl
* Add g_wither_provider() to abstract the details of destroying amarcel2006-04-101-2/+1
| | | | | | particular provider. Use this function where g_orphan_provider() is being called so that the flags are updated correctly and g_orphan_provider() is called only when allowed.
* Allow to use g_slice_orphan() from outside.pjd2006-02-181-2/+1
| | | | MFC after: 3 days
* Fix so that when a slice or a partition is removed through g_slice_config(),rodrigc2005-09-141-0/+1
| | | | | | | | | | | | it is destroyed in GEOM, in addition to being removed from /dev. Before this patch, if you applied a new MBR which deleted a slice, the deleted slice would not be in /dev, but it would still appear in kern.geom.conftxt and kern.geom.confxml, which would confused the diskPartitionEditor in sysinstall. Submitted by: pjd Tested by: pjd, rodrigc MFC after: 1 week
* Stop wasting a bootverbose line on all geom slices.phk2004-11-031-1/+1
|
* Do not override the class provided dumpconf function.phk2004-08-181-1/+2
|
* Check for a NULL pointer before dereferencing it.le2004-07-251-0/+2
|
* We only need to check for overlaps if we increasing access counts.phk2004-07-041-17/+19
|
* Free only if pointer isn't NULL.pjd2004-07-011-1/+2
|
* Don't force class to give a valid softc to g_slice_new(), it is not alwayspjd2004-06-241-2/+6
| | | | | | needed. Approved by: phk
* Remove the absolute count g_access_abs() function since experience hasphk2004-02-121-2/+2
| | | | | | | | | | | | 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.
* Use __FBSDID().obrien2003-06-111-2/+2
| | | | Approved by: phk
* Add missing va_end() calls.phk2003-06-071-1/+2
| | | | Noticed by: tmm
* Add a destroy_geom method to the slice "library".phk2003-05-311-2/+11
| | | | | | If a slice class has no destroy_geom method, use this one. This should allow all slicers to kldload.
* Use a more tailored spoil routine for slices, and take advantage ofphk2003-05-021-15/+19
| | | | g_wither_geom() to do most of the work for us.
* Rename g_slice_init() to the more appropriate g_slice_alloc() and givephk2003-05-021-4/+14
| | | | it a g_slice_free() partner function.
* Rename g_call_me() to g_post_event(), and give it a flagphk2003-04-231-1/+2
| | | | argument to determine if we can M_WAITOK in malloc.
* Do not mandate that slicers have a private ->start(), they may not needphk2003-04-221-1/+4
| | | | one. KASSERT() that they have one if G_SLICE_HOT_START is used.
* Make more of the "hotspot" stuff generic:phk2003-04-191-21/+54
| | | | | | | 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.
* Create a dedicated structure for holding hotspot information rather thanphk2003-04-191-11/+12
| | | | using slice structures for it.
* Time has run from the "run GEOM in userland" harness, and the new regressionphk2003-04-131-11/+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-22/+1
| | | | 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-1/+0
|
* 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.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-4/+4
| | | | Approved by: trb
* Don't divide by zero if there is no stripewidth specified.phk2003-02-111-2/+4
|
* Better names for struct disk elements: d_maxsize, d_stripeoffsetphk2003-02-111-3/+5
| | | | | | | | | | | 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 G_PF_CANDELETE to our own providers from the provider we attach to.phk2003-02-111-0/+2
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Add a check for negative offset locations and return EINVAL for them.phk2002-12-171-0/+5
|
* Get rid of g_slice_addslice() and use g_slice_config() instead.phk2002-12-161-32/+0
| | | | Tested with: i386 + src/tools/regression/geom
* Constification and some s/int/u_int/ changes.phk2002-12-161-34/+35
|
* Don't interpret the hotspots relative to all slices on a slicer, butphk2002-12-131-2/+3
| | | | relative to the parent device.
* Add a simplified version of the hot-spot code to enable us to protectphk2002-12-021-4/+86
| | | | | | in-band disklabels from in-band vandalism. Approve by: re
* Remember to update the providers idea of its size when we reconfigurephk2002-11-201-0/+1
| | | | | | a slice child. Approved by: re
* Add the remaning part of the new libdisk interaction.phk2002-10-281-0/+6
| | | | | | | 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-5/+20
| | | | | | | 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-6/+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-3/+8
| | | | | | output. Sponsored by: DARPA & NAI Labs
* Use %jd instead of %lld now that we have it.phk2002-10-201-10/+11
|
OpenPOWER on IntegriCloud