mirror of https://github.com/borgbackup/borg.git
create: do not give chunker a py file object, it is not needed
the os level file handle is enough, the chunker will prefer it if valid and won't use the file obj, so we can give None there. this saves these unneeded syscalls: fstat(5, {st_mode=S_IFREG|0664, st_size=227063, ...}) = 0 ioctl(5, TCGETS, 0x7ffd635635f0) = -1 ENOTTY (Inappropriate ioctl for device) lseek(5, 0, SEEK_CUR) = 0
This commit is contained in:
parent
8e91694c54
commit
13e6970437
|
@ -1151,9 +1151,11 @@ class FilesystemObjectProcessors:
|
|||
else:
|
||||
with backup_io('open'):
|
||||
fh = Archive._open_rb(path)
|
||||
with os.fdopen(fh, 'rb') as fd:
|
||||
self.process_file_chunks(item, cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(fd, fh)))
|
||||
try:
|
||||
self.process_file_chunks(item, cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(None, fh)))
|
||||
md = self.metadata_collector.stat_attrs(st, path, fd=fh)
|
||||
finally:
|
||||
os.close(fh)
|
||||
if not is_special_file:
|
||||
# we must not memorize special files, because the contents of e.g. a
|
||||
# block or char device will change without its mtime/size/inode changing.
|
||||
|
|
Loading…
Reference in New Issue