sync: implement read in MemoryFS

This commit is contained in:
KernelDeimos
2025-10-30 16:45:25 -04:00
committed by Eric Dubé
parent 875ecc051b
commit 19314d6496

View File

@@ -596,6 +596,20 @@ class MemoryFSProvider {
return node;
}
async read({
context,
node,
}) {
// TODO: once MemoryFS aggregates its own storage, don't get it
// via mountpoint service.
const svc_mountpoint = context.get('services').get('mountpoint');
const storage = svc_mountpoint.get_storage(this.constructor.name);
const stream = (await storage.create_read_stream(await node.get('uid'), {
memory_file: node.entry,
}));
return stream;
}
}
module.exports = {