create: also archive inode number, fixes #8362

we could use this if we use the "previous archive" instead of the "files cache"
to determine whether a file is unchanged.
This commit is contained in:
Thomas Waldmann 2024-09-17 11:47:52 +02:00
parent e4b5a59be0
commit ae4abdfe1c
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
4 changed files with 9 additions and 1 deletions

View file

@ -1058,6 +1058,8 @@ class MetadataCollector:
group = gid2group(st.st_gid)
if group is not None:
attrs["group"] = group
if st.st_ino > 0:
attrs["inode"] = st.st_ino
return attrs
def stat_ext_attrs(self, st, path, fd=None):

View file

@ -1,7 +1,7 @@
# this set must be kept complete, otherwise the RobustUnpacker might malfunction:
# fmt: off
ITEM_KEYS = frozenset(['path', 'source', 'target', 'rdev', 'chunks', 'chunks_healthy', 'hardlink_master', 'hlid',
'mode', 'user', 'group', 'uid', 'gid', 'mtime', 'atime', 'ctime', 'birthtime', 'size',
'mode', 'user', 'group', 'uid', 'gid', 'mtime', 'atime', 'ctime', 'birthtime', 'size', 'inode',
'xattrs', 'bsdflags', 'acl_nfs4', 'acl_access', 'acl_default', 'acl_extended',
'part'])
# fmt: on

View file

@ -209,6 +209,10 @@ class Item(PropDict):
@nlink.setter
def nlink(self, val: int) -> None: ...
@property
def inode(self) -> int: ...
@inode.setter
def inode(self, val: int) -> None: ...
@property
def size(self) -> int: ...
@size.setter
def size(self, val: int) -> None: ...

View file

@ -288,6 +288,8 @@ cdef class Item(PropDict):
# size is only present for items with a chunk list and then it is sum(chunk_sizes)
size = PropDictProperty(int)
inode = PropDictProperty(int)
hlid = PropDictProperty(bytes) # hard link id: same value means same hard link.
hardlink_master = PropDictProperty(bool) # legacy