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
4c9a5b84
Commit
4c9a5b84
authored
Sep 21, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reinstate erroneously removed FileSystemConnector.Flush().
Add a test that catches this.
parent
1b73d273
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
fuse/fsops.go
fuse/fsops.go
+7
-0
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+18
-0
No files found.
fuse/fsops.go
View file @
4c9a5b84
...
@@ -331,3 +331,10 @@ func (me *FileSystemConnector) Read(header *InHeader, input *ReadIn, bp BufferPo
...
@@ -331,3 +331,10 @@ func (me *FileSystemConnector) Read(header *InHeader, input *ReadIn, bp BufferPo
func
(
me
*
FileSystemConnector
)
StatFs
()
*
StatfsOut
{
func
(
me
*
FileSystemConnector
)
StatFs
()
*
StatfsOut
{
return
me
.
rootNode
.
mountPoint
.
fs
.
StatFs
()
return
me
.
rootNode
.
mountPoint
.
fs
.
StatFs
()
}
}
func
(
me
*
FileSystemConnector
)
Flush
(
header
*
InHeader
,
input
*
FlushIn
)
Status
{
node
:=
me
.
toInode
(
header
.
NodeId
)
opened
:=
node
.
mount
.
getOpenedFile
(
input
.
Fh
)
return
opened
.
WithFlags
.
File
.
Flush
()
}
unionfs/unionfs_test.go
View file @
4c9a5b84
...
@@ -1051,3 +1051,21 @@ func TestFlushRename(t *testing.T) {
...
@@ -1051,3 +1051,21 @@ func TestFlushRename(t *testing.T) {
t
.
Errorf
(
"got %d from Stat().Size, want %d"
,
fi
.
Size
,
n
)
t
.
Errorf
(
"got %d from Stat().Size, want %d"
,
fi
.
Size
,
n
)
}
}
}
}
func
TestTruncGetAttr
(
t
*
testing
.
T
)
{
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
c
:=
[]
byte
(
"hello"
)
f
,
err
:=
os
.
OpenFile
(
wd
+
"/mount/file"
,
os
.
O_CREATE
|
os
.
O_RDWR
|
os
.
O_TRUNC
,
0644
)
CheckSuccess
(
err
)
_
,
err
=
f
.
Write
(
c
)
CheckSuccess
(
err
)
err
=
f
.
Close
()
CheckSuccess
(
err
)
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
))
}
}
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