mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
fs: Re-implement object layer to remember the fd (#3509)
This patch re-writes FS backend to support shared backend sharing locks for safe concurrent access across multiple servers.
This commit is contained in:
@@ -24,8 +24,12 @@ import "syscall"
|
||||
// sure that subsequent writes on a file just created will not fail,
|
||||
// in addition, file allocation will be contigous on the disk
|
||||
func Fallocate(fd int, offset int64, len int64) error {
|
||||
return syscall.Fallocate(fd,
|
||||
1, // FALLOC_FL_KEEP_SIZE
|
||||
offset,
|
||||
len)
|
||||
// No need to attempt fallocate for 0 length.
|
||||
if len == 0 {
|
||||
return nil
|
||||
}
|
||||
// Don't extend size of file even if offset + len is
|
||||
// greater than file size from <bits/fcntl-linux.h>.
|
||||
fallocFLKeepSize := uint32(1)
|
||||
return syscall.Fallocate(fd, fallocFLKeepSize, offset, len)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user