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
9f36c953
Commit
9f36c953
authored
Apr 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop Init from raw interface. Move doInit to opcode.go.
parent
b094739d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
54 deletions
+29
-54
fuse/default.go
fuse/default.go
+0
-4
fuse/fuse.go
fuse/fuse.go
+1
-26
fuse/lockingfs.go
fuse/lockingfs.go
+0
-6
fuse/opcode.go
fuse/opcode.go
+28
-3
fuse/pathops.go
fuse/pathops.go
+0
-5
fuse/timingrawfs.go
fuse/timingrawfs.go
+0
-5
fuse/types.go
fuse/types.go
+0
-1
fuse/wrappedfs.go
fuse/wrappedfs.go
+0
-4
No files found.
fuse/default.go
View file @
9f36c953
...
@@ -6,10 +6,6 @@ import (
...
@@ -6,10 +6,6 @@ import (
var
_
=
log
.
Println
var
_
=
log
.
Println
func
(
me
*
DefaultRawFileSystem
)
Init
(
h
*
InHeader
,
input
*
InitIn
)
(
*
InitOut
,
Status
)
{
return
new
(
InitOut
),
OK
}
func
(
me
*
DefaultRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
func
(
me
*
DefaultRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
}
}
...
...
fuse/fuse.go
View file @
9f36c953
...
@@ -233,7 +233,7 @@ func (me *MountState) chopMessage(req *request) *operationHandler {
...
@@ -233,7 +233,7 @@ func (me *MountState) chopMessage(req *request) *operationHandler {
handler
:=
getHandler
(
req
.
inHeader
.
Opcode
)
handler
:=
getHandler
(
req
.
inHeader
.
Opcode
)
if
handler
==
nil
||
handler
.
Func
==
nil
{
if
handler
==
nil
||
handler
.
Func
==
nil
{
log
.
Printf
(
"Unknown opcode %
d (input)
"
,
req
.
inHeader
.
Opcode
)
log
.
Printf
(
"Unknown opcode %
v
"
,
req
.
inHeader
.
Opcode
)
req
.
status
=
ENOSYS
req
.
status
=
ENOSYS
return
handler
return
handler
}
}
...
@@ -322,28 +322,3 @@ func serialize(req *request, handler *operationHandler, debug bool) {
...
@@ -322,28 +322,3 @@ func serialize(req *request, handler *operationHandler, debug bool) {
operationName
(
req
.
inHeader
.
Opcode
),
req
.
status
,
val
,
msg
)
operationName
(
req
.
inHeader
.
Opcode
),
req
.
status
,
val
,
msg
)
}
}
}
}
func
(
me
*
MountState
)
init
(
h
*
InHeader
,
input
*
InitIn
)
(
unsafe
.
Pointer
,
Status
)
{
out
,
initStatus
:=
me
.
fileSystem
.
Init
(
h
,
input
)
if
initStatus
!=
OK
{
return
nil
,
initStatus
}
if
input
.
Major
!=
FUSE_KERNEL_VERSION
{
fmt
.
Printf
(
"Major versions does not match. Given %d, want %d
\n
"
,
input
.
Major
,
FUSE_KERNEL_VERSION
)
return
nil
,
EIO
}
if
input
.
Minor
<
FUSE_KERNEL_MINOR_VERSION
{
fmt
.
Printf
(
"Minor version is less than we support. Given %d, want at least %d
\n
"
,
input
.
Minor
,
FUSE_KERNEL_MINOR_VERSION
)
return
nil
,
EIO
}
out
.
Major
=
FUSE_KERNEL_VERSION
out
.
Minor
=
FUSE_KERNEL_MINOR_VERSION
out
.
MaxReadAhead
=
input
.
MaxReadAhead
out
.
Flags
=
FUSE_ASYNC_READ
|
FUSE_POSIX_LOCKS
|
FUSE_BIG_WRITES
out
.
MaxWrite
=
maxRead
return
unsafe
.
Pointer
(
out
),
OK
}
fuse/lockingfs.go
View file @
9f36c953
...
@@ -170,12 +170,6 @@ func NewLockingRawFileSystem(rfs RawFileSystem) *LockingRawFileSystem {
...
@@ -170,12 +170,6 @@ func NewLockingRawFileSystem(rfs RawFileSystem) *LockingRawFileSystem {
return
l
return
l
}
}
func
(
me
*
LockingRawFileSystem
)
Init
(
h
*
InHeader
,
input
*
InitIn
)
(
*
InitOut
,
Status
)
{
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
return
me
.
Original
.
Init
(
h
,
input
)
}
func
(
me
*
LockingRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
func
(
me
*
LockingRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
me
.
lock
.
Lock
()
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
defer
me
.
lock
.
Unlock
()
...
...
fuse/opcode.go
View file @
9f36c953
...
@@ -20,6 +20,33 @@ func replyString(opcode Opcode, ptr unsafe.Pointer) string {
...
@@ -20,6 +20,33 @@ func replyString(opcode Opcode, ptr unsafe.Pointer) string {
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
func
doInit
(
state
*
MountState
,
req
*
request
)
{
input
:=
(
*
InitIn
)(
req
.
inData
)
if
input
.
Major
!=
FUSE_KERNEL_VERSION
{
fmt
.
Printf
(
"Major versions does not match. Given %d, want %d
\n
"
,
input
.
Major
,
FUSE_KERNEL_VERSION
)
req
.
status
=
EIO
return
}
if
input
.
Minor
<
FUSE_KERNEL_MINOR_VERSION
{
fmt
.
Printf
(
"Minor version is less than we support. Given %d, want at least %d
\n
"
,
input
.
Minor
,
FUSE_KERNEL_MINOR_VERSION
)
req
.
status
=
EIO
return
}
out
:=
&
InitOut
{
Major
:
FUSE_KERNEL_VERSION
,
Minor
:
FUSE_KERNEL_MINOR_VERSION
,
MaxReadAhead
:
input
.
MaxReadAhead
,
Flags
:
FUSE_ASYNC_READ
|
FUSE_POSIX_LOCKS
|
FUSE_BIG_WRITES
,
MaxWrite
:
maxRead
,
}
req
.
outData
=
unsafe
.
Pointer
(
out
)
req
.
status
=
OK
}
func
doOpen
(
state
*
MountState
,
req
*
request
)
{
func
doOpen
(
state
*
MountState
,
req
*
request
)
{
flags
,
handle
,
status
:=
state
.
fileSystem
.
Open
(
req
.
inHeader
,
(
*
OpenIn
)(
req
.
inData
))
flags
,
handle
,
status
:=
state
.
fileSystem
.
Open
(
req
.
inHeader
,
(
*
OpenIn
)(
req
.
inData
))
req
.
status
=
status
req
.
status
=
status
...
@@ -129,9 +156,7 @@ func doForget(state *MountState, req *request) {
...
@@ -129,9 +156,7 @@ func doForget(state *MountState, req *request) {
func
doReadlink
(
state
*
MountState
,
req
*
request
)
{
func
doReadlink
(
state
*
MountState
,
req
*
request
)
{
req
.
flatData
,
req
.
status
=
state
.
fileSystem
.
Readlink
(
req
.
inHeader
)
req
.
flatData
,
req
.
status
=
state
.
fileSystem
.
Readlink
(
req
.
inHeader
)
}
}
func
doInit
(
state
*
MountState
,
req
*
request
)
{
req
.
outData
,
req
.
status
=
state
.
init
(
req
.
inHeader
,
(
*
InitIn
)(
req
.
inData
))
}
func
doDestroy
(
state
*
MountState
,
req
*
request
)
{
func
doDestroy
(
state
*
MountState
,
req
*
request
)
{
state
.
fileSystem
.
Destroy
(
req
.
inHeader
,
(
*
InitIn
)(
req
.
inData
))
state
.
fileSystem
.
Destroy
(
req
.
inHeader
,
(
*
InitIn
)(
req
.
inData
))
}
}
...
...
fuse/pathops.go
View file @
9f36c953
...
@@ -23,11 +23,6 @@ func (me *FileSystemConnector) SetOptions(opts FileSystemConnectorOptions) {
...
@@ -23,11 +23,6 @@ func (me *FileSystemConnector) SetOptions(opts FileSystemConnectorOptions) {
me
.
options
=
opts
me
.
options
=
opts
}
}
func
(
me
*
FileSystemConnector
)
Init
(
h
*
InHeader
,
input
*
InitIn
)
(
*
InitOut
,
Status
)
{
// TODO ?
return
&
InitOut
{},
OK
}
func
(
me
*
FileSystemConnector
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
func
(
me
*
FileSystemConnector
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
// TODO - umount all.
// TODO - umount all.
}
}
...
...
fuse/timingrawfs.go
View file @
9f36c953
...
@@ -31,11 +31,6 @@ func (me *TimingRawFileSystem) Latencies() map[string]float64 {
...
@@ -31,11 +31,6 @@ func (me *TimingRawFileSystem) Latencies() map[string]float64 {
return
me
.
LatencyMap
.
Latencies
(
1e-3
)
return
me
.
LatencyMap
.
Latencies
(
1e-3
)
}
}
func
(
me
*
TimingRawFileSystem
)
Init
(
h
*
InHeader
,
input
*
InitIn
)
(
*
InitOut
,
Status
)
{
defer
me
.
startTimer
(
"Init"
)()
return
me
.
Original
.
Init
(
h
,
input
)
}
func
(
me
*
TimingRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
func
(
me
*
TimingRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
defer
me
.
startTimer
(
"Destroy"
)()
defer
me
.
startTimer
(
"Destroy"
)()
me
.
Original
.
Destroy
(
h
,
input
)
me
.
Original
.
Destroy
(
h
,
input
)
...
...
fuse/types.go
View file @
9f36c953
...
@@ -504,7 +504,6 @@ type NotifyInvalEntryOut struct {
...
@@ -504,7 +504,6 @@ type NotifyInvalEntryOut struct {
// the details of getting interactions with open files, renames, and
// the details of getting interactions with open files, renames, and
// threading right etc. are somewhat tricky and not very interesting.
// threading right etc. are somewhat tricky and not very interesting.
type
RawFileSystem
interface
{
type
RawFileSystem
interface
{
Init
(
h
*
InHeader
,
input
*
InitIn
)
(
out
*
InitOut
,
code
Status
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
Lookup
(
header
*
InHeader
,
name
string
)
(
out
*
EntryOut
,
status
Status
)
Lookup
(
header
*
InHeader
,
name
string
)
(
out
*
EntryOut
,
status
Status
)
...
...
fuse/wrappedfs.go
View file @
9f36c953
...
@@ -105,10 +105,6 @@ type WrappingRawFileSystem struct {
...
@@ -105,10 +105,6 @@ type WrappingRawFileSystem struct {
Original
RawFileSystem
Original
RawFileSystem
}
}
func
(
me
*
WrappingRawFileSystem
)
Init
(
h
*
InHeader
,
input
*
InitIn
)
(
*
InitOut
,
Status
)
{
return
me
.
Original
.
Init
(
h
,
input
)
}
func
(
me
*
WrappingRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
func
(
me
*
WrappingRawFileSystem
)
Destroy
(
h
*
InHeader
,
input
*
InitIn
)
{
me
.
Original
.
Destroy
(
h
,
input
)
me
.
Original
.
Destroy
(
h
,
input
)
}
}
...
...
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