Documentation ¶
Index ¶
- Constants
- func FReleaseBlocks(f *os.File, offset, length, version uint64) error
- func FReleaseFile(f *os.File, version uint64) error
- func FSetAttrMore(f *os.File, version, size, flags uint64, ctime time.Time, crtime time.Time) error
- func FStageFile(f *os.File, version, offset uint64, b []byte) (int, error)
- func GetProjectID(f *os.File) (uint64, error)
- func InoToPath(dirfd *os.File, ino uint64) (string, error)
- func InoToPaths(dirfd *os.File, ino uint64) ([]string, error)
- func MoveData(from, to *os.File) error
- func OpenByHandle(dirfd *os.File, ino uint64, flags int) (uintptr, error)
- func OpenByID(dirfd *os.File, ino uint64, flags int, name string) (*os.File, error)
- func QuotaAddDataGID(f *os.File, id1, id2, gid, limit uint64, priority uint8) error
- func QuotaAddDataGIDGeneral(f *os.File, id1, id2, limit uint64, priority uint8) error
- func QuotaAddDataLiteral(f *os.File, id1, id2, id3, limit uint64, priority uint8) error
- func QuotaAddDataProject(f *os.File, id1, id2, project, limit uint64, priority uint8) error
- func QuotaAddDataProjectGeneral(f *os.File, id1, id2, limit uint64, priority uint8) error
- func QuotaAddDataUID(f *os.File, id1, id2, uid, limit uint64, priority uint8) error
- func QuotaAddDataUIDGeneral(f *os.File, id1, id2, limit uint64, priority uint8) error
- func QuotaAddInodeGID(f *os.File, id1, id2, gid, limit uint64, priority uint8) error
- func QuotaAddInodeGIDGeneral(f *os.File, id1, id2, limit uint64, priority uint8) error
- func QuotaAddInodeLiteral(f *os.File, id1, id2, id3, limit uint64, priority uint8) error
- func QuotaAddInodeProject(f *os.File, id1, id2, project, limit uint64, priority uint8) error
- func QuotaAddInodeProjectGeneral(f *os.File, id1, id2, limit uint64, priority uint8) error
- func QuotaAddInodeUID(f *os.File, id1, id2, uid, limit uint64, priority uint8) error
- func QuotaAddInodeUIDGeneral(f *os.File, id1, id2, limit uint64, priority uint8) error
- func QuotaDelete(f *os.File, q QuotaRule) error
- func ReleaseBlocks(path string, offset, length, version uint64) error
- func ReleaseFile(path string, version uint64) error
- func SendDataWaitErr(dirfd *os.File, ino, version, offset, op, count uint64, errno int64) error
- func SetAttrMore(path string, version, size, flags uint64, ctime time.Time, crtime time.Time) error
- func SetProjectID(f *os.File, projectid uint64) error
- func StageFile(path string, version, offset uint64, b []byte) (int, error)
- func StageMove(from, to *os.File, offset, version uint64) error
- func StageMoveAt(from, to *os.File, len, fromOffset, toOffset, version uint64) error
- type DataWaitingEntry
- type DiskUsage
- type FSID
- type InodesEntry
- type ListXattrHidden
- type Option
- type Parent
- type Query
- type QuorumInfo
- type QuotaOp
- type QuotaRule
- type QuotaType
- type Quotas
- type RuleSet
- type Stat
- type Time
- type TotalsGroup
- type WOption
- type Waiters
- type XOption
- type XattrQuery
- type XattrTotal
Constants ¶
const ( // format.h: SQ_OP_INODE QuotaInode = 0 // format.h: SQ_OP_DATA QuotaData = 1 )
const DATAWAITOPCHANGESIZE = 0x4
const DATAWAITOPREAD = 0x1
const DATAWAITOPWRITE = 0x2
const DIRENTFLAGLAST = 0x1
const IOCADDQUOTARULE = 0x4030e815
const IOCALLOCDETAIL = 0x4010e80c
const IOCDATAWAITERR = 0x4030e80b
const IOCDATAWAITING = 0x4028e806
const IOCDELQUOTARULE = 0x4030e816
const IOCGETPROJECTID = 0x8008e812
const IOCGETQUOTARULES = 0x8020e814
const IOCGETREFERRINGENTRIES = 0x4028e811
const IOCINOPATH = 0x4028e802
const IOCLISTXATTRHIDDEN = 0xc018e808
const IOCMOVEBLOCKS = 0x4030e80d
const IOCQUERYINODES = 0x4048e801
const IOCREADXATTRTOTALS = 0x4028e80f
const IOCRELEASE = 0x4018e803
const IOCSEARCHXATTRS = 0x4038e809
const IOCSETATTRMORE = 0x4030e807
const IOCSETPROJECTID = 0x4008e813
const IOCSTAGE = 0x4020e804
const IOCSTATFSMORE = 0x8030e80a
const IOCSTATMORE = 0x8038e805
const MBSTAGEFLG = 0x1
const QUERYINODESDATASEQ = 0x1
const QUERYINODESMETASEQ = 0x0
const SEARCHXATTRSOFLAGEND = 0x1
Variables ¶
This section is empty.
Functions ¶
func FReleaseBlocks ¶
FReleaseBlocks marks blocks offline and frees associated extents offset/length must be 4k aligned
func FReleaseFile ¶
FReleaseFile set file offline by freeing associated extents
func FSetAttrMore ¶
FSetAttrMore sets special scoutfs attributes for file handle
func FStageFile ¶
FStageFile rehydrates offline file
func InoToPath ¶
InoToPath converts an inode number to a path in the filesystem An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func InoToPaths ¶
InoToPaths converts an inode number to all paths in the filesystem An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func MoveData ¶
MoveData will move all of the extents in "from" file handle and append to the end of "to" file handle. The end of "to" must be 4KB aligned boundary. errors this can return: EINVAL: from_off, len, or to_off aren't a multiple of 4KB; the source
and destination files are the same inode; either the source or destination is not a regular file; the destination file has an existing overlapping extent.
EOVERFLOW: either from_off + len or to_off + len exceeded 64bits. EBADF: from_fd isn't a valid open file descriptor. EXDEV: the source and destination files are in different filesystems. EISDIR: either the source or destination is a directory. ENODATA: either the source or destination file have offline extents.
func OpenByHandle ¶
OpenByHandle is similar to OpenByID, but returns just the file descriptor and does not have the added overhead of getting the filename An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func OpenByID ¶
OpenByID will open a file by inode returning a typical *os.File An open file within scoutfs is supplied for ioctls (usually just the base mount point directory) The filename supplied is used for the *os.File info, but can be "" if not known or needed
func QuotaAddDataGID ¶
func QuotaAddDataGIDGeneral ¶
func QuotaAddDataLiteral ¶
func QuotaAddDataProject ¶
func QuotaAddDataUID ¶
func QuotaAddDataUIDGeneral ¶
func QuotaAddInodeGID ¶
func QuotaAddInodeGIDGeneral ¶
func QuotaAddInodeLiteral ¶
func QuotaAddInodeProject ¶
func QuotaAddInodeUID ¶
func QuotaAddInodeUIDGeneral ¶
func ReleaseBlocks ¶
ReleaseBlocks marks blocks offline and frees associated extents offset/length must be 4k aligned
func ReleaseFile ¶
ReleaseFile sets file offline by freeing associated extents
func SendDataWaitErr ¶
SendDataWaitErr sends an error to the data waiter task indicating that the data is no longer aviable. An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func SetAttrMore ¶
SetAttrMore sets special scoutfs attributes
func StageMove ¶
StageMove will move all of the extents in "from" file handle and stage the offline extents at offset "offset" in "to" file handle. The size of from and offset of "to" must be 4KB aligned boundary. errors this can return: EINVAL: from_off, len, or to_off aren't a multiple of 4KB; the source
and destination files are the same inode; either the source or destination is not a regular file; the destination file has an existing overlapping extent.
EOVERFLOW: either from_off + len or to_off + len exceeded 64bits. EBADF: from_fd isn't a valid open file descriptor. EXDEV: the source and destination files are in different filesystems. EISDIR: either the source or destination is a directory. ENODATA: either the source or destination file have offline extents.
func StageMoveAt ¶
StageMoveAt will move the extents (based on len) in "from" file handle at given offset to the "to" file handle at given offset. All offsets must be 4KB aligned boundary. All destination offsets must be offline extents. EINVAL: from_off, len, or to_off aren't a multiple of 4KB; the source
and destination files are the same inode; either the source or destination is not a regular file; the destination file has an existing overlapping extent.
EOVERFLOW: either from_off + len or to_off + len exceeded 64bits. EBADF: from_fd isn't a valid open file descriptor. EXDEV: the source and destination files are in different filesystems. EISDIR: either the source or destination is a directory. ENODATA: either the source or destination file have offline extents.
Types ¶
type DataWaitingEntry ¶
type DiskUsage ¶
type DiskUsage struct { TotalMetaBlocks uint64 FreeMetaBlocks uint64 TotalDataBlocks uint64 FreeDataBlocks uint64 }
DiskUsage holds usage information reported by the filesystem
type InodesEntry ¶
func (InodesEntry) Increment ¶
func (i InodesEntry) Increment() InodesEntry
Increment returns the next seq entry position
func (InodesEntry) String ¶
func (i InodesEntry) String() string
String returns the string representation of InodesEntry
type ListXattrHidden ¶
type ListXattrHidden struct {
// contains filtered or unexported fields
}
ListXattrHidden holds info for iterating on xattrs
func NewListXattrHidden ¶
func NewListXattrHidden(f *os.File, b []byte) *ListXattrHidden
NewListXattrHidden will list all scoutfs xattrs (including hidden) for file. If passed in buffer is nil, call will allocate its own buffer.
func (*ListXattrHidden) Next ¶
func (l *ListXattrHidden) Next() ([]string, error)
Next gets next set of results, complete when string slice is nil
type Option ¶
type Option func(*Query)
Option sets various options for NewQuery
func ByDSeq ¶
func ByDSeq(from, to InodesEntry) Option
ByDSeq gets inodes in range of data sequence from, to inclusive
func ByMSeq ¶
func ByMSeq(from, to InodesEntry) Option
ByMSeq gets inodes in range of metadata sequence from, to inclusive
func WithBatchSize ¶
WithBatchSize sets the max number of inodes to be returned at a time
type Parent ¶
type Parent struct { Ino uint64 // Parent inode Pos uint64 // Entry directory position in parent Type uint8 // Entry inode type matching DT_ enum values in readdir(3) Ent string // Entry name as known by parent }
Parent contains inode of parent and what the child inode is named within this parent
func GetParents ¶
GetParents returns all parents for the given inode An open file within scoutfs is supplied for ioctls (usually just the base mount point directory) If passed in buffer is nil, call will allocate its own buffer.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query to keep track of in-process query
func NewQuery ¶
NewQuery creates a new scoutfs Query Specify query type with By*() option (only 1 allowed, last one wins) and specify batching with WithBatchSize() An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func (*Query) Next ¶
func (q *Query) Next() ([]InodesEntry, error)
Next gets the next batch of inodes
func (*Query) SetLast ¶
func (q *Query) SetLast(l InodesEntry)
SetLast updates the sequence stopping point
type QuorumInfo ¶
QuorumInfo holds info for current mount quorum
func GetQuorumInfo ¶
func GetQuorumInfo(path string) (QuorumInfo, error)
GetQuorumInfo returns quorum info for curren mount
func (QuorumInfo) IsLeader ¶
func (q QuorumInfo) IsLeader() bool
IsLeader returns true if quorum status is a leader role
type QuotaRule ¶
type QuotaRule struct { Op QuotaOp QuotaValue [3]uint64 QuotaSource [3]uint8 QuotaFlags [3]uint8 Limit uint64 Prioirity uint8 Flags uint8 }
QuotaRule is attributes for a single quota rule
func (QuotaRule) HumanString ¶
func (QuotaRule) StringNoLimit ¶
type Quotas ¶
type Quotas struct {
// contains filtered or unexported fields
}
func GetQuotaRules ¶
GetQuotaRules initalizes reading the current quota set. Quota rules are not returned in sorted order, so to get the order which they are matched the full list must be collected then sorted.
type RuleSet ¶
type RuleSet []QuotaRule
RuleSet is a list of quota rules, when sorted these will be in the order as the filesystem would match them
type Stat ¶
type Stat struct { Meta_seq uint64 Data_seq uint64 Data_version uint64 Online_blocks uint64 Offline_blocks uint64 Crtime_sec uint64 Crtime_nsec uint32 X_pad [4]uint8 }
type TotalsGroup ¶
type TotalsGroup struct {
// contains filtered or unexported fields
}
func NewTotalsGroup ¶
func NewTotalsGroup(f *os.File, id1, id2 uint64, count int) *TotalsGroup
NewTotalsGroup creates a query to get the totals values for a defined group of totls (group is defined to match first 2 identifiers). Count specifies max number returned for each Next() call.
func (*TotalsGroup) Next ¶
func (t *TotalsGroup) Next() ([]XattrTotal, error)
Next returns next set of total values for the group
func (*TotalsGroup) Reset ¶
func (t *TotalsGroup) Reset()
Reset resets the totl query to the start of the group id again
type WOption ¶
type WOption func(*Waiters)
WOption sets various options for NewWaiters
func WithWaitersCount ¶
WithWaitersCount sets the max number of inodes to be returned at a time
type Waiters ¶
type Waiters struct {
// contains filtered or unexported fields
}
Waiters to keep track of data waiters
func NewWaiters ¶
NewWaiters creates a new scoutfs Waiters An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func (*Waiters) Next ¶
func (w *Waiters) Next() ([]DataWaitingEntry, error)
Next gets the next batch of data waiters, returns nil, nil if no waiters
type XOption ¶
type XOption func(*XattrQuery)
XOption sets various options for NewXattrQuery
func WithXBatchSize ¶
WithXBatchSize sets the max number of inodes to be returned at a time
func WithXStartIno ¶
WithXStartIno starts query at speficied inode
type XattrQuery ¶
type XattrQuery struct {
// contains filtered or unexported fields
}
XattrQuery to keep track of in-process xattr query
func NewXattrQuery ¶
func NewXattrQuery(f *os.File, key string, opts ...XOption) *XattrQuery
NewXattrQuery creates a new scoutfs Xattr Query Specify query xattr key and specify optinally batching with WithXBatchSize() An open file within scoutfs is supplied for ioctls (usually just the base mount point directory)
func (*XattrQuery) Next ¶
func (q *XattrQuery) Next() ([]uint64, error)
Next gets the next batch of inodes
type XattrTotal ¶
type XattrTotal struct { // Total is sum of all xattr values matching ids Total uint64 // Count is number of xattrs matching ids Count uint64 // ID is the id for this total ID [3]uint64 }
XattrTotal has the total values matching id triple
func ReadXattrTotals ¶
func ReadXattrTotals(f *os.File, id1, id2, id3 uint64) (XattrTotal, error)
ReadXattrTotals returns the XattrTotal for the given id