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
Kirill Smelkov
go-fuse
Commits
9da364b3
Commit
9da364b3
authored
Sep 25, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
5ae334dd
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
53 deletions
+45
-53
fuse/api.go
fuse/api.go
+1
-1
fuse/defaultnode.go
fuse/defaultnode.go
+2
-1
fuse/fsops.go
fuse/fsops.go
+0
-1
fuse/loopback_test.go
fuse/loopback_test.go
+1
-1
fuse/memnode.go
fuse/memnode.go
+9
-14
fuse/memnode_test.go
fuse/memnode_test.go
+4
-5
fuse/pathfs.go
fuse/pathfs.go
+0
-1
unionfs/memunionfs.go
unionfs/memunionfs.go
+21
-21
unionfs/memunionfs_test.go
unionfs/memunionfs_test.go
+2
-2
unionfs/unionfs.go
unionfs/unionfs.go
+2
-2
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+3
-4
No files found.
fuse/api.go
View file @
9da364b3
fuse/defaultnode.go
View file @
9da364b3
...
...
@@ -8,6 +8,7 @@ import (
var
_
=
log
.
Println
type
DefaultNodeFileSystem
struct
{
}
func
(
me
*
DefaultNodeFileSystem
)
OnUnmount
()
{
...
...
fuse/fsops.go
View file @
9da364b3
...
...
@@ -337,4 +337,3 @@ func (me *FileSystemConnector) Flush(header *InHeader, input *FlushIn) Status {
opened
:=
node
.
mount
.
getOpenedFile
(
input
.
Fh
)
return
opened
.
WithFlags
.
File
.
Flush
()
}
fuse/loopback_test.go
View file @
9da364b3
fuse/memnode.go
View file @
9da364b3
...
...
@@ -88,7 +88,6 @@ func (me *memNode) Unlink(name string, context *Context) (code Status) {
return
OK
}
func
(
me
*
memNode
)
Rmdir
(
name
string
,
context
*
Context
)
(
code
Status
)
{
return
me
.
Unlink
(
name
,
context
)
}
...
...
@@ -160,7 +159,6 @@ func (me *memNode) Open(flags uint32, context *Context) (file File, code Status)
return
me
.
newFile
(
f
),
OK
}
func
(
me
*
memNode
)
GetAttr
(
file
File
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
code
Status
)
{
return
&
me
.
info
,
OK
}
...
...
@@ -195,6 +193,3 @@ func (me *memNode) Chown(file File, uid uint32, gid uint32, context *Context) (c
me
.
info
.
Ctime_ns
=
time
.
Nanoseconds
()
return
OK
}
fuse/memnode_test.go
View file @
9da364b3
...
...
@@ -44,7 +44,7 @@ func TestMemNodeFs(t *testing.T) {
wd
,
_
,
clean
:=
setupMemNodeTest
(
t
)
defer
clean
()
err
:=
ioutil
.
WriteFile
(
wd
+
"/test"
,
[]
byte
{
42
},
0644
)
err
:=
ioutil
.
WriteFile
(
wd
+
"/test"
,
[]
byte
{
42
},
0644
)
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/test"
)
...
...
@@ -58,4 +58,3 @@ func TestMemNodeFs(t *testing.T) {
t
.
Fatalf
(
"Readdir got %v, expected 1 file named 'test'"
,
entries
)
}
}
fuse/pathfs.go
View file @
9da364b3
...
...
@@ -91,7 +91,6 @@ func (me *PathNodeFs) Unmount(path string) Status {
return
me
.
connector
.
Unmount
(
node
)
}
func
(
me
*
PathNodeFs
)
OnUnmount
()
{
}
...
...
unionfs/memunionfs.go
View file @
9da364b3
...
...
@@ -123,10 +123,10 @@ func (me *memNode) Lookup(name string, context *fuse.Context) (fi *os.FileInfo,
return
nil
,
nil
,
code
}
child
:=
me
.
newNode
(
fi
.
Mode
&
fuse
.
S_IFDIR
!=
0
)
child
:=
me
.
newNode
(
fi
.
Mode
&
fuse
.
S_IFDIR
!=
0
)
child
.
info
=
*
fi
child
.
original
=
fn
if
child
.
info
.
Mode
&
fuse
.
S_IFLNK
!=
0
{
if
child
.
info
.
Mode
&
fuse
.
S_IFLNK
!=
0
{
child
.
link
,
_
=
me
.
fs
.
readonly
.
Readlink
(
fn
,
context
)
}
me
.
Inode
()
.
AddChild
(
name
,
child
.
Inode
())
...
...
@@ -270,7 +270,7 @@ func (me *memNode) promote() {
}
func
(
me
*
memNode
)
Open
(
flags
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
me
.
mutex
.
Lock
()
defer
me
.
mutex
.
Unlock
()
...
...
@@ -283,7 +283,7 @@ func (me *memNode) Open(flags uint32, context *fuse.Context) (file fuse.File, co
if
err
!=
nil
{
return
nil
,
fuse
.
OsErrorToErrno
(
err
)
}
wr
:=
flags
&
fuse
.
O_ANYWRITE
!=
0
wr
:=
flags
&
fuse
.
O_ANYWRITE
!=
0
return
me
.
newFile
(
&
fuse
.
LoopbackFile
{
File
:
f
},
wr
),
fuse
.
OK
}
...
...
unionfs/memunionfs_test.go
View file @
9da364b3
...
...
@@ -545,7 +545,7 @@ func TestMemUnionFsTruncGetAttr(t *testing.T) {
err
=
f
.
Close
()
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/file"
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/file"
)
if
fi
.
Size
!=
int64
(
len
(
c
))
{
t
.
Fatalf
(
"Length mismatch got %d want %d"
,
fi
.
Size
,
len
(
c
))
}
...
...
unionfs/unionfs.go
View file @
9da364b3
...
...
@@ -622,7 +622,7 @@ func (me *UnionFs) promoteDirsTo(filename string) fuse.Status {
j
:=
len
(
todo
)
-
i
-
1
d
:=
todo
[
j
]
r
:=
results
[
j
]
code
:=
me
.
fileSystems
[
0
]
.
Mkdir
(
d
,
r
.
attr
.
Mode
&
07777
,
nil
)
code
:=
me
.
fileSystems
[
0
]
.
Mkdir
(
d
,
r
.
attr
.
Mode
&
07777
,
nil
)
if
code
!=
fuse
.
OK
{
log
.
Println
(
"Error creating dir leading to path"
,
d
,
code
)
return
fuse
.
EPERM
...
...
unionfs/unionfs_test.go
View file @
9da364b3
...
...
@@ -1061,13 +1061,12 @@ func TestTruncGetAttr(t *testing.T) {
err
=
f
.
Close
()
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/file"
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/file"
)
if
fi
.
Size
!=
int64
(
len
(
c
))
{
t
.
Fatalf
(
"Length mismatch got %d want %d"
,
fi
.
Size
,
len
(
c
))
}
}
func
TestPromoteDirTimeStamp
(
t
*
testing
.
T
)
{
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
...
...
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