5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2024-12-22 21:33:50 +03:00
Commit Graph

220 Commits

Author SHA1 Message Date
Wolfgang Bumiller
a5922fbcdc accessor: expose lookup_self
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 12:34:03 +02:00
Wolfgang Bumiller
6b9e2478e5 accessor: open_file_at_range, open_contents_at_range unsafe helpers
for our fuse code

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 12:34:03 +02:00
Wolfgang Bumiller
34da710317 sync accessor: remove 'async' from open_dir_at_end
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-05 14:21:11 +02:00
Wolfgang Bumiller
a95eabc02b Entry: add file_size() convenience helper
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-05 14:20:55 +02:00
Wolfgang Bumiller
ceb83806d3 expose full entry ranges for unsafe access
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-05 13:51:33 +02:00
Wolfgang Bumiller
d5fb1f7a68 cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-05 11:55:08 +02:00
Wolfgang Bumiller
b764a2b1fb add: interface to set goodbye table cache
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-29 13:37:57 +02:00
Wolfgang Bumiller
be35e740a7 add missing file
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-29 13:20:45 +02:00
Wolfgang Bumiller
9d8af6f286 Add a Cache interface and internal gbt cache usage
This allows the users to implement whatever kind of caching
they want to use for the goodbye table level.

In the future there may be caches for metadata, or path
based goodbye table lookups etc.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-28 16:59:59 +02:00
Wolfgang Bumiller
2fd112ac9a add Device::from_dev_t
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-24 14:40:17 +02:00
Wolfgang Bumiller
21d66e104b Entry, Metaedata: file_type() and file_mode() getters
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-24 12:26:26 +02:00
Wolfgang Bumiller
62aaaa86d7 cleanup + failure -> anyhow transition
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-24 10:41:49 +02:00
Wolfgang Bumiller
2c44200797 use CStr for XAttr names
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-24 10:41:39 +02:00
Wolfgang Bumiller
3680d0ee2e Make QuotaProjectId Copy
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-23 12:21:34 +02:00
Wolfgang Bumiller
9e82b1c3b6 shorten Permissions name, add NO_MASK entry
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-23 12:15:15 +02:00
Wolfgang Bumiller
a7149b09ff encoder: add fifo and socket support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-22 11:08:16 +02:00
Wolfgang Bumiller
2287d8b26c decoder: handle fifos and sockets properly
These are the only items which don't get "finalized" by a
dedicated packet (like a PAYLOAD or DEVICE), so for these we
need to check at the next FILENAME or GOODBYE entry.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-22 11:02:02 +02:00
Wolfgang Bumiller
af35697966 give goodbye tables an empty path
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-21 14:58:41 +02:00
Wolfgang Bumiller
4c42ef2e59 fix EOF condition in goodbye tables
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-21 14:57:18 +02:00
Wolfgang Bumiller
84a183f2df fix seq_read_exact_or_eof
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-21 14:56:39 +02:00
Wolfgang Bumiller
f7b824c38f use a separate state for InGoodbyeTable
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-21 14:14:12 +02:00
Wolfgang Bumiller
8617cae3e2 add Entry::{get_file_bits,get_permission_bits}
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-21 11:14:26 +02:00
Wolfgang Bumiller
9cda3431e0 add Device::to_dev_t
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-20 15:24:34 +02:00
Wolfgang Bumiller
ae3ab159fc add 'full' meta-feature
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-20 15:24:28 +02:00
Wolfgang Bumiller
0a00a48cb6 decoder: less confusing generic type letters
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 11:04:08 +01:00
Wolfgang Bumiller
15e0bfe53c decoder: fix size check in read_simple_entry
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 11:02:15 +01:00
Wolfgang Bumiller
59e6f6798b cleanup: merge incomplete_*_error variables
This could be bitflags or a string, but we only use
std::io:Error and end up with a textual ErrorKind::Other
anyway. (An enum still seemed more efficient at runtime than
a String, given that this is normally a rather exceptional
case caused by the crate user...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 09:57:07 +01:00
Wolfgang Bumiller
b9122056a8 cleanup: remove PxarStruct trait
We ended up using only twice, and it's just a tiny shortcut.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 09:33:53 +01:00
Wolfgang Bumiller
7b389f88a8 Symlink/Hardlink::as_os_str convenience helpers
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 15:00:15 +01:00
Wolfgang Bumiller
353bbf7339 Symlink/Hardlink: AsRef<[u8]> and update AsRef<OsStr>
Don't include the terminating nul byte in AsRef<OsStr>

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:58:35 +01:00
Wolfgang Bumiller
ae2210feaa Metadata::mtime_as_duration shortcut
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:48:28 +01:00
Wolfgang Bumiller
54912ae673 AsRef<OsStr> for Symlink and Hardlink
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:42:23 +01:00
Wolfgang Bumiller
65a8a0d581 add Entry::kind
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:34:31 +01:00
Wolfgang Bumiller
3a11ff3ea4 decoder: add content_size method
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:32:53 +01:00
Wolfgang Bumiller
6da548dd11 convenience method to get mtime as std Duration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:32:43 +01:00
Wolfgang Bumiller
8eb622dd0e formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:11:58 +01:00
Wolfgang Bumiller
a6928cfc6d add Acl::is_empty
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:11:46 +01:00
Wolfgang Bumiller
a13a2f742f expose format::mode at the top level
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 13:52:01 +01:00
Wolfgang Bumiller
6100072b51 content reader for sequential decoder
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 13:42:50 +01:00
Wolfgang Bumiller
27631c163f expose 'with_goodbye_tables' decoder options
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 13:17:08 +01:00
Wolfgang Bumiller
cf12da394e add Decoder::open
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 10:17:40 +01:00
Wolfgang Bumiller
a889559e32 fix async Encoder::create
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 10:17:30 +01:00
Wolfgang Bumiller
327e33f21b formatting fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 11:07:25 +01:00
Wolfgang Bumiller
07b244df32 encoder: expose add_symlink/hardlink/device
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 11:06:45 +01:00
Wolfgang Bumiller
a7b9409131 buildsys: we work with stable 1.42 atm
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 11:06:29 +01:00
Wolfgang Bumiller
5410984044 add aio Encoder
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-18 16:10:28 +01:00
Wolfgang Bumiller
05356884d6 add AsyncWrite interface to encoder::FileImpl
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-18 15:08:56 +01:00
Wolfgang Bumiller
3fe26522fe encoder: add_device
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 11:19:10 +01:00
Wolfgang Bumiller
0abc412132 encoder: add_hardlink
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 11:12:17 +01:00
Wolfgang Bumiller
2fb73e7b11 encoder: add_symlink
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 11:10:52 +01:00