memimport: Support memfd blocks
authorAhmed S. Darwish <darwish.07@gmail.com>
Sat, 12 Mar 2016 23:07:27 +0000 (01:07 +0200)
committerDavid Henningsson <david.henningsson@canonical.com>
Sat, 2 Apr 2016 03:51:00 +0000 (05:51 +0200)
commitf8714af56bfcfeccd15a091c47492d3dc3008f61
treefeebbb0ae47e2570c14d4996a0beb45c4922e117
parent73e86b1cb164b1c37b27238b529879a4a2d9f24c
memimport: Support memfd blocks

To transfer memfd-backed blocks without passing their fd every time,
thus minimizing overhead and avoiding fd leaks, a command is sent
with the memfd fd as ancil data very early on.

This command has an ID that uniquely identifies the memfd region.
Further memfd block references are then exclusively done using this
ID.

This commit implements the details of such 'permanent' mappings on
the receiving end, using memimport segments.

Suggested-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
src/pulsecore/memblock.c
src/pulsecore/memblock.h
src/pulsecore/pstream.c
src/pulsecore/shm.c
src/pulsecore/shm.h
src/tests/memblock-test.c