forked from bazil/fuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse_kernel_linux.go
41 lines (34 loc) · 1.48 KB
/
fuse_kernel_linux.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package fuse
import "golang.org/x/sys/unix"
func openFlags(flags uint32) OpenFlags {
// on amd64, the 32-bit O_LARGEFILE flag is always seen;
// on i386, the flag probably depends on the app
// requesting, but in any case should be utterly
// uninteresting to us here; our kernel protocol messages
// are not directly related to the client app's kernel
// API/ABI
flags &^= 0x8000
return OpenFlags(flags)
}
const (
FAllocateKeepSize FAllocateFlags = unix.FALLOC_FL_KEEP_SIZE
FAllocatePunchHole FAllocateFlags = unix.FALLOC_FL_PUNCH_HOLE
// Only including constants supported by FUSE kernel implementation.
//
// FAllocateCollapseRange FAllocateFlags = unix.FALLOC_FL_COLLAPSE_RANGE
// FAllocateInsertRange FAllocateFlags = unix.FALLOC_FL_INSERT_RANGE
// FAllocateNoHideStale FAllocateFlags = unix.FALLOC_FL_NO_HIDE_STALE
// FAllocateUnshareRange FAllocateFlags = unix.FALLOC_FL_UNSHARE_RANGE
// FAllocateZeroRange FAllocateFlags = unix.FALLOC_FL_ZERO_RANGE
)
var fAllocateFlagsNames = []flagName{
{uint32(FAllocatePunchHole), "FAllocatePunchHole"},
{uint32(FAllocateKeepSize), "FAllocateKeepSize"},
// Only including constants supported by FUSE kernel implementation.
//
// {uint32(FAllocateCollapseRange), "FAllocateCollapseRange"},
// {uint32(FAllocateInsertRange), "FAllocateInsertRange"},
// {uint32(FAllocateNoHideStale), "FAllocateNoHideStale"},
// {uint32(FAllocateUnshareRange), "FAllocateUnshareRange"},
// {uint32(FAllocateZeroRange), "FAllocateZeroRange"},
}