/* @(#)addquota.c 4.5 (Melbourne) 82/02/16 */
/* the "-1" in the next line is cause quotas are vals you have to be < than */
#define Sum(a) if (from->a && to->a) to->a += from->a - 1; else to->a = 0
register struct dqblk
*to
, *from
;
d1
= to
->dqb_ilim
- to
->dqb_iq
;
d2
= from
->dqb_ilim
- from
->dqb_iq
;
if (to
->dqb_iq
&& to
->dqb_ilim
&& from
->dqb_ilim
)
to
->dqb_ilim
= to
->dqb_iq
+ (d1
> d2
? d1
: d2
);
d1
= to
->dqb_blim
- to
->dqb_quot
;
d2
= from
->dqb_blim
- from
->dqb_quot
;
if (to
->dqb_quot
&& to
->dqb_blim
&& from
->dqb_blim
)
to
->dqb_blim
= to
->dqb_quot
+ (d1
> d2
? d1
: d2
);