mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
fs: cleanup - do not cache size of metafiles (#3630)
* Remove Size() method and size field from lock.LockedFile * WriteTo method of fsMeta and uploadsV1 now takes concrete type *lock.LockedFile
This commit is contained in:
committed by
Harshavardhana
parent
76b8abcd8e
commit
82373e3d50
@@ -89,14 +89,7 @@ func RLockedOpenFile(path string) (*RLockedFile, error) {
|
||||
|
||||
}
|
||||
|
||||
// LockedFile represents a locked file, implements a helper
|
||||
// method Size(), represents the size of the underlying object.
|
||||
// LockedFile represents a locked file
|
||||
type LockedFile struct {
|
||||
*os.File
|
||||
size int64
|
||||
}
|
||||
|
||||
// Size - size of the underlying locked file.
|
||||
func (l *LockedFile) Size() int64 {
|
||||
return l.size
|
||||
}
|
||||
|
||||
@@ -71,5 +71,5 @@ func LockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error
|
||||
}
|
||||
}
|
||||
|
||||
return &LockedFile{File: f, size: st.Size()}, nil
|
||||
return &LockedFile{File: f}, nil
|
||||
}
|
||||
|
||||
@@ -80,9 +80,6 @@ func TestRWLockedFile(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if rlk.Size() != 0 {
|
||||
t.Fatal("File size should be zero", rlk.Size())
|
||||
}
|
||||
isClosed := rlk.IsClosed()
|
||||
if isClosed {
|
||||
t.Fatal("File ref count shouldn't be zero")
|
||||
|
||||
@@ -65,7 +65,7 @@ func LockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error
|
||||
}
|
||||
}
|
||||
|
||||
return &LockedFile{File: f, size: st.Size()}, nil
|
||||
return &LockedFile{File: f}, nil
|
||||
}
|
||||
|
||||
func makeInheritSa() *syscall.SecurityAttributes {
|
||||
|
||||
Reference in New Issue
Block a user