The Pedigree Project 0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
VfsMountView Class Reference

#include <MountView.h>

+ Collaboration diagram for VfsMountView:

Classes

struct  MountSnapshot
 
struct  ResolveOptions
 
struct  State
 
class  WriteLease
 

Public Types

enum  MountFlags : uint64_t { ReadOnly = 1 , NoSuid = 2 , NoDev = 4 , NoExec = 8 }
 
enum class  BackingOwnership { External , Attachment }
 

Public Member Functions

 VfsMountView (VFS &vfs)
 
bool initialise (Filesystem *bootRoot)
 
bool createBootContext (FilesystemContextOwner &result)
 
bool forkNamespace (const FilesystemContextRef &context, FilesystemContextOwner &result, uint64_t ownerNamespace=0)
 
uint64_t ownerNamespace () const
 
bool resolve (const FilesystemContextRef &context, const FilesystemPathRef &start, const String &path, const ResolveOptions &options, FilesystemPathRef &result)
 
bool follow (const FilesystemContextRef &context, const FilesystemPathRef &selected, FilesystemPathRef &result)
 
bool resolveParent (const FilesystemContextRef &context, const FilesystemPathRef &start, const String &path, FilesystemPathRef &parent, String &basename)
 
bool changeCwd (const FilesystemContextRef &context, const FilesystemPathRef &path)
 
bool changeRoot (const FilesystemContextRef &context, const FilesystemPathRef &path)
 
bool formatPath (const FilesystemContextSnapshot &context, const FilesystemPathRef &path, String &result)
 
bool snapshotMounts (const FilesystemContextRef &context, Vector< MountSnapshot > &result)
 
bool attach (const FilesystemContextRef &context, const FilesystemPathRef &covered, Filesystem *backing, BackingOwnership ownership=BackingOwnership::External, uint64_t flags=0)
 
bool bind (const FilesystemContextRef &context, const FilesystemPathRef &source, const FilesystemPathRef &target, bool recursive)
 
bool remount (const FilesystemContextRef &context, const FilesystemPathRef &target, uint64_t flags, bool recursive=false)
 
uint64_t mountFlags (const FilesystemPathRef &path) const
 
bool writable (const FilesystemPathRef &path) const
 
bool detach (const FilesystemContextRef &context, const String &target, bool lazy)
 
bool detachBackingForShutdown (Filesystem *backing)
 
bool detachBackingForRemoval (Filesystem *backing)
 
bool shutdown (Vector< Filesystem * > &ownedBackings)
 
bool pivot (const FilesystemContextRef &context, const String &newRoot, const String &putOld)
 
uint64_t attachmentId (const FilesystemPathRef &path) const
 
bool isMountpoint (File *node) const
 
bool createFile (const FilesystemPathRef &parent, const String &name, uint32_t mask)
 
bool createDirectory (const FilesystemPathRef &parent, const String &name, uint32_t mask)
 
bool createSymlink (const FilesystemPathRef &parent, const String &name, const String &value)
 
bool createLink (const FilesystemPathRef &parent, const String &name, const FilesystemPathRef &target)
 
bool remove (const FilesystemPathRef &parent, const String &name, File *expected=nullptr)
 
bool rename (const FilesystemPathRef &oldParent, const String &oldName, const FilesystemPathRef &newParent, const String &newName, bool noReplace, bool sourceMustBeDirectory=false)
 
bool anonymousPath (File *retainedNode, FilesystemPathRef &result)
 
bool pathForNode (const FilesystemPathRef &sameAttachment, File *retainedNode, FilesystemPathRef &result)
 
bool samePath (const FilesystemPathRef &first, const FilesystemPathRef &second) const
 
uint64_t filesystemAccess (const FilesystemPathRef &path, const VFS::NamespaceMutation *writer=nullptr)
 
bool checkFilesystemAccess (const FilesystemPathRef &path, uint64_t access, const VFS::NamespaceMutation *writer=nullptr)
 
bool authorizeRemove (const FilesystemPathRef &parent, File *node, const VFS::NamespaceMutation &writer)
 
bool authorizeLink (const FilesystemPathRef &parent, const FilesystemPathRef &target, const VFS::NamespaceMutation &writer)
 
bool authorizeRename (const FilesystemPathRef &oldParent, File *source, const FilesystemPathRef &newParent, File *replaced, const VFS::NamespaceMutation &writer, bool removeSource=true)
 
Directory::AddStatus createEphemeral (const FilesystemPathRef &parent, File *node, uint64_t access)
 
bool bootRootPath (FilesystemPathRef &result)
 

Static Public Member Functions

static bool retainWrite (const FilesystemPathRef &path, SharedPointer< FilesystemWriteLease > &result)
 
static VfsMountView * fromContext (const FilesystemContextRef &context)
 
static VfsMountView * fromPath (const FilesystemPathRef &path)
 

Static Public Attributes

static constexpr uint64_t SupportedMountFlags = ReadOnly | NoSuid | NoDev | NoExec
 

Private Member Functions

void retain ()
 
void release ()
 
 VfsMountView (const VfsMountView &)=delete
 
VfsMountView & operator= (const VfsMountView &)=delete
 

Private Attributes

State * m_State
 
VFS & m_Vfs
 
size_t m_References = 1
 
bool m_Automatic = false
 
uint64_t m_OwnerNamespace = 0
 

Friends

class VfsPath
 
class VfsFilesystemContext
 

Detailed Description

One mount namespace. Filesystem registration and storage retirement stay in VFS.

Definition at line 17 of file MountView.h.

Member Enumeration Documentation

◆ BackingOwnership

enum class VfsMountView::BackingOwnership
strong

Definition at line 71 of file MountView.h.

◆ MountFlags

enum VfsMountView::MountFlags : uint64_t

Definition at line 32 of file MountView.h.

Constructor & Destructor Documentation

◆ VfsMountView()

VfsMountView::VfsMountView ( VFS &  vfs)
explicit

Definition at line 114 of file MountView.cc.

◆ ~VfsMountView()

VfsMountView::~VfsMountView ( )

Definition at line 129 of file MountView.cc.

Member Function Documentation

◆ anonymousPath()

bool VfsMountView::anonymousPath ( File *  retainedNode,
FilesystemPathRef &  result 
)

Definition at line 574 of file MountView.cc.

◆ attach()

bool VfsMountView::attach ( const FilesystemContextRef &  context,
const FilesystemPathRef &  covered,
Filesystem *  backing,
BackingOwnership  ownership = BackingOwnership::External,
uint64_t  flags = 0 
)

Definition at line 324 of file MountView-mounts.cc.

◆ attachmentId()

uint64_t VfsMountView::attachmentId ( const FilesystemPathRef &  path) const

Definition at line 564 of file MountView.cc.

◆ authorizeLink()

bool VfsMountView::authorizeLink ( const FilesystemPathRef &  parent,
const FilesystemPathRef &  target,
const VFS::NamespaceMutation &  writer 
)

Definition at line 158 of file MountView-access.cc.

◆ authorizeRemove()

bool VfsMountView::authorizeRemove ( const FilesystemPathRef &  parent,
File *  node,
const VFS::NamespaceMutation &  writer 
)

Definition at line 151 of file MountView-access.cc.

◆ authorizeRename()

bool VfsMountView::authorizeRename ( const FilesystemPathRef &  oldParent,
File *  source,
const FilesystemPathRef &  newParent,
File *  replaced,
const VFS::NamespaceMutation &  writer,
bool  removeSource = true 
)

Definition at line 179 of file MountView-access.cc.

◆ bind()

bool VfsMountView::bind ( const FilesystemContextRef &  context,
const FilesystemPathRef &  source,
const FilesystemPathRef &  target,
bool  recursive 
)

Definition at line 6 of file MountView-mounts.cc.

◆ bootRootPath()

bool VfsMountView::bootRootPath ( FilesystemPathRef &  result)

Definition at line 400 of file MountView.cc.

◆ changeCwd()

bool VfsMountView::changeCwd ( const FilesystemContextRef &  context,
const FilesystemPathRef &  path 
)

Definition at line 519 of file MountView.cc.

◆ changeRoot()

bool VfsMountView::changeRoot ( const FilesystemContextRef &  context,
const FilesystemPathRef &  path 
)

Definition at line 542 of file MountView.cc.

◆ checkFilesystemAccess()

bool VfsMountView::checkFilesystemAccess ( const FilesystemPathRef &  path,
uint64_t  access,
const VFS::NamespaceMutation *  writer = nullptr 
)

Definition at line 126 of file MountView-access.cc.

◆ createBootContext()

bool VfsMountView::createBootContext ( FilesystemContextOwner &  result)

Definition at line 413 of file MountView.cc.

◆ createDirectory()

bool VfsMountView::createDirectory ( const FilesystemPathRef &  parent,
const String &  name,
uint32_t  mask 
)

Definition at line 65 of file MountView-entries.cc.

◆ createEphemeral()

Directory::AddStatus VfsMountView::createEphemeral ( const FilesystemPathRef &  parent,
File *  node,
uint64_t  access 
)

Definition at line 145 of file MountView-entries.cc.

◆ createFile()

bool VfsMountView::createFile ( const FilesystemPathRef &  parent,
const String &  name,
uint32_t  mask 
)

Definition at line 54 of file MountView-entries.cc.

◆ createLink()

bool VfsMountView::createLink ( const FilesystemPathRef &  parent,
const String &  name,
const FilesystemPathRef &  target 
)

Definition at line 89 of file MountView-entries.cc.

◆ createSymlink()

bool VfsMountView::createSymlink ( const FilesystemPathRef &  parent,
const String &  name,
const String &  value 
)

Definition at line 77 of file MountView-entries.cc.

◆ detach()

bool VfsMountView::detach ( const FilesystemContextRef &  context,
const String &  target,
bool  lazy 
)

Definition at line 436 of file MountView-mounts.cc.

◆ detachBackingForRemoval()

bool VfsMountView::detachBackingForRemoval ( Filesystem *  backing)

Definition at line 646 of file MountView-mounts.cc.

◆ detachBackingForShutdown()

bool VfsMountView::detachBackingForShutdown ( Filesystem *  backing)

Definition at line 601 of file MountView-mounts.cc.

◆ filesystemAccess()

uint64_t VfsMountView::filesystemAccess ( const FilesystemPathRef &  path,
const VFS::NamespaceMutation *  writer = nullptr 
)

Definition at line 94 of file MountView-access.cc.

◆ follow()

bool VfsMountView::follow ( const FilesystemContextRef &  context,
const FilesystemPathRef &  selected,
FilesystemPathRef &  result 
)

Definition at line 389 of file MountView-path.cc.

◆ forkNamespace()

bool VfsMountView::forkNamespace ( const FilesystemContextRef &  context,
FilesystemContextOwner &  result,
uint64_t  ownerNamespace = 0 
)

Definition at line 240 of file MountView.cc.

◆ formatPath()

bool VfsMountView::formatPath ( const FilesystemContextSnapshot &  context,
const FilesystemPathRef &  path,
String &  result 
)

Definition at line 66 of file MountView-report.cc.

◆ fromContext()

VfsMountView * VfsMountView::fromContext ( const FilesystemContextRef &  context)
static

Definition at line 123 of file MountView.cc.

◆ fromPath()

VfsMountView * VfsMountView::fromPath ( const FilesystemPathRef &  path)
static

Definition at line 126 of file MountView.cc.

◆ initialise()

bool VfsMountView::initialise ( Filesystem *  bootRoot)

Definition at line 353 of file MountView.cc.

◆ isMountpoint()

bool VfsMountView::isMountpoint ( File *  node) const

Definition at line 44 of file MountView-entries.cc.

◆ mountFlags()

uint64_t VfsMountView::mountFlags ( const FilesystemPathRef &  path) const

Definition at line 135 of file MountView-mounts.cc.

◆ ownerNamespace()

uint64_t VfsMountView::ownerNamespace ( ) const
inline

Definition at line 56 of file MountView.h.

◆ pathForNode()

bool VfsMountView::pathForNode ( const FilesystemPathRef &  sameAttachment,
File *  retainedNode,
FilesystemPathRef &  result 
)

Definition at line 588 of file MountView.cc.

◆ pivot()

bool VfsMountView::pivot ( const FilesystemContextRef &  context,
const String &  newRoot,
const String &  putOld 
)

Definition at line 490 of file MountView-mounts.cc.

◆ release()

void VfsMountView::release ( )
private

Definition at line 118 of file MountView.cc.

◆ remount()

bool VfsMountView::remount ( const FilesystemContextRef &  context,
const FilesystemPathRef &  target,
uint64_t  flags,
bool  recursive = false 
)

Definition at line 198 of file MountView-mounts.cc.

◆ remove()

bool VfsMountView::remove ( const FilesystemPathRef &  parent,
const String &  name,
File *  expected = nullptr 
)

Definition at line 119 of file MountView-entries.cc.

◆ rename()

bool VfsMountView::rename ( const FilesystemPathRef &  oldParent,
const String &  oldName,
const FilesystemPathRef &  newParent,
const String &  newName,
bool  noReplace,
bool  sourceMustBeDirectory = false 
)

Definition at line 127 of file MountView-entries.cc.

◆ resolve()

bool VfsMountView::resolve ( const FilesystemContextRef &  context,
const FilesystemPathRef &  start,
const String &  path,
const ResolveOptions &  options,
FilesystemPathRef &  result 
)

Definition at line 352 of file MountView-path.cc.

◆ resolveParent()

bool VfsMountView::resolveParent ( const FilesystemContextRef &  context,
const FilesystemPathRef &  start,
const String &  path,
FilesystemPathRef &  parent,
String &  basename 
)

Definition at line 433 of file MountView-path.cc.

◆ retain()

void VfsMountView::retain ( )
private

Definition at line 115 of file MountView.cc.

◆ retainWrite()

bool VfsMountView::retainWrite ( const FilesystemPathRef &  path,
SharedPointer< FilesystemWriteLease > &  result 
)
static

Definition at line 171 of file MountView-mounts.cc.

◆ samePath()

bool VfsMountView::samePath ( const FilesystemPathRef &  first,
const FilesystemPathRef &  second 
) const

Definition at line 568 of file MountView.cc.

◆ shutdown()

bool VfsMountView::shutdown ( Vector< Filesystem * > &  ownedBackings)

Definition at line 670 of file MountView-mounts.cc.

◆ snapshotMounts()

bool VfsMountView::snapshotMounts ( const FilesystemContextRef &  context,
Vector< MountSnapshot > &  result 
)

Definition at line 81 of file MountView-report.cc.

◆ writable()

bool VfsMountView::writable ( const FilesystemPathRef &  path) const

Definition at line 185 of file MountView-mounts.cc.

Friends And Related Symbol Documentation

◆ VfsFilesystemContext

friend class VfsFilesystemContext
friend

Definition at line 125 of file MountView.h.

◆ VfsPath

friend class VfsPath
friend

Definition at line 124 of file MountView.h.

Member Data Documentation

◆ m_Automatic

bool VfsMountView::m_Automatic = false
private

Definition at line 130 of file MountView.h.

◆ m_OwnerNamespace

uint64_t VfsMountView::m_OwnerNamespace = 0
private

Definition at line 131 of file MountView.h.

◆ m_References

size_t VfsMountView::m_References = 1
private

Definition at line 129 of file MountView.h.

◆ m_State

State* VfsMountView::m_State
private

Definition at line 127 of file MountView.h.

◆ m_Vfs

VFS& VfsMountView::m_Vfs
private

Definition at line 128 of file MountView.h.

◆ SupportedMountFlags

constexpr uint64_t VfsMountView::SupportedMountFlags = ReadOnly | NoSuid | NoDev | NoExec
staticconstexpr

Definition at line 33 of file MountView.h.


The documentation for this class was generated from the following files: