dentry

package
v0.0.0-...-409fc48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package dentry holds dentry related files

Package dentry holds dentry related files

Index

Constants

This section is empty.

Variables

View Source
var ErrEntryNotFound = errors.New("entry not found")

ErrEntryNotFound is thrown when a path key was not found in the cache

Functions

func IsFakeInode

func IsFakeInode(inode uint64) bool

IsFakeInode returns whether the given inode is a fake inode

Types

type ErrDentryPathKeyNotFound

type ErrDentryPathKeyNotFound struct {
	PathKey model.PathKey
}

ErrDentryPathKeyNotFound is used to notify that the request key is missing from the kernel maps

func (ErrDentryPathKeyNotFound) Error

func (err ErrDentryPathKeyNotFound) Error() string

type ErrERPCRequestNotProcessed

type ErrERPCRequestNotProcessed struct{}

ErrERPCRequestNotProcessed is used to notify that the eRPC request was not processed

func (ErrERPCRequestNotProcessed) Error

func (err ErrERPCRequestNotProcessed) Error() string

type ErrERPCResolution

type ErrERPCResolution struct{}

ErrERPCResolution is used to notify that the eRPC resolution failed

func (ErrERPCResolution) Error

func (err ErrERPCResolution) Error() string

type ErrKernelMapResolution

type ErrKernelMapResolution struct{}

ErrKernelMapResolution is used to notify that the Kernel maps resolution failed

func (ErrKernelMapResolution) Error

func (err ErrKernelMapResolution) Error() string

type ErrTruncatedParents

type ErrTruncatedParents struct{}

ErrTruncatedParents is used to notify that some parents of the path are missing

func (ErrTruncatedParents) Error

func (err ErrTruncatedParents) Error() string

type ErrTruncatedParentsERPC

type ErrTruncatedParentsERPC struct{}

ErrTruncatedParentsERPC is used to notify that some parents of the path are missing

func (ErrTruncatedParentsERPC) Error

func (err ErrTruncatedParentsERPC) Error() string

type PathEntry

type PathEntry struct {
	Parent model.PathKey
	Name   string
}

PathEntry is the path structure saved in cache

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver resolves inode/mountID to full paths

func NewResolver

func NewResolver(config *config.Config, statsdClient statsd.ClientInterface, e *erpc.ERPC) (*Resolver, error)

NewResolver returns a new dentry resolver

func (*Resolver) Close

func (dr *Resolver) Close() error

Close cleans up the eRPC segment

func (*Resolver) DelCacheEntries

func (dr *Resolver) DelCacheEntries(mountID uint32)

DelCacheEntries removes all the entries belonging to a mountID

func (*Resolver) GetParent

func (dr *Resolver) GetParent(pathKey model.PathKey) (model.PathKey, error)

GetParent returns the parent mount_id/inode

func (*Resolver) Resolve

func (dr *Resolver) Resolve(pathKey model.PathKey, cache bool) (string, error)

Resolve the pathname of a dentry, starting at the pathnameKey in the pathnames table

func (*Resolver) ResolveFromCache

func (dr *Resolver) ResolveFromCache(pathKey model.PathKey) (string, error)

ResolveFromCache resolves path from the cache

func (*Resolver) ResolveFromERPC

func (dr *Resolver) ResolveFromERPC(pathKey model.PathKey, cache bool) (string, error)

ResolveFromERPC resolves the path of the provided inode / mount id / path id

func (*Resolver) ResolveFromMap

func (dr *Resolver) ResolveFromMap(pathKey model.PathKey, cache bool) (string, error)

ResolveFromMap resolves the path of the provided inode / mount id / path id

func (*Resolver) ResolveName

func (dr *Resolver) ResolveName(pathKey model.PathKey) string

ResolveName resolves an inode/mount ID pair to a file basename

func (*Resolver) ResolveNameFromCache

func (dr *Resolver) ResolveNameFromCache(pathKey model.PathKey) (string, error)

ResolveNameFromCache returns the name

func (*Resolver) ResolveNameFromMap

func (dr *Resolver) ResolveNameFromMap(pathKey model.PathKey) (string, error)

ResolveNameFromMap resolves the name of the provided inode

func (*Resolver) ResolveParentFromCache

func (dr *Resolver) ResolveParentFromCache(pathKey model.PathKey) (model.PathKey, error)

ResolveParentFromCache resolves the parent

func (*Resolver) ResolveParentFromMap

func (dr *Resolver) ResolveParentFromMap(pathKey model.PathKey) (model.PathKey, error)

ResolveParentFromMap resolves the parent

func (*Resolver) SendStats

func (dr *Resolver) SendStats() error

SendStats sends the dentry resolver metrics

func (*Resolver) Start

func (dr *Resolver) Start(manager *manager.Manager) error

Start the dentry resolver

func (*Resolver) ToJSON

func (dr *Resolver) ToJSON() ([]byte, error)

ToJSON return a json version of the cache

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL