Browse Source

micro-opt: get xattrs directly before acls

on linux, acls are based on xattrs, so do these closeby:

1. listxattr -> keys (without acl related keys)
2. for all keys: getxattr
3. acl-related getxattr by acl library
Thomas Waldmann 6 years ago
parent
commit
39922e88e5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/borg/archive.py

+ 1 - 1
src/borg/archive.py

@@ -954,9 +954,9 @@ class MetadataCollector:
         attrs = {}
         attrs = {}
         bsdflags = 0
         bsdflags = 0
         with backup_io('extended stat'):
         with backup_io('extended stat'):
-            xattrs = xattr.get_all(fd or path, follow_symlinks=False)
             if not self.nobsdflags:
             if not self.nobsdflags:
                 bsdflags = get_flags(path, st, fd=fd)
                 bsdflags = get_flags(path, st, fd=fd)
+            xattrs = xattr.get_all(fd or path, follow_symlinks=False)
             acl_get(path, attrs, st, self.numeric_owner, fd=fd)
             acl_get(path, attrs, st, self.numeric_owner, fd=fd)
         if xattrs:
         if xattrs:
             attrs['xattrs'] = StableDict(xattrs)
             attrs['xattrs'] = StableDict(xattrs)