-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefine.go
102 lines (89 loc) · 1.6 KB
/
define.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package tfsclient
/* error code */
const (
TFS_SUCCESS = 0
TFS_ERROR = 1
EXIT_INVALIDFD_ERROR = -1005
)
/* block cache default config */
const (
DEFAULT_BLOCK_CACHE_TIME = 1800
DEFAULT_BLOCK_CACHE_ITEMS = 500000
)
/* cluster group count and group seq default value */
const (
DEFAULT_CLUSTER_GROUP_COUNT = 1
DEFAULT_CLUSTER_GROUP_SEQ = 0
)
/* tfs file name standard name length */
const (
FILE_NAME_LEN = 18
TFS_FILE_LEN = FILE_NAME_LEN + 1
FILE_NAME_EXCEPT_SUFFIX_LEN = 12
MAX_FILE_NAME_LEN = 128
MAX_SUFFIX_LEN = MAX_FILE_NAME_LEN - TFS_FILE_LEN
STANDARD_SUFFIX_LEN = 4
)
type TfsFileStat struct {
FileId uint64
Offset int32
Size, USize int64
ModifyTime int64
CreateTime int64
Flag int32
CRC uint32
}
/* open flag */
const (
T_DEFAULT = 0
T_READ = 1 << (iota - 1)
T_WRITE
T_CREATE
T_NEWBLK
T_NOLEASE
T_STAT
T_LARGE
T_UNLINK
T_FORCE
)
/* tfs seek type */
const (
T_SEEK_SET = iota
T_SEEK_CUR
T_SEEK_END
)
/* tfs stat type */
const (
NORMAL_STAT = iota
FORCE_STAT
)
/* unlink type */
const (
DELETE = 0
UNDELETE = 2
CONCEAL = 4
REVEAL = 6
OVERRIDE = 128
)
/* option flag */
const (
TFS_FILE_DEFAULT_OPTION = iota
TFS_FILE_NO_SYNC_LOG
TFS_FILE_CLOSE_FLAG_WRITE_DATA_FAILED
)
/* read data option flag */
const (
READ_DATA_OPTION_FLAG_NORMAL = iota
READ_DATA_OPTION_FLAG_FORCE
)
/* cache type */
const (
LOCAL_CACHE = iota
REMOTE_CACHE
)
/* use cache flag */
const (
USE_CACHE_FLAG_NO = 0x00
USE_CACHE_FLAG_LOCAL = 0x01
USE_CACHE_FLAG_REMOTE = 0x02
)