5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2025-01-18 14:03:37 +03:00

285 Commits

Author SHA1 Message Date
Wolfgang Bumiller
448bb127a2 remove rust-toolchain file
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-03 13:26:58 +02:00
Wolfgang Bumiller
707bad0d57 add debian build files
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-03 13:25:30 +02:00
Wolfgang Bumiller
afe05f3ffa accessor: use aio Decoder in aio Accessor
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-02 12:58:29 +02:00
Wolfgang Bumiller
da286c2802 Entry: add is_blockdev, is_chardev next to is_device
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-02 12:57:27 +02:00
Wolfgang Bumiller
93fa37fb0f derive Clone for FileEntry
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-02 12:57:12 +02:00
Wolfgang Bumiller
27eaae4867 add Entry::into_metadata
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-20 09:59:47 +02:00
Wolfgang Bumiller
c3bba169b5 accessr: add convenience read_at to FileContents
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-18 15:25:05 +02:00
Wolfgang Bumiller
6f78e6eae5 add .cargo/config to use local repos
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-18 10:38:54 +02:00
Wolfgang Bumiller
6e91d157da drop more trait objects for auto-trait reasons
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 15:56:20 +02:00
Wolfgang Bumiller
951620f184 Get rid of dyn SeqRead use
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 15:56:20 +02:00
Wolfgang Bumiller
fc9c8c9deb Get rid of dyn SeqWrite
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 14:06:09 +02:00
Wolfgang Bumiller
c68a29b589 Get rid of dyn ReadAt usage
It causes auto traits to be lost across await points.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 13:53:38 +02:00
Wolfgang Bumiller
bb6540d7a3 implement ReadAt for Arcs
`Arc<dyn ReadAt + Send + Sync + 'static>` is the most
convenience type for a monomorphized random access
`Accessor`, so let's add this for convenience.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 12:34:03 +02:00
Wolfgang Bumiller
d3a83ee3df implement accessor::aio
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 12:34:03 +02:00
Wolfgang Bumiller
a2530fb79c accessor: add size method
to get the size the accessor was initially created with

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-13 12:34:03 +02:00
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