mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-01 15:15:59 -04:00
create: only run stat_simple_attrs() once
This is a backport of cd4f6b41ca
the second call was done in stat_attrs().
this increases backup with lots of unchanged files performance by ~ 5%.
This commit is contained in:
parent
133da4dd49
commit
e886df4cde
1 changed files with 2 additions and 2 deletions
|
|
@ -999,6 +999,7 @@ Utilization of max. archive size: {csize_max:.0%}
|
|||
|
||||
def process_file(self, path, st, cache):
|
||||
with self.create_helper(path, st, None) as (item, status, hardlinked, hardlink_master): # no status yet
|
||||
item.update(self.stat_simple_attrs(st))
|
||||
is_special_file = is_special(st.st_mode)
|
||||
if not hardlinked or hardlink_master:
|
||||
if not is_special_file:
|
||||
|
|
@ -1023,7 +1024,6 @@ Utilization of max. archive size: {csize_max:.0%}
|
|||
else:
|
||||
status = 'M' if known else 'A' # regular file, modified or added
|
||||
item.hardlink_master = hardlinked
|
||||
item.update(self.stat_simple_attrs(st))
|
||||
# Only chunkify the file if needed
|
||||
if chunks is not None:
|
||||
item.chunks = chunks
|
||||
|
|
@ -1037,7 +1037,7 @@ Utilization of max. archive size: {csize_max:.0%}
|
|||
# block or char device will change without its mtime/size/inode changing.
|
||||
cache.memorize_file(path_hash, st, [c.id for c in item.chunks])
|
||||
self.stats.nfiles += 1
|
||||
item.update(self.stat_attrs(st, path))
|
||||
item.update(self.stat_ext_attrs(st, path))
|
||||
item.get_size(memorize=True)
|
||||
if is_special_file:
|
||||
# we processed a special file like a regular file. reflect that in mode,
|
||||
|
|
|
|||
Loading…
Reference in a new issue