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
f7febb40
Commit
f7febb40
authored
Apr 21, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run Gofmt.
parent
20262305
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
22 deletions
+21
-22
fuse/direntry.go
fuse/direntry.go
+3
-3
fuse/fuse.go
fuse/fuse.go
+1
-2
fuse/loopback_test.go
fuse/loopback_test.go
+1
-1
fuse/misc.go
fuse/misc.go
+1
-1
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+13
-13
fuse/timingrawfs.go
fuse/timingrawfs.go
+1
-1
fuse/types.go
fuse/types.go
+1
-1
No files found.
fuse/direntry.go
View file @
f7febb40
...
...
@@ -66,8 +66,8 @@ func (me *DirEntryList) Bytes() []byte {
////////////////////////////////////////////////////////////////
type
FuseDir
struct
{
stream
chan
DirEntry
leftOver
DirEntry
stream
chan
DirEntry
leftOver
DirEntry
DefaultRawFuseDir
}
...
...
@@ -116,7 +116,7 @@ func (me *FuseDir) ReadDir(input *ReadIn) (*DirEntryList, Status) {
// Read everything so we make goroutines exit.
func
(
me
*
FuseDir
)
Release
()
{
for
ok
:=
true
;
ok
&&
me
.
stream
!=
nil
;
{
_
,
ok
=
<-
me
.
stream
_
,
ok
=
<-
me
.
stream
if
!
ok
{
break
}
...
...
fuse/fuse.go
View file @
f7febb40
...
...
@@ -529,7 +529,7 @@ func doOpen(state *MountState, header *InHeader, input *OpenIn) (unsafe.Pointer,
if
status
!=
OK
{
return
nil
,
status
}
out
:=
new
(
OpenOut
)
out
.
Fh
=
handle
out
.
OpenFlags
=
flags
...
...
@@ -609,4 +609,3 @@ func doReadDir(state *MountState, header *InHeader, input *ReadIn) (out []byte,
}
return
entries
.
Bytes
(),
code
}
fuse/loopback_test.go
View file @
f7febb40
...
...
@@ -64,7 +64,7 @@ func (me *testCase) Setup(t *testing.T) {
rfs
=
me
.
connector
rfs
=
NewTimingRawFilesystem
(
rfs
)
rfs
=
NewLockingRawFilesystem
(
rfs
)
me
.
connector
.
Debug
=
true
me
.
state
=
NewMountState
(
rfs
)
me
.
state
.
Mount
(
me
.
mountPoint
)
...
...
fuse/misc.go
View file @
f7febb40
...
...
@@ -44,7 +44,7 @@ func OsErrorToFuseError(err os.Error) Status {
}
func
replyString
(
opcode
uint32
,
ptr
unsafe
.
Pointer
)
string
{
var
val
interface
{}
var
val
interface
{}
switch
opcode
{
case
FUSE_LOOKUP
:
val
=
(
*
EntryOut
)(
ptr
)
...
...
fuse/pathfilesystem.go
View file @
f7febb40
...
...
@@ -36,7 +36,7 @@ type inode struct {
Name
string
LookupCount
int
OpenCount
int
Type
uint32
// dirent type, used to check if mounts are valid.
Type
uint32
// dirent type, used to check if mounts are valid.
mount
*
mountData
}
...
...
@@ -143,7 +143,7 @@ type PathFileSystemConnector struct {
Debug
bool
////////////////
// Protects the inode hashmap, its contents and the nextFreeInode counter.
lock
sync
.
RWMutex
...
...
@@ -152,8 +152,8 @@ type PathFileSystemConnector struct {
nextFreeInode
uint64
// Open files/directories.
fileLock
sync
.
RWMutex
openFiles
map
[
uint64
]
interface
{}
fileLock
sync
.
RWMutex
openFiles
map
[
uint64
]
interface
{}
nextFreeHandle
uint64
}
...
...
@@ -179,7 +179,7 @@ func (me *PathFileSystemConnector) registerFile(node *inode, f interface{}) uint
if
ok
{
panic
(
"handle counter wrapped"
)
}
node
.
OpenCount
++
me
.
openFiles
[
h
]
=
f
return
h
...
...
@@ -190,7 +190,7 @@ func (me *PathFileSystemConnector) getDir(h uint64) RawFuseDir {
defer
me
.
fileLock
.
RUnlock
()
return
me
.
openFiles
[
h
]
.
(
RawFuseDir
)
}
func
(
me
*
PathFileSystemConnector
)
getFile
(
h
uint64
)
FuseFile
{
me
.
fileLock
.
RLock
()
defer
me
.
fileLock
.
RUnlock
()
...
...
@@ -215,7 +215,7 @@ func (me *PathFileSystemConnector) newInode() *inode {
me
.
nextFreeInode
++
me
.
inodeMap
[
data
.
NodeId
]
=
data
return
data
}
...
...
@@ -325,7 +325,7 @@ func NewPathFileSystemConnector(fs PathFilesystem) (out *PathFileSystemConnector
out
=
new
(
PathFileSystemConnector
)
out
.
inodeMap
=
make
(
map
[
uint64
]
*
inode
)
out
.
openFiles
=
make
(
map
[
uint64
]
interface
{})
out
.
nextFreeInode
=
FUSE_ROOT_ID
rootData
:=
out
.
newInode
()
rootData
.
NodeId
=
FUSE_ROOT_ID
...
...
@@ -374,7 +374,7 @@ func (me *PathFileSystemConnector) Mount(mountPoint string, fs PathFilesystem) S
if
hasChildren
{
return
EBUSY
}
code
:=
fs
.
Mount
(
me
)
if
code
!=
OK
{
if
me
.
Debug
{
...
...
@@ -538,7 +538,7 @@ func (me *PathFileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (fla
de
.
stream
=
stream
h
:=
me
.
registerFile
(
node
,
de
)
return
0
,
h
,
OK
}
...
...
@@ -556,14 +556,14 @@ func (me *PathFileSystemConnector) Open(header *InHeader, input *OpenIn) (flags
if
mount
==
nil
{
return
0
,
0
,
ENOENT
}
// TODO - how to handle return flags, the FUSE open flags?
f
,
err
:=
mount
.
fs
.
Open
(
fullPath
,
input
.
Flags
)
if
err
!=
OK
{
return
0
,
0
,
err
}
h
:=
me
.
registerFile
(
node
,
f
)
return
0
,
h
,
OK
}
...
...
@@ -741,7 +741,7 @@ func (me *PathFileSystemConnector) Create(header *InHeader, input *CreateIn, nam
if
err
!=
OK
{
return
0
,
0
,
nil
,
err
}
out
,
code
,
inode
:=
me
.
internalLookupWithNode
(
parent
,
name
,
1
)
return
0
,
me
.
registerFile
(
inode
,
f
),
out
,
code
}
...
...
fuse/timingrawfs.go
View file @
f7febb40
...
...
@@ -207,6 +207,6 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, input *ReleaseIn) {
}
func
(
me
*
TimingRawFilesystem
)
FsyncDir
(
header
*
InHeader
,
input
*
FsyncIn
)
(
code
Status
)
{
defer
me
.
startTimer
(
"FsyncDir"
)()
defer
me
.
startTimer
(
"FsyncDir"
)()
return
me
.
Original
.
FsyncDir
(
header
,
input
)
}
fuse/types.go
View file @
f7febb40
...
...
@@ -541,7 +541,7 @@ type RawFileSystem interface {
OpenDir
(
header
*
InHeader
,
input
*
OpenIn
)
(
flags
uint32
,
handle
uint64
,
status
Status
)
ReadDir
(
header
*
InHeader
,
input
*
ReadIn
)
(
*
DirEntryList
,
Status
)
ReleaseDir
(
header
*
InHeader
,
input
*
ReleaseIn
)
FsyncDir
(
header
*
InHeader
,
input
*
FsyncIn
)
(
code
Status
)
FsyncDir
(
header
*
InHeader
,
input
*
FsyncIn
)
(
code
Status
)
}
type
FuseFile
interface
{
...
...
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