]> arthur.barton.de Git - bup.git/commit
vfs: read metadata only if needed
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 5 Feb 2020 21:21:18 +0000 (22:21 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 30 May 2021 16:46:09 +0000 (11:46 -0500)
commit585ab5e3ba050fd068a953230958886c4ef63154
tree854fdea0c6c1b8435ddcbbf6c6689dd28f378d96
parent73145fade1fe16c7035a25efdb43bcdde39550bf
vfs: read metadata only if needed

If we get into contents(), we have an indication of whether or
not metadata is needed (the want_meta argument), but it doesn't
get passed down to revlist_items() and further down, so that in
cache_commit() we eventually call _revlist_item_from_oid() with
metadata always. This is wasteful.

Fix this by passing the information all the way down.

To make the caching work properly in this case, store a special
entry in the revlist dict (_HAS_META_ENTRY) indicating whether
or not metadata was cached, and if that's not set on a later
lookup, then don't return it if it doesn't have metadata but we
need the metadata.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/vfs.py