random: simplify accounting logic
This logic is exactly equivalent to the old logic, but it should be easier to see what it's doing. The equivalence depends on one fact from outside this function: when 'r->limit' is false, 'reserved' is zero. (Well, two facts; the other is that 'reserved' is never negative.) Cc: Jiri Kosina <jkosina@suse.cz> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: NGreg Price <price@mit.edu> Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
Showing
想要评论请 注册 或 登录