Skip to content

Commit

Permalink
Merge pull request #8384 from ThomasWaldmann/archive-inode
Browse files Browse the repository at this point in the history
create: also archive inode number, fixes #8362
  • Loading branch information
ThomasWaldmann authored Sep 17, 2024
2 parents e4b5a59 + ae4abdf commit ed31131
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/borg/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,8 @@ def stat_simple_attrs(self, st):
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):
Expand Down
2 changes: 1 addition & 1 deletion src/borg/constants.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/borg/item.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
2 changes: 2 additions & 0 deletions src/borg/item.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ed31131

Please sign in to comment.