rclone/vendor/bazil.org/fuse/protocol.go

82 lines
1.9 KiB
Go
Raw Normal View History

package fuse
import (
"fmt"
)
// Protocol is a FUSE protocol version number.
type Protocol struct {
Major uint32
Minor uint32
}
func (p Protocol) String() string {
return fmt.Sprintf("%d.%d", p.Major, p.Minor)
}
// LT returns whether a is less than b.
func (a Protocol) LT(b Protocol) bool {
return a.Major < b.Major ||
(a.Major == b.Major && a.Minor < b.Minor)
}
// GE returns whether a is greater than or equal to b.
func (a Protocol) GE(b Protocol) bool {
return a.Major > b.Major ||
(a.Major == b.Major && a.Minor >= b.Minor)
}
// HasAttrBlockSize returns whether Attr.BlockSize is respected by the
// kernel.
2020-06-27 16:45:12 +02:00
//
// Deprecated: Guaranteed to be true with our minimum supported
// protocol version.
func (a Protocol) HasAttrBlockSize() bool {
2020-06-27 16:45:12 +02:00
return true
}
// HasReadWriteFlags returns whether ReadRequest/WriteRequest
// fields Flags and FileFlags are valid.
2020-06-27 16:45:12 +02:00
//
// Deprecated: Guaranteed to be true with our minimum supported
// protocol version.
func (a Protocol) HasReadWriteFlags() bool {
2020-06-27 16:45:12 +02:00
return true
}
// HasGetattrFlags returns whether GetattrRequest field Flags is
// valid.
2020-06-27 16:45:12 +02:00
//
// Deprecated: Guaranteed to be true with our minimum supported
// protocol version.
func (a Protocol) HasGetattrFlags() bool {
2020-06-27 16:45:12 +02:00
return true
}
// HasOpenNonSeekable returns whether OpenResponse field Flags flag
// OpenNonSeekable is supported.
2020-06-27 16:45:12 +02:00
//
// Deprecated: Guaranteed to be true with our minimum supported
// protocol version.
func (a Protocol) HasOpenNonSeekable() bool {
2020-06-27 16:45:12 +02:00
return true
}
// HasUmask returns whether CreateRequest/MkdirRequest/MknodRequest
// field Umask is valid.
2020-06-27 16:45:12 +02:00
//
// Deprecated: Guaranteed to be true with our minimum supported
// protocol version.
func (a Protocol) HasUmask() bool {
2020-06-27 16:45:12 +02:00
return true
}
// HasInvalidate returns whether InvalidateNode/InvalidateEntry are
// supported.
2020-06-27 16:45:12 +02:00
//
// Deprecated: Guaranteed to be true with our minimum supported
// protocol version.
func (a Protocol) HasInvalidate() bool {
2020-06-27 16:45:12 +02:00
return true
}