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
83798dc7
Commit
83798dc7
authored
Sep 05, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
50a64bf6
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
114 additions
and
119 deletions
+114
-119
fuse/api.go
fuse/api.go
+19
-19
fuse/cache_test.go
fuse/cache_test.go
+1
-0
fuse/default.go
fuse/default.go
+1
-0
fuse/defaultfile.go
fuse/defaultfile.go
+1
-0
fuse/defaultnode.go
fuse/defaultnode.go
+10
-12
fuse/direntry.go
fuse/direntry.go
+3
-3
fuse/fsconnector.go
fuse/fsconnector.go
+4
-4
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+3
-3
fuse/fsmount.go
fuse/fsmount.go
+5
-4
fuse/fsops.go
fuse/fsops.go
+8
-10
fuse/inode.go
fuse/inode.go
+12
-12
fuse/loopback_test.go
fuse/loopback_test.go
+20
-20
fuse/pathfs.go
fuse/pathfs.go
+17
-20
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+2
-3
zipfs/memtree.go
zipfs/memtree.go
+5
-6
zipfs/tarfs.go
zipfs/tarfs.go
+3
-3
No files found.
fuse/api.go
View file @
83798dc7
fuse/cache_test.go
View file @
83798dc7
...
...
@@ -7,6 +7,7 @@ import (
"os"
"testing"
)
var
_
=
log
.
Println
type
cacheFs
struct
{
...
...
fuse/default.go
View file @
83798dc7
package
fuse
import
(
"os"
)
...
...
fuse/defaultfile.go
View file @
83798dc7
package
fuse
import
(
"os"
)
...
...
fuse/defaultnode.go
View file @
83798dc7
package
fuse
import
(
"os"
)
...
...
@@ -44,7 +45,6 @@ func (me *DefaultFsNode) RmChild(name string, child FsNode) {
func
(
me
*
DefaultFsNode
)
AddChild
(
name
string
,
child
FsNode
)
{
}
func
(
me
*
DefaultFsNode
)
Lookup
(
name
string
)
(
fi
*
os
.
FileInfo
,
node
FsNode
,
code
Status
)
{
return
nil
,
nil
,
ENOSYS
}
...
...
@@ -113,7 +113,6 @@ func (me *DefaultFsNode) ListXAttr(context *Context) (attrs []string, code Statu
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
GetAttr
(
file
File
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
code
Status
)
{
return
nil
,
ENOSYS
}
...
...
@@ -133,4 +132,3 @@ func (me *DefaultFsNode) Truncate(file File, size uint64, context *Context) (cod
func
(
me
*
DefaultFsNode
)
Utimens
(
file
File
,
atime
uint64
,
mtime
uint64
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
fuse/direntry.go
View file @
83798dc7
fuse/fsconnector.go
View file @
83798dc7
fuse/fsetattr_test.go
View file @
83798dc7
fuse/fsmount.go
View file @
83798dc7
...
...
@@ -6,6 +6,7 @@ import (
"sync"
"unsafe"
)
var
_
=
log
.
Println
// openedFile stores either an open dir or an open file.
...
...
fuse/fsops.go
View file @
83798dc7
...
...
@@ -11,7 +11,6 @@ import (
var
_
=
log
.
Println
func
(
me
*
FileSystemConnector
)
Init
(
fsInit
*
RawFsInit
)
{
me
.
fsInit
=
*
fsInit
}
...
...
@@ -238,7 +237,6 @@ func (me *FileSystemConnector) Symlink(header *InHeader, pointedTo string, linkN
return
out
,
code
}
func
(
me
*
FileSystemConnector
)
Rename
(
header
*
InHeader
,
input
*
RenameIn
,
oldName
string
,
newName
string
)
(
code
Status
)
{
oldParent
:=
me
.
getInodeData
(
header
.
NodeId
)
isMountPoint
:=
me
.
lookupMount
(
oldParent
,
oldName
,
0
)
!=
nil
...
...
fuse/inode.go
View file @
83798dc7
...
...
@@ -49,7 +49,7 @@ type Inode struct {
// LockTree() Locks the mutex used for tree operations, and returns the
// unlock function.
func
(
me
*
Inode
)
LockTree
()
(
func
()
)
{
func
(
me
*
Inode
)
LockTree
()
func
(
)
{
// TODO - this API is tricky.
me
.
treeLock
.
Lock
()
return
func
()
{
me
.
treeLock
.
Unlock
()
}
...
...
@@ -61,7 +61,7 @@ func (me *Inode) AnyFile() (file File) {
defer
me
.
openFilesMutex
.
Unlock
()
for
_
,
f
:=
range
me
.
openFiles
{
if
file
==
nil
||
f
.
OpenFlags
&
O_ANYWRITE
!=
0
{
if
file
==
nil
||
f
.
OpenFlags
&
O_ANYWRITE
!=
0
{
file
=
f
.
file
}
}
...
...
@@ -89,7 +89,7 @@ func (me *Inode) WritableFiles() (files []File) {
defer
me
.
openFilesMutex
.
Unlock
()
for
_
,
f
:=
range
me
.
openFiles
{
if
f
.
OpenFlags
&
O_ANYWRITE
!=
0
{
if
f
.
OpenFlags
&
O_ANYWRITE
!=
0
{
files
=
append
(
files
,
f
.
file
)
}
}
...
...
fuse/loopback_test.go
View file @
83798dc7
...
...
@@ -685,14 +685,14 @@ func TestDoubleOpen(t *testing.T) {
ts
:=
NewTestCase
(
t
)
defer
ts
.
Cleanup
()
err
:=
ioutil
.
WriteFile
(
ts
.
orig
+
"/file"
,
[]
byte
(
"blabla"
),
0644
)
err
:=
ioutil
.
WriteFile
(
ts
.
orig
+
"/file"
,
[]
byte
(
"blabla"
),
0644
)
CheckSuccess
(
err
)
roFile
,
err
:=
os
.
Open
(
ts
.
mnt
+
"/file"
)
CheckSuccess
(
err
)
defer
roFile
.
Close
()
rwFile
,
err
:=
os
.
OpenFile
(
ts
.
mnt
+
"/file"
,
os
.
O_WRONLY
|
os
.
O_TRUNC
,
0666
)
rwFile
,
err
:=
os
.
OpenFile
(
ts
.
mnt
+
"/file"
,
os
.
O_WRONLY
|
os
.
O_TRUNC
,
0666
)
CheckSuccess
(
err
)
defer
rwFile
.
Close
()
}
fuse/pathfs.go
View file @
83798dc7
...
...
@@ -40,7 +40,6 @@ func (me *PathNodeFs) Root() FsNode {
return
me
.
root
}
// This is a combination of dentry (entry in the file/directory and
// the inode). This structure is used to implement glue for FSes where
// there is a one-to-one mapping of paths and inodes, ie. FSes that
...
...
@@ -179,7 +178,6 @@ func (me *pathInode) Symlink(name string, content string, context *Context) (fi
return
}
func
(
me
*
pathInode
)
Rename
(
oldName
string
,
newParent
FsNode
,
newName
string
,
context
*
Context
)
(
code
Status
)
{
p
:=
newParent
.
(
*
pathInode
)
oldPath
:=
filepath
.
Join
(
me
.
GetPath
(),
oldName
)
...
...
@@ -278,7 +276,6 @@ func (me *pathInode) Chmod(file File, perms uint32, context *Context) (code Stat
return
code
}
func
(
me
*
pathInode
)
Chown
(
file
File
,
uid
uint32
,
gid
uint32
,
context
*
Context
)
(
code
Status
)
{
files
:=
me
.
inode
.
WritableFiles
()
for
_
,
f
:=
range
files
{
...
...
unionfs/unionfs_test.go
View file @
83798dc7
...
...
@@ -893,7 +893,7 @@ func TestDoubleOpen(t *testing.T) {
roFile
,
err
:=
os
.
Open
(
wd
+
"/mount/file"
)
CheckSuccess
(
err
)
defer
roFile
.
Close
()
rwFile
,
err
:=
os
.
OpenFile
(
wd
+
"/mount/file"
,
os
.
O_WRONLY
|
os
.
O_TRUNC
,
0666
)
rwFile
,
err
:=
os
.
OpenFile
(
wd
+
"/mount/file"
,
os
.
O_WRONLY
|
os
.
O_TRUNC
,
0666
)
CheckSuccess
(
err
)
defer
rwFile
.
Close
()
...
...
@@ -921,4 +921,3 @@ func TestDoubleOpen(t *testing.T) {
}
}
}
zipfs/memtree.go
View file @
83798dc7
...
...
@@ -17,7 +17,6 @@ type memNode struct {
file
MemFile
}
// MemTreeFs creates a tree of internal Inodes. Since the tree is
// loaded in memory completely at startup, it does not need to inode
// discovery through Lookup() at serve time.
...
...
@@ -55,7 +54,7 @@ func (me *memNode) Print(indent int) {
fmt
.
Println
(
s
+
k
+
":"
)
mn
,
ok
:=
v
.
FsNode
()
.
(
*
memNode
)
if
ok
{
mn
.
Print
(
indent
+
2
)
mn
.
Print
(
indent
+
2
)
}
}
else
{
fmt
.
Println
(
s
+
k
)
...
...
zipfs/tarfs.go
View file @
83798dc7
...
...
@@ -44,7 +44,7 @@ func (me *TarFile) Data() []byte {
return
me
.
data
}
func
NewTarTree
(
r
io
.
Reader
)
(
map
[
string
]
MemFile
)
{
func
NewTarTree
(
r
io
.
Reader
)
map
[
string
]
MemFile
{
files
:=
map
[
string
]
MemFile
{}
tr
:=
tar
.
NewReader
(
r
)
...
...
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