From aa6fa7f3cf0c7a2ab078ad4648eca742e5acd232 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 4 Oct 2015 15:43:46 +0200 Subject: Truncate: Logging improvements, show number of blocks as float --- pathfs_frontend/file.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pathfs_frontend/file.go') diff --git a/pathfs_frontend/file.go b/pathfs_frontend/file.go index 47f935b..b328b61 100644 --- a/pathfs_frontend/file.go +++ b/pathfs_frontend/file.go @@ -241,9 +241,9 @@ func (f *file) Truncate(newSize uint64) fuse.Status { } oldSize := f.cfs.PlainSize(uint64(fi.Size())) { - oldB := (oldSize + f.cfs.PlainBS() - 1) / f.cfs.PlainBS() - newB := (newSize + f.cfs.PlainBS() - 1) / f.cfs.PlainBS() - cryptfs.Debug.Printf("ino%d: truncate from %d to %d blocks (%d to %d bytes)\n", f.ino, oldB, newB, oldSize, newSize) + oldB := float32(oldSize) / float32(f.cfs.PlainBS()) + newB := float32(newSize) / float32(f.cfs.PlainBS()) + cryptfs.Debug.Printf("ino%d: FUSE Truncate from %.2f to %.2f blocks (%d to %d bytes)\n", f.ino, oldB, newB, oldSize, newSize) } // File grows -- cgit v1.2.3