From d6dead36761f4731951026f48bc3a8d83260b9e5 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Thu, 30 Dec 2021 21:12:29 -0600 Subject: Add xattr filesystem calls --- src/proto.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/proto.rs') diff --git a/src/proto.rs b/src/proto.rs index 128112d..2d53fe6 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -346,12 +346,25 @@ pub struct GetxattrIn { pub padding: u32, } +#[derive(Pod, Zeroable, Copy, Clone)] +#[repr(C)] +pub struct GetxattrOut { + pub size: u32, + pub padding: u32, +} + #[derive(Pod, Zeroable, Copy, Clone)] #[repr(C)] pub struct ListxattrIn { pub getxattr_in: GetxattrIn, } +#[derive(Pod, Zeroable, Copy, Clone)] +#[repr(C)] +pub struct ListxattrOut { + pub getxattr_out: GetxattrOut, +} + #[derive(Pod, Zeroable, Copy, Clone)] #[repr(C)] pub struct FlushIn { @@ -596,6 +609,19 @@ where } } +impl<'o, T, U, V> Structured<'o> for (T, U, V) +where + T: Structured<'o>, + U: Structured<'o>, + V: Structured<'o>, +{ + fn split_from(bytes: &'o [u8], header: &InHeader, last: bool) -> FuseResult<(Self, &'o [u8])> { + let (first, bytes) = T::split_from(bytes, header, false)?; + let ((second, third), end) = <(U, V)>::split_from(bytes, header, last)?; + Ok(((first, second, third), end)) + } +} + impl<'o, T: Pod> Structured<'o> for &'o T { fn split_from(bytes: &'o [u8], _: &InHeader, _last: bool) -> FuseResult<(Self, &'o [u8])> { let (bytes, next_bytes) = bytes.split_at(bytes.len().min(std::mem::size_of::())); -- cgit v1.2.3