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
Levin Zimmermann
go-fuse
Commits
49cf5940
Commit
49cf5940
authored
May 01, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish.
parent
d87cbd06
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
28 deletions
+36
-28
README
README
+1
-1
fuse/fuse.go
fuse/fuse.go
+2
-1
fuse/loopback.go
fuse/loopback.go
+2
-2
fuse/opcode.go
fuse/opcode.go
+5
-0
fuse/types.go
fuse/types.go
+26
-24
No files found.
README
View file @
49cf5940
...
@@ -75,7 +75,7 @@ KNOWN PROBLEMS
...
@@ -75,7 +75,7 @@ KNOWN PROBLEMS
Grep source code for TODO. Major topics:
Grep source code for TODO. Major topics:
* Missing support for file locking: FUSE_GETLK, FUSE_SETLK, FUSE_SETLKW
* Missing support for file locking: FUSE_GETLK, FUSE_SETLK, FUSE_SETLKW
, STATFS
* Missing support for FUSE_INTERRUPT, FUSE_NOTIFY, CUSE, BMAP, POLL, IOCTL
* Missing support for FUSE_INTERRUPT, FUSE_NOTIFY, CUSE, BMAP, POLL, IOCTL
...
...
fuse/fuse.go
View file @
49cf5940
...
@@ -9,7 +9,8 @@ import (
...
@@ -9,7 +9,8 @@ import (
const
(
const
(
// bufSize should be a power of two to minimize lossage in
// bufSize should be a power of two to minimize lossage in
// BufferPool.
// BufferPool. The minimum is 8k, but it doesn't cost anything to
// use a much larger buffer.
bufSize
=
(
1
<<
16
)
bufSize
=
(
1
<<
16
)
maxRead
=
bufSize
-
PAGESIZE
maxRead
=
bufSize
-
PAGESIZE
)
)
...
...
fuse/loopback.go
View file @
49cf5940
...
@@ -51,10 +51,10 @@ func (me *LoopbackFileSystem) OpenDir(name string) (stream chan DirEntry, status
...
@@ -51,10 +51,10 @@ func (me *LoopbackFileSystem) OpenDir(name string) (stream chan DirEntry, status
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
OsErrorToErrno
(
err
)
return
nil
,
OsErrorToErrno
(
err
)
}
}
output
:=
make
(
chan
DirEntry
,
500
)
want
:=
500
output
:=
make
(
chan
DirEntry
,
want
)
go
func
()
{
go
func
()
{
for
{
for
{
want
:=
500
infos
,
err
:=
f
.
Readdir
(
want
)
infos
,
err
:=
f
.
Readdir
(
want
)
for
i
,
_
:=
range
infos
{
for
i
,
_
:=
range
infos
{
output
<-
DirEntry
{
output
<-
DirEntry
{
...
...
fuse/opcode.go
View file @
49cf5940
...
@@ -59,6 +59,11 @@ const (
...
@@ -59,6 +59,11 @@ const (
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
func
doInit
(
state
*
MountState
,
req
*
request
)
{
func
doInit
(
state
*
MountState
,
req
*
request
)
{
const
(
FUSE_KERNEL_VERSION
=
7
FUSE_KERNEL_MINOR_VERSION
=
13
)
input
:=
(
*
InitIn
)(
req
.
inData
)
input
:=
(
*
InitIn
)(
req
.
inData
)
if
input
.
Major
!=
FUSE_KERNEL_VERSION
{
if
input
.
Major
!=
FUSE_KERNEL_VERSION
{
log
.
Printf
(
"Major versions does not match. Given %d, want %d
\n
"
,
input
.
Major
,
FUSE_KERNEL_VERSION
)
log
.
Printf
(
"Major versions does not match. Given %d, want %d
\n
"
,
input
.
Major
,
FUSE_KERNEL_VERSION
)
...
...
fuse/types.go
View file @
49cf5940
...
@@ -6,43 +6,20 @@ import (
...
@@ -6,43 +6,20 @@ import (
)
)
const
(
const
(
FUSE_KERNEL_VERSION
=
7
FUSE_KERNEL_MINOR_VERSION
=
13
FUSE_ROOT_ID
=
1
FUSE_ROOT_ID
=
1
// OpenIn.Flags
FOPEN_DIRECT_IO
=
(
1
<<
0
)
FOPEN_KEEP_CACHE
=
(
1
<<
1
)
FOPEN_NONSEEKABLE
=
(
1
<<
2
)
FUSE_UNKNOWN_INO
=
0xffffffff
FUSE_UNKNOWN_INO
=
0xffffffff
CUSE_UNRESTRICTED_IOCTL
=
(
1
<<
0
)
CUSE_UNRESTRICTED_IOCTL
=
(
1
<<
0
)
FUSE_RELEASE_FLUSH
=
(
1
<<
0
)
FUSE_RELEASE_FLUSH
=
(
1
<<
0
)
// If set, GetAttrIn has a file handle set.
FUSE_GETATTR_FH
=
(
1
<<
0
)
FUSE_LK_FLOCK
=
(
1
<<
0
)
FUSE_LK_FLOCK
=
(
1
<<
0
)
FUSE_WRITE_CACHE
=
(
1
<<
0
)
FUSE_WRITE_LOCKOWNER
=
(
1
<<
1
)
FUSE_READ_LOCKOWNER
=
(
1
<<
1
)
FUSE_IOCTL_COMPAT
=
(
1
<<
0
)
FUSE_IOCTL_UNRESTRICTED
=
(
1
<<
1
)
FUSE_IOCTL_RETRY
=
(
1
<<
2
)
FUSE_IOCTL_MAX_IOV
=
256
FUSE_IOCTL_MAX_IOV
=
256
FUSE_POLL_SCHEDULE_NOTIFY
=
(
1
<<
0
)
FUSE_POLL_SCHEDULE_NOTIFY
=
(
1
<<
0
)
FUSE_MIN_READ_BUFFER
=
8192
CUSE_INIT_INFO_MAX
=
4096
CUSE_INIT_INFO_MAX
=
4096
S_IFDIR
=
syscall
.
S_IFDIR
S_IFDIR
=
syscall
.
S_IFDIR
...
@@ -149,6 +126,11 @@ type ForgetIn struct {
...
@@ -149,6 +126,11 @@ type ForgetIn struct {
Nlookup
uint64
Nlookup
uint64
}
}
const
(
// Mask for GetAttrIn.Flags. If set, GetAttrIn has a file handle set.
FUSE_GETATTR_FH
=
(
1
<<
0
)
)
type
GetAttrIn
struct
{
type
GetAttrIn
struct
{
Flags
uint32
Flags
uint32
Dummy
uint32
Dummy
uint32
...
@@ -214,6 +196,13 @@ type SetAttrIn struct {
...
@@ -214,6 +196,13 @@ type SetAttrIn struct {
Unused5
uint32
Unused5
uint32
}
}
const
(
// OpenIn.Flags
FOPEN_DIRECT_IO
=
(
1
<<
0
)
FOPEN_KEEP_CACHE
=
(
1
<<
1
)
FOPEN_NONSEEKABLE
=
(
1
<<
2
)
)
type
OpenIn
struct
{
type
OpenIn
struct
{
Flags
uint32
Flags
uint32
Unused
uint32
Unused
uint32
...
@@ -251,6 +240,9 @@ type FlushIn struct {
...
@@ -251,6 +240,9 @@ type FlushIn struct {
LockOwner
uint64
LockOwner
uint64
}
}
const
(
FUSE_READ_LOCKOWNER
=
(
1
<<
1
)
)
type
ReadIn
struct
{
type
ReadIn
struct
{
Fh
uint64
Fh
uint64
Offset
uint64
Offset
uint64
...
@@ -261,6 +253,11 @@ type ReadIn struct {
...
@@ -261,6 +253,11 @@ type ReadIn struct {
Padding
uint32
Padding
uint32
}
}
const
(
FUSE_WRITE_CACHE
=
(
1
<<
0
)
FUSE_WRITE_LOCKOWNER
=
(
1
<<
1
)
)
type
WriteIn
struct
{
type
WriteIn
struct
{
Fh
uint64
Fh
uint64
Offset
uint64
Offset
uint64
...
@@ -277,7 +274,7 @@ type WriteOut struct {
...
@@ -277,7 +274,7 @@ type WriteOut struct {
}
}
type
StatfsOut
struct
{
type
StatfsOut
struct
{
St
Kstatfs
Kstatfs
}
}
type
FsyncIn
struct
{
type
FsyncIn
struct
{
...
@@ -382,6 +379,11 @@ type BmapOut struct {
...
@@ -382,6 +379,11 @@ type BmapOut struct {
Block
uint64
Block
uint64
}
}
const
(
FUSE_IOCTL_COMPAT
=
(
1
<<
0
)
FUSE_IOCTL_UNRESTRICTED
=
(
1
<<
1
)
FUSE_IOCTL_RETRY
=
(
1
<<
2
)
)
type
IoctlIn
struct
{
type
IoctlIn
struct
{
Fh
uint64
Fh
uint64
Flags
uint32
Flags
uint32
...
...
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