fusekernel

package
v0.0.0-...-83118d4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtoVersionMinMajor = 7
	ProtoVersionMinMinor = 8
	ProtoVersionMaxMajor = 7
	ProtoVersionMaxMinor = 12
)

The FUSE version implemented by the package.

View Source
const (
	OpLookup      = 1
	OpForget      = 2 // no reply
	OpGetattr     = 3
	OpSetattr     = 4
	OpReadlink    = 5
	OpSymlink     = 6
	OpMknod       = 8
	OpMkdir       = 9
	OpUnlink      = 10
	OpRmdir       = 11
	OpRename      = 12
	OpLink        = 13
	OpOpen        = 14
	OpRead        = 15
	OpWrite       = 16
	OpStatfs      = 17
	OpRelease     = 18
	OpFsync       = 20
	OpSetxattr    = 21
	OpGetxattr    = 22
	OpListxattr   = 23
	OpRemovexattr = 24
	OpFlush       = 25
	OpInit        = 26
	OpOpendir     = 27
	OpReaddir     = 28
	OpReleasedir  = 29
	OpFsyncdir    = 30
	OpGetlk       = 31
	OpSetlk       = 32
	OpSetlkw      = 33
	OpAccess      = 34
	OpCreate      = 35
	OpInterrupt   = 36
	OpBmap        = 37
	OpDestroy     = 38
	OpIoctl       = 39 // Linux?
	OpPoll        = 40 // Linux?

	// OS X
	OpSetvolname = 61
	OpGetxtimes  = 62
	OpExchange   = 63
)

Opcodes

View Source
const (
	NotifyCodePoll       int32 = 1
	NotifyCodeInvalInode int32 = 2
	NotifyCodeInvalEntry int32 = 3
)
View Source
const DirentSize = 8 + 8 + 4 + 4
View Source
const InHeaderSize = int(unsafe.Sizeof(InHeader{}))
View Source
const InitInSize = int(unsafe.Sizeof(InitIn{}))
View Source
const (
	RootID = 1
)

Variables

This section is empty.

Functions

func AttrOutSize

func AttrOutSize(p Protocol) uintptr

func CreateInSize

func CreateInSize(p Protocol) uintptr

func EntryOutSize

func EntryOutSize(p Protocol) uintptr

func LkInSize

func LkInSize(p Protocol) uintptr

func MkdirInSize

func MkdirInSize(p Protocol) uintptr

func MknodInSize

func MknodInSize(p Protocol) uintptr

func ReadInSize

func ReadInSize(p Protocol) uintptr

func WriteInSize

func WriteInSize(p Protocol) uintptr

Types

type AccessIn

type AccessIn struct {
	Mask    uint32
	Padding uint32
}

type Attr

type Attr struct {
	Ino       uint64
	Size      uint64
	Blocks    uint64
	Atime     uint64
	Mtime     uint64
	Ctime     uint64
	AtimeNsec uint32
	MtimeNsec uint32
	CtimeNsec uint32
	Mode      uint32
	Nlink     uint32
	Uid       uint32
	Gid       uint32
	Rdev      uint32
	Blksize   uint32
	// contains filtered or unexported fields
}

func (*Attr) Crtime

func (a *Attr) Crtime() time.Time

func (*Attr) SetCrtime

func (a *Attr) SetCrtime(s uint64, ns uint32)

func (*Attr) SetFlags

func (a *Attr) SetFlags(f uint32)

type AttrOut

type AttrOut struct {
	AttrValid     uint64 // Cache timeout for the attributes
	AttrValidNsec uint32
	Dummy         uint32
	Attr          Attr
}

type BmapIn

type BmapIn struct {
	Block     uint64
	BlockSize uint32
	Padding   uint32
}

type BmapOut

type BmapOut struct {
	Block uint64
}

type CreateIn

type CreateIn struct {
	Flags uint32
	Mode  uint32
	Umask uint32
	// contains filtered or unexported fields
}

type Dirent

type Dirent struct {
	Ino     uint64
	Off     uint64
	Namelen uint32
	Type    uint32
	Name    [0]byte
}

type EntryOut

type EntryOut struct {
	Nodeid         uint64 // Inode ID
	Generation     uint64 // Inode generation
	EntryValid     uint64 // Cache timeout for the name
	AttrValid      uint64 // Cache timeout for the attributes
	EntryValidNsec uint32
	AttrValidNsec  uint32
	Attr           Attr
}

type ExchangeIn

type ExchangeIn struct {
	Olddir  uint64
	Newdir  uint64
	Options uint64
}

OS X

type FlushIn

type FlushIn struct {
	Fh         uint64
	FlushFlags uint32
	Padding    uint32
	LockOwner  uint64
}

type ForgetIn

type ForgetIn struct {
	Nlookup uint64
}

type FsyncIn

type FsyncIn struct {
	Fh         uint64
	FsyncFlags uint32
	Padding    uint32
}

type GetattrFlags

type GetattrFlags uint32

GetattrFlags are bit flags that can be seen in GetattrRequest.

const (
	// Indicates the handle is valid.
	GetattrFh GetattrFlags = 1 << 0
)

func (GetattrFlags) String

func (fl GetattrFlags) String() string

type GetattrIn

type GetattrIn struct {
	GetattrFlags uint32

	Fh uint64
	// contains filtered or unexported fields
}

type GetxattrIn

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

func (GetxattrIn) GetPosition

func (GetxattrIn) GetPosition() uint32

type GetxattrOut

type GetxattrOut struct {
	Size    uint32
	Padding uint32
}

type GetxtimesOut

type GetxtimesOut struct {
	Bkuptime     uint64
	Crtime       uint64
	BkuptimeNsec uint32
	CrtimeNsec   uint32
}

OS X

type InHeader

type InHeader struct {
	Len     uint32
	Opcode  uint32
	Unique  uint64
	Nodeid  uint64
	Uid     uint32
	Gid     uint32
	Pid     uint32
	Padding uint32
}

type InitFlags

type InitFlags uint32

The InitFlags are used in the Init exchange.

const (
	InitAsyncRead       InitFlags = 1 << 0
	InitPosixLocks      InitFlags = 1 << 1
	InitFileOps         InitFlags = 1 << 2
	InitAtomicTrunc     InitFlags = 1 << 3
	InitExportSupport   InitFlags = 1 << 4
	InitBigWrites       InitFlags = 1 << 5
	InitDontMask        InitFlags = 1 << 6
	InitSpliceWrite     InitFlags = 1 << 7
	InitSpliceMove      InitFlags = 1 << 8
	InitSpliceRead      InitFlags = 1 << 9
	InitFlockLocks      InitFlags = 1 << 10
	InitHasIoctlDir     InitFlags = 1 << 11
	InitAutoInvalData   InitFlags = 1 << 12
	InitDoReaddirplus   InitFlags = 1 << 13
	InitReaddirplusAuto InitFlags = 1 << 14
	InitAsyncDIO        InitFlags = 1 << 15
	InitWritebackCache  InitFlags = 1 << 16
	InitNoOpenSupport   InitFlags = 1 << 17

	InitCaseSensitive InitFlags = 1 << 29 // OS X only
	InitVolRename     InitFlags = 1 << 30 // OS X only
	InitXtimes        InitFlags = 1 << 31 // OS X only
)

func (InitFlags) String

func (fl InitFlags) String() string

type InitIn

type InitIn struct {
	Major        uint32
	Minor        uint32
	MaxReadahead uint32
	Flags        uint32
}

type InitOut

type InitOut struct {
	Major        uint32
	Minor        uint32
	MaxReadahead uint32
	Flags        uint32
	Unused       uint32
	MaxWrite     uint32
}

type InterruptIn

type InterruptIn struct {
	Unique uint64
}

type Kstatfs

type Kstatfs struct {
	Blocks  uint64
	Bfree   uint64
	Bavail  uint64
	Files   uint64
	Ffree   uint64
	Bsize   uint32
	Namelen uint32
	Frsize  uint32
	Padding uint32
	Spare   [6]uint32
}

type LinkIn

type LinkIn struct {
	Oldnodeid uint64
}

type ListxattrIn

type ListxattrIn struct {
	Size    uint32
	Padding uint32
}

type LkIn

type LkIn struct {
	Fh      uint64
	Owner   uint64
	Lk      fileLock
	LkFlags uint32
	// contains filtered or unexported fields
}

type LkOut

type LkOut struct {
	Lk fileLock
}

type MkdirIn

type MkdirIn struct {
	Mode  uint32
	Umask uint32
}

type MknodIn

type MknodIn struct {
	Mode  uint32
	Rdev  uint32
	Umask uint32
	// contains filtered or unexported fields
}

type NotifyInvalEntryOut

type NotifyInvalEntryOut struct {
	Parent  uint64
	Namelen uint32
	// contains filtered or unexported fields
}

type NotifyInvalInodeOut

type NotifyInvalInodeOut struct {
	Ino uint64
	Off int64
	Len int64
}

type OpenFlags

type OpenFlags uint32

OpenFlags are the O_FOO flags passed to open/create/etc calls. For example, os.O_WRONLY | os.O_APPEND.

const (
	// Access modes. These are not 1-bit flags, but alternatives where
	// only one can be chosen. See the IsReadOnly etc convenience
	// methods.
	OpenReadOnly  OpenFlags = syscall.O_RDONLY
	OpenWriteOnly OpenFlags = syscall.O_WRONLY
	OpenReadWrite OpenFlags = syscall.O_RDWR

	OpenAppend    OpenFlags = syscall.O_APPEND
	OpenCreate    OpenFlags = syscall.O_CREAT
	OpenExclusive OpenFlags = syscall.O_EXCL
	OpenSync      OpenFlags = syscall.O_SYNC
	OpenTruncate  OpenFlags = syscall.O_TRUNC
)

Flags that can be seen in OpenRequest.Flags.

const OpenAccessModeMask OpenFlags = syscall.O_ACCMODE

OpenAccessModeMask is a bitmask that separates the access mode from the other flags in OpenFlags.

func (OpenFlags) IsReadOnly

func (fl OpenFlags) IsReadOnly() bool

Return true if OpenReadOnly is set.

func (OpenFlags) IsReadWrite

func (fl OpenFlags) IsReadWrite() bool

Return true if OpenReadWrite is set.

func (OpenFlags) IsWriteOnly

func (fl OpenFlags) IsWriteOnly() bool

Return true if OpenWriteOnly is set.

func (OpenFlags) String

func (fl OpenFlags) String() string

type OpenIn

type OpenIn struct {
	Flags  uint32
	Unused uint32
}

type OpenOut

type OpenOut struct {
	Fh        uint64
	OpenFlags uint32
	Padding   uint32
}

type OpenResponseFlags

type OpenResponseFlags uint32

The OpenResponseFlags are returned in the OpenResponse.

const (
	OpenDirectIO    OpenResponseFlags = 1 << 0 // bypass page cache for this open file
	OpenKeepCache   OpenResponseFlags = 1 << 1 // don't invalidate the data cache on open
	OpenNonSeekable OpenResponseFlags = 1 << 2 // mark the file as non-seekable (not supported on OS X)

	OpenPurgeAttr OpenResponseFlags = 1 << 30 // OS X
	OpenPurgeUBC  OpenResponseFlags = 1 << 31 // OS X
)

func (OpenResponseFlags) String

func (fl OpenResponseFlags) String() string

type OutHeader

type OutHeader struct {
	Len    uint32
	Error  int32
	Unique uint64
}

type Protocol

type Protocol struct {
	Major uint32
	Minor uint32
}

Protocol is a FUSE protocol version number.

func (Protocol) GE

func (a Protocol) GE(b Protocol) bool

GE returns whether a is greater than or equal to b.

func (Protocol) HasAttrBlockSize

func (a Protocol) HasAttrBlockSize() bool

HasAttrBlockSize returns whether Attr.BlockSize is respected by the kernel.

func (Protocol) HasGetattrFlags

func (a Protocol) HasGetattrFlags() bool

HasGetattrFlags returns whether GetattrRequest field Flags is valid.

func (Protocol) HasInvalidate

func (a Protocol) HasInvalidate() bool

HasInvalidate returns whether InvalidateNode/InvalidateEntry are supported.

func (Protocol) HasOpenNonSeekable

func (a Protocol) HasOpenNonSeekable() bool

HasOpenNonSeekable returns whether OpenResponse field Flags flag OpenNonSeekable is supported.

func (Protocol) HasReadWriteFlags

func (a Protocol) HasReadWriteFlags() bool

HasReadWriteFlags returns whether ReadRequest/WriteRequest fields Flags and FileFlags are valid.

func (Protocol) HasUmask

func (a Protocol) HasUmask() bool

HasUmask returns whether CreateRequest/MkdirRequest/MknodRequest field Umask is valid.

func (Protocol) LT

func (a Protocol) LT(b Protocol) bool

LT returns whether a is less than b.

func (Protocol) String

func (p Protocol) String() string

type ReadFlags

type ReadFlags uint32

The ReadFlags are passed in ReadRequest.

const (
	// LockOwner field is valid.
	ReadLockOwner ReadFlags = 1 << 1
)

func (ReadFlags) String

func (fl ReadFlags) String() string

type ReadIn

type ReadIn struct {
	Fh        uint64
	Offset    uint64
	Size      uint32
	ReadFlags uint32
	LockOwner uint64
	Flags     uint32
	// contains filtered or unexported fields
}

type ReleaseFlags

type ReleaseFlags uint32

The ReleaseFlags are used in the Release exchange.

const (
	ReleaseFlush ReleaseFlags = 1 << 0
)

func (ReleaseFlags) String

func (fl ReleaseFlags) String() string

type ReleaseIn

type ReleaseIn struct {
	Fh           uint64
	Flags        uint32
	ReleaseFlags uint32
	LockOwner    uint32
}

type RenameIn

type RenameIn struct {
	Newdir uint64
}

type SetattrIn

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

func (*SetattrIn) BkupTime

func (in *SetattrIn) BkupTime() time.Time

func (*SetattrIn) Chgtime

func (in *SetattrIn) Chgtime() time.Time

func (*SetattrIn) Flags

func (in *SetattrIn) Flags() uint32

type SetattrValid

type SetattrValid uint32

The SetattrValid are bit flags describing which fields in the SetattrRequest are included in the change.

const (
	SetattrMode   SetattrValid = 1 << 0
	SetattrUid    SetattrValid = 1 << 1
	SetattrGid    SetattrValid = 1 << 2
	SetattrSize   SetattrValid = 1 << 3
	SetattrAtime  SetattrValid = 1 << 4
	SetattrMtime  SetattrValid = 1 << 5
	SetattrHandle SetattrValid = 1 << 6

	// Linux only(?)
	SetattrAtimeNow  SetattrValid = 1 << 7
	SetattrMtimeNow  SetattrValid = 1 << 8
	SetattrLockOwner SetattrValid = 1 << 9 // http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg27852.html

	// OS X only
	SetattrCrtime   SetattrValid = 1 << 28
	SetattrChgtime  SetattrValid = 1 << 29
	SetattrBkuptime SetattrValid = 1 << 30
	SetattrFlags    SetattrValid = 1 << 31
)

func (SetattrValid) Atime

func (fl SetattrValid) Atime() bool

func (SetattrValid) AtimeNow

func (fl SetattrValid) AtimeNow() bool

func (SetattrValid) Bkuptime

func (fl SetattrValid) Bkuptime() bool

func (SetattrValid) Chgtime

func (fl SetattrValid) Chgtime() bool

func (SetattrValid) Crtime

func (fl SetattrValid) Crtime() bool

func (SetattrValid) Flags

func (fl SetattrValid) Flags() bool

func (SetattrValid) Gid

func (fl SetattrValid) Gid() bool

func (SetattrValid) Handle

func (fl SetattrValid) Handle() bool

func (SetattrValid) LockOwner

func (fl SetattrValid) LockOwner() bool

func (SetattrValid) Mode

func (fl SetattrValid) Mode() bool

func (SetattrValid) Mtime

func (fl SetattrValid) Mtime() bool

func (SetattrValid) MtimeNow

func (fl SetattrValid) MtimeNow() bool

func (SetattrValid) Size

func (fl SetattrValid) Size() bool

func (SetattrValid) String

func (fl SetattrValid) String() string

func (SetattrValid) Uid

func (fl SetattrValid) Uid() bool

type SetxattrIn

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

func (SetxattrIn) GetPosition

func (SetxattrIn) GetPosition() uint32

type StatfsOut

type StatfsOut struct {
	St Kstatfs
}

type WriteFlags

type WriteFlags uint32

The WriteFlags are passed in WriteRequest.

const (
	WriteCache WriteFlags = 1 << 0
	// LockOwner field is valid.
	WriteLockOwner WriteFlags = 1 << 1
)

func (WriteFlags) String

func (fl WriteFlags) String() string

type WriteIn

type WriteIn struct {
	Fh         uint64
	Offset     uint64
	Size       uint32
	WriteFlags uint32
	LockOwner  uint64
	Flags      uint32
	// contains filtered or unexported fields
}

type WriteOut

type WriteOut struct {
	Size    uint32
	Padding uint32
}

Jump to

Keyboard shortcuts

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