Lines Matching refs:refn
45 #define LONGGONE (-1000000) /* setting refn to gone */
67 int refn; /* usage reference count */
132 if(obj->refn < 0 ) /* must be the last announcement from dtdelete() */
133 { if(obj->refn != LONGGONE)
134 terror("Process %d: refn != LONGGONE op=%d obj[%d,refn=%d,fpid=%d]",
135 mmdc->pid, type&~DT_ANNOUNCE, obj->dval, obj->refn, obj->fpid);
137 tpause("Process %d: Op=%d != DT_DELETE obj[%d,refn=%d,fpid=%d]",
138 mmdc->pid, type&~DT_ANNOUNCE, obj->dval, obj->refn, obj->fpid);
155 if(asoincint(&obj->refn) < 0 )
156 tpause("Process %d: refn<0 on adding op=%d obj[%d,refn=%d,fpid=%d]",
157 mmdc->pid, type&~DT_ANNOUNCE, obj->dval, obj->refn, obj->fpid);
174 int refn;
179 terror("Process %d: multiple deletion? obj[%d,sval=%s,free=%d,pid=%d,refn=%d]",
180 mmdc->pid, obj->dval, obj->sval, obj->free, obj->fpid, obj->refn );
188 while(obj->refn > 0) /* wait until no further reference to it */
192 if((refn = (int)asocasint(&obj->refn, 0, (uint)LONGGONE)) != 0 )
193 terror("Process %d: refn=%d > 0? obj[%d,sval=%s,free=%d,pid=%d,refn=%d,op=%d]",
194 mmdc->pid, refn, obj->dval, obj->sval, obj->free, obj->fpid, obj->refn, obj->type );
333 if(o->refn != 1 ) /* everyone else should still be spinning */
334 terror("%s %s [num=%d,pid=%d]: refn != 1? obj[dval=%d,refn=%d,op=%d,opid=%d]",
335 actor, type, num, pid, o->dval, o->refn, o->type, o->opid);
338 asodecint(&o->refn); /* decrease o's reference count */
344 if(rv->refn <= 0 || rv->dval < 0) /* refn should be at least 1 */
345 terror("%s %s [num=%d,pid=%d]: refn <= 0? obj[dval=%d,refn=%d,op=%d,opid=%d]",
346 actor, type, num, pid, o->dval, o->refn, o->type, o->opid);
351 asodecint(&rv->refn); /* decrease rv's reference count */
370 if(o->refn <= 0 ) /* refn should be >= 1 */
371 terror("%s %s [num=%d,pid=%d]: refn <= 0? obj[dval=%d,refn=%d,op=%d,opid=%d]",
372 actor, type, num, pid, o->dval, o->refn, o->type, o->opid);
377 asodecint(&o->refn);
422 if(rv->refn <= 0) /* refn should be at least 1 just for us */
423 terror("%s %s [num=%d,pid=%d]: refn <= 0? obj[%d,refn=%d,op=%d,opid=%d]",
424 actor, type, num, pid, rv->dval, rv->refn, rv->type, rv->opid);
429 asodecint(&rv->refn);
446 terror("%s %s [num=%d,pid=%d]: already freed obj[%d,refn=%d,fpid=%d,op=%d,opid=%d ",
447 actor, type, num, pid, o->dval, o->refn, o->fpid, o->type, o->opid);
448 if(o->refn <= 0 ) /* refn must be >= 1 */
449 terror("%s %s [num=%d,pid=%d]: refn<=0? obj[%d,refn=%d,op=%d,opid=%d",
450 actor, type, num, pid, o->dval, o->refn, o->type, o->opid);
456 asodecint(&o->refn); /* reduce reference count */