fn process(&mut self, event: &EpollEvent, evmgr: &mut EventManager) {
        let source = event.fd();
        let event_set = event.event_set();

        // TODO: also check for errors. Pending high level discussions on how we want
        // to handle errors in devices.
        let supported_events = EventSet::IN;
        if !supported_events.contains(event_set) {
            warn!(
                "Block: Received unknown event: {:?} from source: {:?}",
                event_set, source
            );
            return;
        }

        if self.is_activated() {
            let queue_evt = self.queue_evts[0].as_raw_fd();
            let activate_fd = self.activate_evt.as_raw_fd();

            // Looks better than C style if/else if/else.
            match source {
                _ if queue_evt == source => self.process_queue_event(),
                _ if activate_fd == source => self.process_activate_event(evmgr),
                _ => warn!("Block: Spurious event received: {:?}", source),
            }
        } else {
            warn!(
                "Block: The device is not yet activated. Spurious event received: {:?}",
                source
            );
        }
    }
// Handle an event for queue.
Handle an event for queue.
Handle an event for queue .
fn process(&mut self, event: &EpollEvent, evmgr: &mut EventManager) {
        let source = event.fd();
        let event_set = event.event_set();
        // TODO: also check for errors. Pending high level discussions on how we want
        // to handle errors in devices.
        let supported_events = EventSet::IN;
        if !supported_events.contains(event_set) {
            warn!(
                "Block: Received unknown event: {:?} from source: {:?}",
                event_set, source
            );
            return;
        }
        if self.is_activated() {
            let queue_evt = self.queue_evts[0].as_raw_fd();
            let activate_fd = self.activate_evt.as_raw_fd();
            // Looks better than C style if/else if/else.
            match source {
                _ if queue_evt == source => self.process_queue_event(),
                _ if activate_fd == source => self.process_activate_event(evmgr),
                _ => warn!("Block: Spurious event received: {:?}", source),
            }
        } else {
            warn!(
                "Block: The device is not yet activated. Spurious event received: {:?}",
                source
            );
        }
    }
fn process ( & mut self , event : & EpollEvent , evmgr : & mut EventManager ) { let source = event . fd ( ) ; let event_set = event . event_set ( ) ; // TODO: also check for errors. Pending high level discussions on how we want // to handle errors in devices. let supported_events = EventSet :: IN ; if ! supported_events . contains ( event_set ) { warn ! ( " " event_set source ) ; return ; } if self . is_activated ( ) { let queue_evt = self . queue_evts [ 0 ] . as_raw_fd ( ) ; let activate_fd = self . activate_evt . as_raw_fd ( ) ; // Looks better than C style if/else if/else. match source { _ if queue_evt == source => self . process_queue_event ( ) , _ if activate_fd == source => self . process_activate_event ( evmgr ) , _ => warn ! ( " " source ) , } } else { warn ! ( " " source ) ; } }
Handle an event for queue.
Handle an event for queue .
&mut self
event
&EpollEvent
evmgr
&mut EventManager