At the moment, each of the (mini)dumpsys implementations writes to the
dump medium using dump_write(). In particular, they're required to keep
track of the current offset when writing, and write the kernel dump
headers themselves at the appropriate locations.
This introduces a lot of code duplication. It also makes it difficult to
support compressed dumps, since that requires some more control over the
layout of the dump on disk. This change lifts some of the state into
kern_dump.c and adds some new functions for use by dumpsys
implementations:
- dump_start and dump_finish are used to perform any needed state initialization and teardown, and are also useful for netdump.
- dump_append writes a block at the current dump offset. This is effectively the same as dump_write, but the caller does not specify an offset.
- dump_write is renamed to dump_write_raw to indicate that it provides raw access to the dumper; calling it does not modify any MI dump state. dump_write_raw is only used for textdumps and providers that attempt to stripe kernel dumps across multiple physical disks.