Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-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
go-fuse
Commits
fcb5b5b5
Commit
fcb5b5b5
authored
Aug 25, 2016
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add StafsOut.FromStatfsT.
parent
e33e399b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
35 deletions
+32
-35
fuse/pathfs/loopback.go
fuse/pathfs/loopback.go
+11
-0
fuse/pathfs/loopback_darwin.go
fuse/pathfs/loopback_darwin.go
+0
-17
fuse/pathfs/loopback_linux.go
fuse/pathfs/loopback_linux.go
+0
-18
fuse/types_darwin.go
fuse/types_darwin.go
+10
-0
fuse/types_linux.go
fuse/types_linux.go
+11
-0
No files found.
fuse/pathfs/loopback.go
View file @
fcb5b5b5
...
...
@@ -37,6 +37,17 @@ func NewLoopbackFileSystem(root string) FileSystem {
}
}
func
(
fs
*
loopbackFileSystem
)
StatFs
(
name
string
)
*
fuse
.
StatfsOut
{
s
:=
syscall
.
Statfs_t
{}
err
:=
syscall
.
Statfs
(
fs
.
GetPath
(
name
),
&
s
)
if
err
==
nil
{
out
:=
&
fuse
.
StatfsOut
{}
out
.
FromStatfsT
(
&
s
)
return
out
}
return
nil
}
func
(
fs
*
loopbackFileSystem
)
OnMount
(
nodeFs
*
PathNodeFs
)
{
}
...
...
fuse/pathfs/loopback_darwin.go
View file @
fcb5b5b5
...
...
@@ -11,23 +11,6 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
func
(
fs
*
loopbackFileSystem
)
StatFs
(
name
string
)
*
fuse
.
StatfsOut
{
s
:=
syscall
.
Statfs_t
{}
err
:=
syscall
.
Statfs
(
fs
.
GetPath
(
name
),
&
s
)
if
err
==
nil
{
return
&
fuse
.
StatfsOut
{
Blocks
:
s
.
Blocks
,
Bfree
:
s
.
Bfree
,
Bavail
:
s
.
Bavail
,
Files
:
s
.
Files
,
Ffree
:
s
.
Ffree
,
Bsize
:
uint32
(
s
.
Iosize
),
// Iosize translates to Bsize: the optimal transfer size.
Frsize
:
s
.
Bsize
,
// Bsize translates to Frsize: the minimum transfer size.
}
}
return
nil
}
const
_UTIME_NOW
=
((
1
<<
30
)
-
1
)
const
_UTIME_OMIT
=
((
1
<<
30
)
-
2
)
...
...
fuse/pathfs/loopback_linux.go
View file @
fcb5b5b5
...
...
@@ -12,24 +12,6 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
func
(
fs
*
loopbackFileSystem
)
StatFs
(
name
string
)
*
fuse
.
StatfsOut
{
s
:=
syscall
.
Statfs_t
{}
err
:=
syscall
.
Statfs
(
fs
.
GetPath
(
name
),
&
s
)
if
err
==
nil
{
return
&
fuse
.
StatfsOut
{
Blocks
:
s
.
Blocks
,
Bsize
:
uint32
(
s
.
Bsize
),
Bfree
:
s
.
Bfree
,
Bavail
:
s
.
Bavail
,
Files
:
s
.
Files
,
Ffree
:
s
.
Ffree
,
Frsize
:
uint32
(
s
.
Frsize
),
NameLen
:
uint32
(
s
.
Namelen
),
}
}
return
nil
}
func
(
fs
*
loopbackFileSystem
)
ListXAttr
(
name
string
,
context
*
fuse
.
Context
)
([]
string
,
fuse
.
Status
)
{
data
,
err
:=
listXAttr
(
fs
.
GetPath
(
name
))
...
...
fuse/types_darwin.go
View file @
fcb5b5b5
...
...
@@ -141,3 +141,13 @@ type ExchangeIn struct {
Newdir
uint64
Options
uint64
}
func
(
s
*
StatfsOut
)
FromStatfsT
(
statfs
*
syscall
.
Statfs_t
)
{
s
.
Blocks
=
statfs
.
Blocks
s
.
Bfree
=
statfs
.
Bfree
s
.
Bavail
=
statfs
.
Bavail
s
.
Files
=
statfs
.
Files
s
.
Ffree
=
statfs
.
Ffree
s
.
Bsize
=
uint32
(
s
.
Iosize
)
// Iosize translates to Bsize: the optimal transfer size.
s
.
Frsize
=
s
.
Bsize
// Bsize translates to Frsize: the minimum transfer size.
}
fuse/types_linux.go
View file @
fcb5b5b5
...
...
@@ -108,3 +108,14 @@ type GetXAttrIn struct {
Size
uint32
Padding
uint32
}
func
(
s
*
StatfsOut
)
FromStatfsT
(
statfs
*
syscall
.
Statfs_t
)
{
s
.
Blocks
=
statfs
.
Blocks
s
.
Bsize
=
uint32
(
statfs
.
Bsize
)
s
.
Bfree
=
statfs
.
Bfree
s
.
Bavail
=
statfs
.
Bavail
s
.
Files
=
statfs
.
Files
s
.
Ffree
=
statfs
.
Ffree
s
.
Frsize
=
uint32
(
statfs
.
Frsize
)
s
.
NameLen
=
uint32
(
statfs
.
Namelen
)
}
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