Simplify block_alloc function
authorFergus Simpson <afergs@google.com>
Thu, 17 Nov 2016 17:35:33 +0000 (09:35 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sun, 20 Nov 2016 20:55:11 +0000 (15:55 -0500)
commitd7aa19a78ac2dbd28c3e0c80e2b40d18e6020f14
tree95f0a44fe0cdb6058bd1dad54e870ad36f1b19e1
parent24f29c1568ab18e3c7e8e9e2031b8184857fc6b3
Simplify block_alloc function

Removed optimization from Plan 9 where the driver would attempt to make
use of extra memory reserved by malloc. Akaros does not currently have
the capability to get the real size of the reserved memory, so leaving
the optimization in just resulted in some complicated pointer arithmetic
that always yielded the defined constant Hdrspc.

The optimization has been left in comments in case Akaros ever gets the
ability to get the actual size of reserved memory.

Also added an assert that Hdrspc is aligned to BLOCKALIGN - if it were
not then Hdrspc would randomly be truncated by up to Hdrspc%BLOCKALIGN
bytes.

Change-Id: I5249df6fdd8f47f0f07b35fcf3f7fed45f61d383
Signed-off-by: Fergus Simpson <afergs@google.com>
[removed mlx4 references]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/ns/allocb.c