|
| 1 | +""" |
| 2 | +FUSE filesystem implementation for `borg mount`. |
| 3 | +
|
| 4 | +IMPORTANT |
| 5 | +========= |
| 6 | +
|
| 7 | +This code is only safe for single-threaded and synchronous (non-async) usage. |
| 8 | +
|
| 9 | +- llfuse is synchronous and used with workers=1, so there is only 1 thread, |
| 10 | + and we are safe. |
| 11 | +- pyfuse3 uses Trio, which only uses 1 thread, but could use this code in an |
| 12 | + asynchronous manner. However, as long as we do not use any asynchronous |
| 13 | + operations (like using "await") in this code, it is still de facto |
| 14 | + synchronous, and we are safe. |
| 15 | +""" |
| 16 | + |
1 | 17 | import errno |
2 | 18 | import functools |
3 | 19 | import io |
@@ -177,7 +193,7 @@ def iter_archive_items(self, archive_item_ids, filter=None): |
177 | 193 | for key, (csize, data) in zip(archive_item_ids, self.decrypted_repository.get_many(archive_item_ids)): |
178 | 194 | # Store the chunk ID in the meta-array |
179 | 195 | if write_offset + 32 >= len(meta): |
180 | | - self.meta = meta = meta + bytes(self.GROW_META_BY) |
| 196 | + meta.extend(bytes(self.GROW_META_BY)) |
181 | 197 | meta[write_offset : write_offset + 32] = key |
182 | 198 | current_id_offset = write_offset |
183 | 199 | write_offset += 32 |
@@ -215,7 +231,7 @@ def iter_archive_items(self, archive_item_ids, filter=None): |
215 | 231 | msgpacked_bytes = b"" |
216 | 232 |
|
217 | 233 | if write_offset + 9 >= len(meta): |
218 | | - self.meta = meta = meta + bytes(self.GROW_META_BY) |
| 234 | + meta.extend(bytes(self.GROW_META_BY)) |
219 | 235 |
|
220 | 236 | # item entries in the meta-array come in two different flavours, both nine bytes long. |
221 | 237 | # (1) for items that span chunks: |
|
0 commit comments