fs: ramfs: Use dynamically sized chunks
This changes the way ramfs stores its data. So far we used equally sized chunks, this patch changes it to use chunks in a size that fits our needs. The chunks are always allocated in the size they are needed for the current truncation. Only if we fail to allocate all desired memory at once we fall back to allocating smaller chunks. Together with using the generic list implementation this results in smaller code and has the advantage that many image files end up being contiguously in memory and thus we can provide a memmap for them. Files will end up contiguously in memory when they are first created, then truncated to the final size and then filled up with data. This is something which is normally easily achievable when desired. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> |
---|
|
fs/ramfs.c |
---|