tree: 8c42b6356764e663a6b80e7f4b1bd953887213c4 [path history] [tgz]
  1. include/
  2. meta/
  3. test/
  4. BUILD.gn
  5. component.cc
  6. dnode.cc
  7. dnode.h
  8. memfs.cc
  9. memfs.h
  10. memfs_api.cc
  11. README.md
  12. scoped_memfs.h
  13. vnode.cc
  14. vnode.h
  15. vnode_dir.cc
  16. vnode_dir.h
  17. vnode_file.cc
  18. vnode_file.h
  19. vnode_vmo.cc
  20. 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::result<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>.