summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_event.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove a race condition that could result in processes being stuckphk2005-09-041-24/+30
| | | | | | | | | | | | waiting for geom events to happen: Instead of maintaining a count of outstanding events, simply look if the queue is empty. Make sure to not remove events from the queue until they are executed in order to not open a new race. Much work by: pjd Tested by: kris MT6: yes, should be.
* Correct typo.pjd2005-05-181-1/+1
|
* Introduce g_waitidlelock() function which is simlar to g_waitidle(),pjd2004-11-091-0/+12
| | | | | | | but should be called with the topology lock held and returns with the topology lock held and empty event queue. Approved by: phk (sometime ago)
* Add a new per-thread private flag: TDP_GEOM.phk2004-10-231-1/+8
| | | | | | | | | | | | | | This flag gets set whenever the thread posts an event on the GEOM event queue, and if the flag is set when the thread is prepared to return to userland from the kernel, g_waitidle() will be called to make sure that the posted events have completed. This can replace an insufficient number of g_waitidle() calls in various other places, and has the advantage of being failsafe: Any system call which does a VOP_OPEN()/VOP_CLOSE will now correctly wait for any geom events it posted as part of spoils or tastes. Assert that topology and Giant is not held in g_waitidle().
* Make withering water tight.phk2004-07-081-0/+16
| | | | | | | | | When we orphan/wither a provider, an attached geom+consumer could end up being withered as a result and it may be in front of us in the normal object scanning order so we need to do multi-pass. On the other hand, there may be withering stuff we can't get rid off (yet), so we need to keep track of both the existence of withering stuff and if there is more we can do at this time.
* Rearrange some of the GEOM debugging tools to be more structured.phk2004-03-101-21/+6
| | | | | | | | | | | | | | | | | | Retire g_sanity() and corresponding debugflag (0x8) Retire g_{stall,release}_events(). Under #ifdef DIAGNOSTIC: Make g_valid_obj() an official function and have it return an an non-zero integer which indicates the kind of object when found. Implement G_VALID_{CLASS,GEOM,CONSUMER,PROVIDER}() macros based on g_valid_obj(). Sprinkle calls to these macros liberally over the infrastructure. Always check that we do not free a live object.
* Now we have g_topology_assert_not(), so use it to detect deadlocks.pjd2004-02-101-1/+1
| | | | Approved by: phk, scottl (mentor)
* Don't mingle malloc/g_event flags.phk2004-02-021-5/+8
| | | | Spotted by: pjd@
* Make sure to keep track of canceled events.phk2004-01-231-0/+2
| | | | Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
* Prevent withering of the provider we're orphaning from happening untilphk2003-12-231-1/+7
| | | | | | we do it ourselves. Nailed by: Simon Heath <heath@cng.fr>
* KASSERT against multiple orphanings of providers.phk2003-12-071-0/+4
|
* Fix a harmless bug and add a ')' in a debugging printf.phk2003-11-181-2/+2
| | | | Submitted by: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
* Destroy providers maked with G_PF_WITHER when the last consumer has detached.phk2003-10-121-0/+2
|
* Use __FBSDID().obrien2003-06-111-2/+3
| | | | Approved by: phk
* Add missing va_end() calls.phk2003-06-071-4/+7
| | | | Noticed by: tmm
* Get rid of trivial function g_destroy_event().phk2003-05-021-10/+3
|
* Add a new flag, EV_CANCELED, and use it to make g_waitfor_event() returnphk2003-05-011-1/+5
| | | | EAGAIN if an event got canceled.
* When events on a reference is cancelled, check our doorstep first,phk2003-05-011-0/+7
| | | | it might be an orphan.
* Introduce a g_waitfor_event() function which posts an event and waits forphk2003-04-231-10/+63
| | | | it to be run (or cancelled) and use this instead of home-rolled versions.
* More of the event stuff can now be private to geom_event.cphk2003-04-231-1/+11
|
* Rename g_call_me() to g_post_event(), and give it a flagphk2003-04-231-4/+6
| | | | argument to determine if we can M_WAITOK in malloc.
* Remove the now unused hardcoded g_post_event() event support.phk2003-04-231-51/+4
|
* Turn EV_NEW_PROVIDER into a g_call_me() event.phk2003-04-231-22/+0
|
* Convert EV_SPOILED event to use g_call_me().phk2003-04-231-19/+1
|
* Turn the hardwired NEW_CLASS event into a g_call_me() event.phk2003-04-231-19/+1
|
* Move the shutdown eventhandler stuff to a more logical place.phk2003-04-231-11/+0
|
* Time has run from the "run GEOM in userland" harness, and the new regressionphk2003-04-131-13/+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.
* Fix a bug which resulted in orphanization getting confused every nowphk2003-04-121-1/+1
| | | | and then.
* Add handling for cancelled events in the g_call_me() methods.phk2003-04-021-0/+2
|
* Change events to have an array of "void *" references, and give thephk2003-04-021-62/+51
| | | | | | | | | | | 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.
* Save a lock: Grab the stall_events SX lock exclusively so it also serializephk2003-03-241-2/+2
| | | | OAM reqests.
* Introduce g_cancel_events() and use it a couple of places where it makesphk2003-03-231-0/+22
| | | | sense.
* Introduce an SX lock which allows us to stall event processingphk2003-03-231-0/+19
| | | | during OAM operations.
* #ifdef notyet a bit of code which needs not yet committed refcounting tophk2003-03-161-0/+2
| | | | work correctly.
* If we run out of consumers while orphaning them, and the provider's geomphk2003-03-101-0/+5
| | | | | | is withering, destroy the provider when done. This was exposed by the recent change to geom_dev's orphaning logic.
* Stamp out Danglish.phk2003-03-091-1/+1
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* 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.
* Remove g_silence(). It does not do anything anymore.phk2003-01-131-12/+1
|
* Polish a bit here and there.phk2002-11-041-7/+13
| | | | | | Reenable the geom.ctl device so people can play with gbde. Sponsored by: DARPA & NAI Labs
* Make sure we don't loose our topology lock in a call_me() handler.phk2002-09-301-0/+1
| | | | Sponsored by: DARPA & NAI Labs.
* Implement g_call_me() as a way for geom methods to schedule operationsphk2002-09-271-0/+30
| | | | | | | | | | | | | | | | to be performed in the event-thread. To do this, we need to lock the eventlist with g_eventlock (nee g_doorlock), since g_call_me() being called from the UP/DOWN paths will not be able to aquire g_topology_lock. This also means that for now these events are not referenced on any particular consumer/provider/geom. For UP/DOWN path use, this will not become a problem since the access() function will make sure we drain any bio's before we dismantle. Sponsored by: DARPA & NAI Labs.
* Ok, include also the two tests which actually does effect the claimsphk2002-09-271-0/+4
| | | | | | of the last commit message. Sponsored by: DARPA & NAI Labs.
* Hook into the shutdown EVENTHANDLER and stop tasting things after wephk2002-09-271-0/+16
| | | | | | get notified to make things settle a bit faster. Sponsored by: DARPA & NAI Labs.
* Rename the doorlock to eventlock, it gets to protect a bit more in the future.phk2002-09-271-6/+6
| | | | Sponsored by: DARPA & NAI Labs.
* Improve some on the naming.phk2002-06-091-2/+2
| | | | Submitted by: iedowse
* Only clear the spoiled flag if the class had no spoiled method, the spoiledphk2002-05-261-1/+2
| | | | | | | method may have deallocated the consumer already and modifying free()'ed memory is bad style. Sponsored by: DARPA & NAI Labs.
* Don't grab Giant around malloc(9) and free(9).phk2002-05-201-6/+0
| | | | | | | | Don't grab Giant around wakeup(9). Don't print verbose messages about each device found in geom_dev. Various cleanups. Sponsored by: DARPA & NAI Labs.
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+1
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Move access and orphan member functions from class to geom.phk2002-04-041-4/+4
| | | | Sponsored by: DARPA & NAI Labs
OpenPOWER on IntegriCloud