tree: 783bfcfab74844747f69f32de834d79ac4be3cee [path history] [tgz]
  1. include/
  2. test/
  3. BUILD.gn
  4. dnode.cc
  5. dnode.h
  6. memfs.cc
  7. memfs.h
  8. memfs_api.cc
  9. README.md
  10. scoped_memfs.h
  11. vnode.cc
  12. vnode.h
  13. vnode_dir.cc
  14. vnode_dir.h
  15. vnode_file.cc
  16. vnode_file.h
  17. vnode_vmo.cc
  18. vnode_vmo.h
src/storage/memfs/README.md

memfs: a simple in-memory filesystem

This library implements a simple in-memory filesystem for Fuchsia.

It currently has no settings. Because it uses the C allocator, it can expand to fill all available memory and the max size values from POSIX statvfs() and FIDL fuchsia.io.Node.QueryFilesystem() may not have much meaning.

Usage

Typical in-tree C++ users should depend on //src/storage/memfs:cpp and #include "src/storage/memfs/scoped_memfs.h".

// Use a separate message loop to avoid deadlock on shutdown. The loop should
// enclose the memfs lifetime.
async::Loop loop(kAsyncLoopConfigNoAttachToCurrentThread);
loop.StartThread();

zx::status<ScopedMemfs> memfs =
    ScopedMemfs::CreateMountedAt(loop.dispatcher(), "/my_tmp");

Out-of-tree and C users should depend on //src/storage/memfs and #include <lib/memfs/memfs.h>.