Permalink
Browse files

Don't cache files after sending.

  • Loading branch information...
1 parent 9c7b3c4 commit eb0de1823ad43768f0f22a3fd5f206782d5fd612 @hanwen committed Jun 13, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 fs.go
View
11 fs.go
@@ -283,10 +283,13 @@ func (n *fileNode) send() error {
dt.Nanoseconds()/1e6, 1e3*float64(fi.Size())/float64(dt.Nanoseconds()))
n.dirty = false
- // This is a heuristic, but if doing a large copy, we want to
- // leave space for the next file. It would be better if
- // userspace did fallocate and FUSE would support it.
- n.fs.ensureFreeSpace(fi.Size())
+ // We could leave the file for future reading, but the
+ // management of free space is a hassle when doing large
+ // copies.
+ if len(n.Inode().Files(0)) == 1 {
+ os.Remove(n.backing)
+ n.backing = ""
+ }
return err
}

0 comments on commit eb0de18

Please sign in to comment.