Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
a067b22c
Commit
a067b22c
authored
Oct 16, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues around statfs(2) changes with osxfuse 3.
Tested on OS X 10.11.6 (15G1004) with osxfuse 3.5.2.
parent
b2c33963
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
32 deletions
+44
-32
fuseops/ops.go
fuseops/ops.go
+2
-2
samples/statfs/statfs_darwin_test.go
samples/statfs/statfs_darwin_test.go
+42
-30
No files found.
fuseops/ops.go
View file @
a067b22c
...
@@ -59,7 +59,7 @@ type StatFSOp struct {
...
@@ -59,7 +59,7 @@ type StatFSOp struct {
//
//
// On Linux this can be any value, and will be faithfully returned to the
// On Linux this can be any value, and will be faithfully returned to the
// caller of statfs(2) (see the code walk above). On OS X it appears that
// caller of statfs(2) (see the code walk above). On OS X it appears that
// only powers of 2 in the range [2^
9, 2^17
] are preserved, and a value of
// only powers of 2 in the range [2^
7, 2^20
] are preserved, and a value of
// zero is treated as 4096.
// zero is treated as 4096.
//
//
// This interface does not distinguish between blocks and block fragments.
// This interface does not distinguish between blocks and block fragments.
...
@@ -85,7 +85,7 @@ type StatFSOp struct {
...
@@ -85,7 +85,7 @@ type StatFSOp struct {
// transfer block size".
// transfer block size".
//
//
// On Linux this can be any value. On OS X it appears that only powers of 2
// On Linux this can be any value. On OS X it appears that only powers of 2
// in the range [2^12, 2^2
0
] are faithfully preserved, and a value of zero is
// in the range [2^12, 2^2
5
] are faithfully preserved, and a value of zero is
// treated as 65536.
// treated as 65536.
IoSize
uint32
IoSize
uint32
...
...
samples/statfs/statfs_darwin_test.go
View file @
a067b22c
...
@@ -70,7 +70,7 @@ func (t *StatFSTest) Syscall_ZeroValues() {
...
@@ -70,7 +70,7 @@ func (t *StatFSTest) Syscall_ZeroValues() {
ExpectEq
(
0
,
stat
.
Bavail
)
ExpectEq
(
0
,
stat
.
Bavail
)
ExpectEq
(
0
,
stat
.
Files
)
ExpectEq
(
0
,
stat
.
Files
)
ExpectEq
(
0
,
stat
.
Ffree
)
ExpectEq
(
0
,
stat
.
Ffree
)
ExpectEq
(
"osxfuse
fs
"
,
convertName
(
stat
.
Fstypename
[
:
]))
ExpectEq
(
"osxfuse"
,
convertName
(
stat
.
Fstypename
[
:
]))
ExpectEq
(
t
.
canonicalDir
,
convertName
(
stat
.
Mntonname
[
:
]))
ExpectEq
(
t
.
canonicalDir
,
convertName
(
stat
.
Mntonname
[
:
]))
ExpectEq
(
fsName
,
convertName
(
stat
.
Mntfromname
[
:
]))
ExpectEq
(
fsName
,
convertName
(
stat
.
Mntfromname
[
:
]))
}
}
...
@@ -105,7 +105,7 @@ func (t *StatFSTest) Syscall_NonZeroValues() {
...
@@ -105,7 +105,7 @@ func (t *StatFSTest) Syscall_NonZeroValues() {
ExpectEq
(
canned
.
BlocksAvailable
,
stat
.
Bavail
)
ExpectEq
(
canned
.
BlocksAvailable
,
stat
.
Bavail
)
ExpectEq
(
canned
.
Inodes
,
stat
.
Files
)
ExpectEq
(
canned
.
Inodes
,
stat
.
Files
)
ExpectEq
(
canned
.
InodesFree
,
stat
.
Ffree
)
ExpectEq
(
canned
.
InodesFree
,
stat
.
Ffree
)
ExpectEq
(
"osxfuse
fs
"
,
convertName
(
stat
.
Fstypename
[
:
]))
ExpectEq
(
"osxfuse"
,
convertName
(
stat
.
Fstypename
[
:
]))
ExpectEq
(
t
.
canonicalDir
,
convertName
(
stat
.
Mntonname
[
:
]))
ExpectEq
(
t
.
canonicalDir
,
convertName
(
stat
.
Mntonname
[
:
]))
ExpectEq
(
fsName
,
convertName
(
stat
.
Mntfromname
[
:
]))
ExpectEq
(
fsName
,
convertName
(
stat
.
Mntfromname
[
:
]))
}
}
...
@@ -120,8 +120,8 @@ func (t *StatFSTest) BlockSizes() {
...
@@ -120,8 +120,8 @@ func (t *StatFSTest) BlockSizes() {
expectedBsize
uint32
expectedBsize
uint32
}{
}{
0
:
{
0
,
4096
},
0
:
{
0
,
4096
},
1
:
{
1
,
512
},
1
:
{
1
,
128
},
2
:
{
3
,
512
},
2
:
{
3
,
128
},
3
:
{
511
,
512
},
3
:
{
511
,
512
},
4
:
{
512
,
512
},
4
:
{
512
,
512
},
5
:
{
513
,
1024
},
5
:
{
513
,
1024
},
...
@@ -129,16 +129,22 @@ func (t *StatFSTest) BlockSizes() {
...
@@ -129,16 +129,22 @@ func (t *StatFSTest) BlockSizes() {
7
:
{
1024
,
1024
},
7
:
{
1024
,
1024
},
8
:
{
4095
,
4096
},
8
:
{
4095
,
4096
},
9
:
{
1
<<
16
,
1
<<
16
},
9
:
{
1
<<
16
,
1
<<
16
},
10
:
{
1
<<
17
-
1
,
1
<<
17
},
10
:
{
1
<<
17
,
1
<<
17
},
11
:
{
1
<<
17
,
1
<<
17
},
11
:
{
1
<<
18
,
1
<<
18
},
12
:
{
1
<<
17
+
1
,
1
<<
17
},
12
:
{
1
<<
19
,
1
<<
19
},
13
:
{
1
<<
18
,
1
<<
17
},
14
:
{
1
<<
20
,
1
<<
17
},
13
:
{
1
<<
20
-
1
,
1
<<
20
},
15
:
{
math
.
MaxInt32
-
1
,
1
<<
17
},
14
:
{
1
<<
20
,
1
<<
20
},
16
:
{
math
.
MaxInt32
,
1
<<
17
},
15
:
{
1
<<
20
+
1
,
1
<<
20
},
17
:
{
math
.
MaxInt32
+
1
,
512
},
18
:
{
math
.
MaxInt32
+
1
<<
15
,
1
<<
15
},
16
:
{
1
<<
21
,
1
<<
20
},
19
:
{
math
.
MaxUint32
,
1
<<
17
},
17
:
{
1
<<
22
,
1
<<
20
},
18
:
{
math
.
MaxInt32
-
1
,
1
<<
20
},
19
:
{
math
.
MaxInt32
,
1
<<
20
},
20
:
{
math
.
MaxInt32
+
1
,
128
},
21
:
{
math
.
MaxInt32
+
1
<<
15
,
1
<<
15
},
22
:
{
math
.
MaxUint32
,
1
<<
20
},
}
}
for
i
,
tc
:=
range
testCases
{
for
i
,
tc
:=
range
testCases
{
...
@@ -179,14 +185,20 @@ func (t *StatFSTest) IoSizes() {
...
@@ -179,14 +185,20 @@ func (t *StatFSTest) IoSizes() {
6
:
{
8191
,
8192
},
6
:
{
8191
,
8192
},
7
:
{
8192
,
8192
},
7
:
{
8192
,
8192
},
8
:
{
8193
,
16384
},
8
:
{
8193
,
16384
},
9
:
{
1
<<
20
-
1
,
1
<<
20
},
9
:
{
1
<<
18
,
1
<<
18
},
10
:
{
1
<<
20
,
1
<<
20
},
10
:
{
1
<<
20
,
1
<<
20
},
11
:
{
1
<<
20
+
1
,
1
<<
20
},
11
:
{
1
<<
23
,
1
<<
23
},
12
:
{
math
.
MaxInt32
-
1
,
1
<<
20
},
13
:
{
math
.
MaxInt32
,
1
<<
20
},
12
:
{
1
<<
25
-
1
,
1
<<
25
},
14
:
{
math
.
MaxInt32
+
1
,
4096
},
13
:
{
1
<<
25
,
1
<<
25
},
15
:
{
math
.
MaxInt32
+
1
<<
15
,
1
<<
15
},
14
:
{
1
<<
25
+
1
,
1
<<
25
},
16
:
{
math
.
MaxUint32
,
1
<<
20
},
15
:
{
math
.
MaxInt32
-
1
,
1
<<
25
},
16
:
{
math
.
MaxInt32
,
1
<<
25
},
17
:
{
math
.
MaxInt32
+
1
,
4096
},
18
:
{
math
.
MaxInt32
+
1
<<
15
,
1
<<
15
},
19
:
{
math
.
MaxUint32
,
1
<<
25
},
}
}
for
i
,
tc
:=
range
testCases
{
for
i
,
tc
:=
range
testCases
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment