Lines Matching defs:state

2 /* FS-Cache object state machine handler
8 * object state machine and the in-kernel representations.
35 * Define a work state. Work states are execution states. No event processing
36 * is performed by them. The function attached to a work state returns a
37 * pointer indicating the next state to which the state machine should
38 * transition. Returning NO_TRANSIT repeats the current state, but goes back
51 #define transit_to(state) ({ prefetch(&STATE(state)->work); STATE(state); })
56 * Define a wait state. Wait states are event processing states. No execution
58 * clear it and transition to state Y". The dispatcher returns to the
59 * scheduler if none of the events in which the wait state has an interest are
70 #define TRANSIT_TO(state, emask) \
71 { .events = (emask), .transit_to = STATE(state) }
74 * The object state machine.
109 * events, such as an I/O error. If an OOB event occurs, the state machine
111 * state (acurrently executing work states will complete first).
113 * In such a situation, object->state remembers the state the machine should
165 * Object state machine dispatcher.
170 const struct fscache_state *state, *new_state;
178 object->debug_id, object->state->name, object->events);
183 state = object->state;
194 state = t->transit_to;
195 ASSERT(state->work != NULL);
206 if (!state->work) {
208 for (t = state->transitions; t->events; t++) {
212 trace_fscache_osm(object, state,
217 state->name, new_state->name);
218 object->state = state = new_state;
231 _debug("{OBJ%x} exec %s", object->debug_id, state->name);
233 trace_fscache_osm(object, state, false, oob, event);
234 new_state = state->work(object, event);
237 _debug("{OBJ%x} %s notrans", object->debug_id, state->name);
238 if (unlikely(state == STATE(OBJECT_DEAD))) {
248 object->debug_id, state->name, new_state->name);
249 object->state = state = new_state;
251 if (state->work) {
252 if (unlikely(state == STATE(OBJECT_DEAD))) {
259 /* Transited to wait state */
261 for (t = state->transitions; t->events; t++)
309 object->state = STATE(WAIT_FOR_INIT);
336 for (t = object->state->transitions; t->events; t++)
388 _debug("parent: %s of:%lx", parent->state->name, parent->flags);
514 _enter("{OBJ%x,%s}", object->debug_id, object->state->name);
547 _enter("{OBJ%x,%s}", object->debug_id, object->state->name);
919 * This function consults the netfs about the coherency state of an object.