It is no longer necessary to flush each write. Much better write performance without this.

This commit is contained in:
Christopher Wilcox 2017-06-22 18:24:38 -07:00
Родитель 51a5da928f
Коммит 4b1bbec9dc
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -372,11 +372,7 @@ class AzureFiles(LoggingMixIn, Operations):
raise FuseOSError(errno.EINVAL) raise FuseOSError(errno.EINVAL)
# write the data at the range adding old data to the front and back of it. # write the data at the range adding old data to the front and back of it.
self.fds[fh] = self.File(self.fds[fh].path, d[:offset] + data + d[offset+len(data):], True) self.fds[fh] = self.File(self.fds[fh].path, d[:offset] + data + d[offset+len(data):], True)
# flush each time. to undo this, we need to make sure that getattr # NOTE: An issue used to exist where if flush wasn't called here, file lengths were reported incorrectly.
# reports the file on disk, not on the server. was seeing issues due
# to a file being echo'd to, written, and not reporting the length
# after the write.
self.flush(path,fh)
data_length = len(data) data_length = len(data)
# TODO: if we ever try to cache attrs, we would have to update the st_mtime. # TODO: if we ever try to cache attrs, we would have to update the st_mtime.