-
-#ifdef __osf__
- /* Account for an orpahned call to get memory.
- * Free that memory up and go on.
- *
- * The trick is that we need to be able to tell
- * the difference between an old call that kicked
- * off a thread where the memory was subsequently
- * orphaned, and the memory we're really interested
- * in. The thread helps by stamping the memory it
- * allocated with the parameters for the compressor
- * it belongs to. If the parameters match then this
- * is the memory we want (whether it was an actual
- * orphan or not we don't care.) If the parameters
- * don't match then this is an orphan.
- *
- * Note that cp->memreq.ret is the synchronization
- * point: we set it to EAGAIN in this function, then
- * wait for the thread to set it to something other
- * than EAGAIN before we fool with the data structure
- * again. Basically, if ret != EAGAIN then the thread
- * is working and it owns the memreq struture.
+ cp->xcomp = *comp;
+ cp->xstate = (*comp)->comp_alloc(opt_data, len);
+ if (cp->xstate == NULL)
+ error = ENOSR;
+ } else {
+ if (cp->rstate != NULL) {
+ (*cp->rcomp->decomp_free)(cp->rstate);
+ cp->rstate = NULL;
+ }
+ cp->rcomp = *comp;
+ cp->rstate = (*comp)->decomp_alloc(opt_data, len);
+ if (cp->rstate == NULL)
+ error = ENOSR;
+ }
+#else
+ if ((error = cp->memreq.thread_status) != EAGAIN)
+ if (iop->ioc_cmd == PPPIO_XCOMP) {
+ if (cp->xstate) {
+ (*cp->xcomp->comp_free)(cp->xstate);
+ cp->xstate = 0;
+ }
+ /* sanity check for compressor options