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
9dac968e
Commit
9dac968e
authored
Apr 30, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup debug printing, and expose InitIn in MountState.
parent
9c6ab192
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
fuse/fuse.go
fuse/fuse.go
+12
-10
fuse/opcode.go
fuse/opcode.go
+5
-2
No files found.
fuse/fuse.go
View file @
9dac968e
...
...
@@ -58,21 +58,17 @@ func (me *request) filenames(count int) []string {
}
func
(
me
*
request
)
InputDebug
(
h
*
operationHandler
)
string
{
va
r
val
interface
{}
va
l
:=
" "
if
h
.
DecodeIn
!=
nil
{
val
=
h
.
DecodeIn
(
me
.
inData
)
}
else
{
val
=
""
val
=
fmt
.
Sprintf
(
" data: %v "
,
h
.
DecodeIn
(
me
.
inData
))
}
var
names
interface
{}
names
:=
""
if
h
.
FileNames
>
0
{
names
=
me
.
filenames
(
h
.
FileNames
)
}
else
{
names
=
""
}
names
=
fmt
.
Sprintf
(
"names: %v"
,
me
.
filenames
(
h
.
FileNames
))
}
return
fmt
.
Sprintf
(
"Dispatch: %v, NodeId: %v.
Data: %v Names:
%v"
,
return
fmt
.
Sprintf
(
"Dispatch: %v, NodeId: %v.
%v
%v"
,
me
.
inHeader
.
opcode
,
me
.
inHeader
.
NodeId
,
val
,
names
)
}
...
...
@@ -118,6 +114,12 @@ type MountState struct {
buffers
*
BufferPool
*
LatencyMap
kernelSettings
InitIn
}
func
(
me
*
MountState
)
KernelSettings
()
InitIn
{
return
me
.
kernelSettings
}
// Mount filesystem on mountPoint.
...
...
fuse/opcode.go
View file @
9dac968e
...
...
@@ -71,11 +71,13 @@ func doInit(state *MountState, req *request) {
return
}
state
.
kernelSettings
=
*
input
state
.
kernelSettings
.
Flags
=
input
.
Flags
&
(
CAP_ASYNC_READ
|
CAP_BIG_WRITES
)
out
:=
&
InitOut
{
Major
:
FUSE_KERNEL_VERSION
,
Minor
:
FUSE_KERNEL_MINOR_VERSION
,
MaxReadAhead
:
input
.
MaxReadAhead
,
Flags
:
CAP_ASYNC_READ
|
CAP_POSIX_LOCKS
|
CAP_BIG_WRITES
,
Flags
:
state
.
kernelSettings
.
Flags
,
MaxWrite
:
maxRead
,
CongestionThreshold
:
_BACKGROUND_TASKS
*
3
/
4
,
MaxBackground
:
_BACKGROUND_TASKS
,
...
...
@@ -136,7 +138,6 @@ func doOpenDir(state *MountState, req *request) {
}
func
doSetattr
(
state
*
MountState
,
req
*
request
)
{
// TODO - if Fh != 0, we should do a FSetAttr instead.
o
,
s
:=
state
.
fileSystem
.
SetAttr
(
req
.
inHeader
,
(
*
SetAttrIn
)(
req
.
inData
))
req
.
outData
=
unsafe
.
Pointer
(
o
)
req
.
status
=
s
...
...
@@ -461,12 +462,14 @@ func init() {
_OP_LOOKUP
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
EntryOut
)(
ptr
)
},
_OP_OPEN
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
EntryOut
)(
ptr
)
},
_OP_GETATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
AttrOut
)(
ptr
)
},
_OP_CREATE
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
CreateOut
)(
ptr
)
},
}
{
operationHandlers
[
op
]
.
DecodeOut
=
f
}
for
op
,
f
:=
range
map
[
opcode
]
castPointerFunc
{
_OP_GETATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
GetAttrIn
)(
ptr
)
},
_OP_SETATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
SetAttrIn
)(
ptr
)
},
_OP_INIT
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
InitIn
)(
ptr
)
},
}
{
operationHandlers
[
op
]
.
DecodeIn
=
f
}
...
...
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