K 10 svn:author V 7 asomers K 8 svn:date V 27 2013-10-11T21:50:04.324995Z K 7 svn:log V 1385 Fix a bug in zfsd whereby it won't degrade or fault a drive if the devd socket gets HUPed after the drive's last error. The key was to not discard case files when the socket gets HUPed, because doing so drops their callouts. * When calling CaseFile::PurgeAll (such as happens after the DevD socket gets HUPed), serialize case files before purging them. That way, they can be read back in after the connection to devd is restored and proessing may continue. * Added Callout::TimeRemaining to calculate how much time until any given callout expires. * When registering callouts, compute the timeout value based on the event's timestamp, not the present time. * In CaseFile::Serialize, serialize both m_events and m_tentativeEvents. Tentative events will be prefixed with "tentative " in the serialized file. * In DeSerializeFile, push tentative events and regular events into the corresponding m_events or m_tentativeEvents, as appropriate. * ExtractEvents will timestamp each incoming event with a timestamp=seconds_since_epoch nvpair, if not already present. Added a DevCtlEvent::getTimestamp method to read it. * style: in ZfsDaemon::EventLoop changed fds->XXX to fds[0]. to emphase that fds is an array. * A few minor typo fixes in comments. Submitted by: asomers Approved by: ken (mentor) Sponsored by: Spectra Logic Corporation END