mirror of https://github.com/dswd/zvault
Added support for xattrs in fuse mount
This commit is contained in:
parent
012e009bc4
commit
3b50267155
|
@ -5,6 +5,7 @@ This project follows [semantic versioning](http://semver.org).
|
||||||
|
|
||||||
### UNRELEASED
|
### UNRELEASED
|
||||||
* [added] Added `copy` subcommand
|
* [added] Added `copy` subcommand
|
||||||
|
* [added] Added support for xattrs in fuse mount
|
||||||
* [modified] Also documenting common flags in subcommands
|
* [modified] Also documenting common flags in subcommands
|
||||||
* [modified] Using repository aliases (**conversion needed**)
|
* [modified] Using repository aliases (**conversion needed**)
|
||||||
|
|
||||||
|
|
19
src/mount.rs
19
src/mount.rs
|
@ -558,10 +558,21 @@ impl<'a> fuse::Filesystem for FuseFilesystem<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List extended attribute names
|
/// List extended attribute names
|
||||||
fn listxattr (&mut self, _req: &fuse::Request, _ino: u64, _size: u32, reply: fuse::ReplyXattr) {
|
fn listxattr (&mut self, _req: &fuse::Request, ino: u64, size: u32, reply: fuse::ReplyXattr) {
|
||||||
// #FIXME:20 If arg.size is zero, the size of the attribute list should be sent with fuse_getxattr_out
|
let inode = inode!(self, ino, reply);
|
||||||
// #FIXME:10 If arg.size is non-zero, send the attribute list if it fits, or ERANGE otherwise
|
let inode = inode.borrow();
|
||||||
reply.error(libc::ENOSYS);
|
let mut names_str = String::new();
|
||||||
|
for name in inode.inode.xattrs.keys() {
|
||||||
|
names_str.push_str(name);
|
||||||
|
names_str.push('\0');
|
||||||
|
}
|
||||||
|
if size == 0 {
|
||||||
|
return reply.size(names_str.len() as u32);
|
||||||
|
}
|
||||||
|
if size < names_str.len() as u32 {
|
||||||
|
return reply.error(libc::ERANGE);
|
||||||
|
}
|
||||||
|
reply.data(names_str.as_bytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove an extended attribute
|
/// Remove an extended attribute
|
||||||
|
|
Loading…
Reference in New Issue