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
3c135f28
Commit
3c135f28
authored
May 07, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update branch cache for Truncate() too.
This fixes spurious changes in timestamps.
parent
ce47527f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
unionfs/unionfs.go
unionfs/unionfs.go
+11
-6
No files found.
unionfs/unionfs.go
View file @
3c135f28
...
...
@@ -337,13 +337,18 @@ func (me *UnionFs) Symlink(pointedTo string, linkName string) (code fuse.Status)
func
(
me
*
UnionFs
)
Truncate
(
path
string
,
offset
uint64
)
(
code
fuse
.
Status
)
{
r
:=
me
.
getBranch
(
path
)
if
r
.
branch
>
0
{
code
:=
me
.
Promote
(
path
,
r
)
if
code
!=
fuse
.
OK
{
return
code
}
code
=
me
.
Promote
(
path
,
r
)
r
.
branch
=
0
}
return
me
.
fileSystems
[
0
]
.
Truncate
(
path
,
offset
)
if
code
.
Ok
()
{
code
=
me
.
fileSystems
[
0
]
.
Truncate
(
path
,
offset
)
}
if
code
.
Ok
()
{
r
.
attr
.
Size
=
offset
me
.
branchCache
.
Set
(
path
,
r
)
}
return
code
}
func
(
me
*
UnionFs
)
Utimens
(
name
string
,
atime
uint64
,
mtime
uint64
)
(
code
fuse
.
Status
)
{
...
...
@@ -698,7 +703,7 @@ func (me *UnionFs) Open(name string, flags uint32) (fuseFile fuse.File, status f
func
(
me
*
UnionFs
)
Release
(
name
string
)
{
me
.
branchCache
.
DropEntry
(
name
)
// Refresh
to pick up the new size
.
// Refresh.
me
.
getBranch
(
name
)
}
...
...
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