BP_LCM, BP_HCM, BP_NONE, BP_NONE
};
-/* Return pointer to the element of BP belonging to SP. */
-static struct bp *
-bp_ref(struct bp *bp, struct sctstr *sp)
-{
- return &bp[sp->sct_uid];
-}
-
/*
* Return the item value tracked in @bp for sector @sp's item @comm.
* @comm must be a tracked item type.
if (CANT_HAPPEN(idx < 0))
return sp->sct_item[comm];
- return bp_ref(bp, sp)->bp_item[idx];
+ return bp[sp->sct_uid].bp_item[idx];
}
/*
enum bp_item_idx idx = bud_key[comm];
if (idx >= 0)
- bp_ref(bp, sp)->bp_item[idx] = amount;
+ bp[sp->sct_uid].bp_item[idx] = amount;
}
/* Set the item values tracked in @bp from sector @sp. */
bp_put_items(struct bp *bp, struct sctstr *sp)
{
enum bp_item_idx idx;
- struct bp *p = bp_ref(bp, sp);
i_type i;
for (i = I_NONE + 1; i <= I_MAX; i++) {
idx = bud_key[i];
if (idx >= 0)
- p->bp_item[idx] = sp->sct_item[i];
+ bp[sp->sct_uid].bp_item[idx] = sp->sct_item[i];
}
}
int
bp_get_avail(struct bp *bp, struct sctstr *sp)
{
- return bp_ref(bp, sp)->bp_avail;
+ return bp[sp->sct_uid].bp_avail;
}
/* Set avail tracked in @bp for sector @sp to @amount. */
void
bp_put_avail(struct bp *bp, struct sctstr *sp, int amount)
{
- bp_ref(bp, sp)->bp_avail = amount;
+ bp[sp->sct_uid].bp_avail = amount;
}
/* Set the values tracked in @bp for sector @sp to the values in @sp. */