Don't always assume NOPINGREPLY as a failure in RS

This commit is contained in:
Cristiano Giuffrida
2010-07-20 01:50:33 +00:00
parent 16d0609fad
commit af424b4e43
3 changed files with 41 additions and 3 deletions
+26
View File
@@ -1730,6 +1730,32 @@ PUBLIC struct rproc* lookup_slot_by_dev_nr(dev_t dev_nr)
return NULL;
}
/*===========================================================================*
* lookup_slot_by_flags *
*===========================================================================*/
PUBLIC struct rproc* lookup_slot_by_flags(int flags)
{
/* Lookup a service slot matching the given flags. */
int slot_nr;
struct rproc *rp;
if(!flags) {
return NULL;
}
for (slot_nr = 0; slot_nr < NR_SYS_PROCS; slot_nr++) {
rp = &rproc[slot_nr];
if (!(rp->r_flags & RS_IN_USE)) {
continue;
}
if (rp->r_flags & flags) {
return rp;
}
}
return NULL;
}
/*===========================================================================*
* alloc_slot *
*===========================================================================*/