def fallocate(self, mode, offset, length):
"""
This is a Linux-specific sys call, unlike posix_fallocate()
Allows the caller to directly manipulate the allocated disk space for
the file for the byte range starting at offset and continuing for
length bytes.
:param mode: Operation to be performed on the given range
:param offset: Starting offset
:param length: Size in bytes, starting at offset
"""
ret = api.client.glfs_fallocate(self.fd, mode, offset, length)
if ret < 0:
err = ctypes.get_errno()
raise OSError(err, os.strerror(err))
评论列表
文章目录