SYSCALL_DEFINE1(orientunlock_read, struct orientation_range *, orient) { int should_wake = decrement_reference_count(orient); if (should_wake == 0) wake_up_interruptible(&write_wait_queue); return 0; }
static void update_reference_counters_in_instruction( instruction *instruction, counter_update_type type ) { assert( instruction != NULL ); if ( instruction->actions == NULL ) { return; } for ( dlist_element *a = get_first_element( instruction->actions ); a != NULL; a = a->next ) { if ( a->data == NULL ) { continue; } action *action = a->data; if ( action->type == OFPAT_GROUP ) { if ( type == INCREMENT ) { increment_reference_count( action->group_id ); } else if ( type == DECREMENT ) { decrement_reference_count( action->group_id ); } else { error( "Undefined counter update type ( %#x ).", type ); } } } }
SYSCALL_DEFINE1(orientunlock_write, struct orientation_range *, orient) { decrement_reference_count(orient); wake_up_interruptible(&read_wait_queue); return 0; }