]> git.ipfire.org Git - thirdparty/tar.git/commit
tar: extract delayed links in order
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 Jun 2023 19:54:20 +0000 (12:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 Jun 2023 21:28:36 +0000 (14:28 -0700)
commitd6a60bba7637e283ae8b0859404f37b291dc5faa
treec1de768769f213f6b1f2dae711208d901ef1bba1
parent2ccd643d01315f51fe172454bf716e3fa4952762
tar: extract delayed links in order

Extract delayed links in tar file order, rather than
in hash table order with modifications.
This is simpler and more likely to use the kernel’s
cached filesystem data, assuming related delayed links
are nearby in the tar file.
* src/extract.c (struct delayed_link.has_predecessor):
Remove.  All uses removed.
(delayed_link_head, delayed_link_tail): New static vars.
This resurrects delayed_link_head’s old function
except that the linked list is now in forward order, not reverse.
(find_delayed_link_source): Now simply returns bool,
since the callers no longer need the pointer.
(create_placeholder_file):
Put the delayed link at the end of the linked list.
Omit no-longer-needed last arg.  All callers changed.
(apply_delayed_links): Simplify now that we can just iterate
through the delayed_link_head list.
src/extract.c