Commit 6d9ae31b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: add opcode and types for copyfilerange and lseek

add MaxPages to InitOut
parent 34f8ad4a
......@@ -58,6 +58,8 @@ const (
_OP_FALLOCATE = int32(43) // protocol version 19.
_OP_READDIRPLUS = int32(44) // protocol version 21.
_OP_RENAME2 = int32(45) // protocol version 23.
_OP_LSEEK = int32(46)
_OP_COPY_FILE_RANGE = int32(47)
// The following entries don't have to be compatible across Go-FUSE versions.
_OP_NOTIFY_INVAL_ENTRY = int32(100)
......@@ -539,6 +541,8 @@ func init() {
_OP_FALLOCATE: unsafe.Sizeof(FallocateIn{}),
_OP_READDIRPLUS: unsafe.Sizeof(ReadIn{}),
_OP_RENAME2: unsafe.Sizeof(RenameIn{}),
_OP_LSEEK: unsafe.Sizeof(LseekIn{}),
_OP_COPY_FILE_RANGE: unsafe.Sizeof(CopyFileRangeIn{}),
} {
operationHandlers[op].InputSize = sz
}
......@@ -568,6 +572,7 @@ func init() {
_OP_NOTIFY_STORE_CACHE: unsafe.Sizeof(NotifyStoreOut{}),
_OP_NOTIFY_RETRIEVE_CACHE: unsafe.Sizeof(NotifyRetrieveOut{}),
_OP_NOTIFY_DELETE: unsafe.Sizeof(NotifyInvalDeleteOut{}),
_OP_LSEEK: unsafe.Sizeof(LseekOut{}),
} {
operationHandlers[op].OutputSize = sz
}
......@@ -621,6 +626,8 @@ func init() {
_OP_FALLOCATE: "FALLOCATE",
_OP_READDIRPLUS: "READDIRPLUS",
_OP_RENAME2: "RENAME2",
_OP_LSEEK: "LSEEK",
_OP_COPY_FILE_RANGE: "COPY_FILE_RANGE",
} {
operationHandlers[op].Name = v
}
......@@ -690,6 +697,7 @@ func init() {
_OP_STATFS: func(ptr unsafe.Pointer) interface{} { return (*StatfsOut)(ptr) },
_OP_SYMLINK: func(ptr unsafe.Pointer) interface{} { return (*EntryOut)(ptr) },
_OP_GETLK: func(ptr unsafe.Pointer) interface{} { return (*LkOut)(ptr) },
_OP_LSEEK: func(ptr unsafe.Pointer) interface{} { return (*LseekOut)(ptr) },
} {
operationHandlers[op].DecodeOut = f
}
......@@ -725,6 +733,8 @@ func init() {
_OP_SETLKW: func(ptr unsafe.Pointer) interface{} { return (*LkIn)(ptr) },
_OP_RENAME2: func(ptr unsafe.Pointer) interface{} { return (*RenameIn)(ptr) },
_OP_INTERRUPT: func(ptr unsafe.Pointer) interface{} { return (*InterruptIn)(ptr) },
_OP_LSEEK: func(ptr unsafe.Pointer) interface{} { return (*LseekIn)(ptr) },
_OP_COPY_FILE_RANGE: func(ptr unsafe.Pointer) interface{} { return (*CopyFileRangeIn)(ptr) },
} {
operationHandlers[op].DecodeIn = f
}
......
......@@ -305,7 +305,9 @@ type InitOut struct {
CongestionThreshold uint16
MaxWrite uint32
TimeGran uint32
Unused [9]uint32
MaxPages uint16
Padding uint16
Unused [8]uint32
}
type _CuseInitIn struct {
......@@ -504,6 +506,27 @@ type FlushIn struct {
LockOwner uint64
}
type LseekIn struct {
Fh uint64
Offset uint64
Whence uint32
Padding uint32
}
type LseekOut struct {
Offset uint64
}
type CopyFileRangeIn struct {
FhIn uint64
OffIn uint64
NodeIdOut uint64
FhOut uint64
OffOut uint64
Len uint64
Flags uint64
}
type EntryOut struct {
NodeId uint64
Generation uint64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment