[Reproducible-commits] [disorderfs] 01/07: Add xattr support

Andrew Ayer agwa at andrewayer.name
Wed Aug 26 20:15:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

agwa-guest pushed a commit to branch debian
in repository disorderfs.

commit bf36cccb49912b6625990d6e5681b1c8d468120f
Author: Andrew Ayer <agwa at andrewayer.name>
Date:   Wed Aug 26 20:56:54 2015 +0200

    Add xattr support
---
 disorderfs.1.txt |  2 --
 disorderfs.cpp   | 16 ++++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/disorderfs.1.txt b/disorderfs.1.txt
index 99f85aa..b904816 100644
--- a/disorderfs.1.txt
+++ b/disorderfs.1.txt
@@ -43,8 +43,6 @@ Errors from close are not properly reported.
 
 fsync is not implemented.
 
-xattrs are not implemented.
-
 Locks are not propagated to the underlying filesystem.
 
 
diff --git a/disorderfs.cpp b/disorderfs.cpp
index 680fc84..57a8535 100644
--- a/disorderfs.cpp
+++ b/disorderfs.cpp
@@ -171,16 +171,20 @@ int	main (int argc, char** argv)
 	disorderfs_fuse_operations.fsync = [] (const char* path, int datasync, struct fuse_file_info* info) -> int {
 	};
 	*/
-	/* TODO: xattrs
-	disorderfs_fuse_operations.setxattr = [] (const char *, const char *, const char *, size_t, int) -> int {
+	disorderfs_fuse_operations.setxattr = [] (const char* path, const char* name, const char* value, size_t size, int flags) -> int {
+		return wrap(setxattr((root + path).c_str(), name, value, size, flags));
 	};
-	disorderfs_fuse_operations.getxattr = [] (const char *, const char *, char *, size_t) -> int {
+	disorderfs_fuse_operations.getxattr = [] (const char* path, const char* name, char* value, size_t size) -> int {
+		ssize_t res = getxattr((root + path).c_str(), name, value, size);
+		return res >= 0 ? res : -errno;
 	};
-	disorderfs_fuse_operations.listxattr = [] (const char *, char *, size_t) -> int {
+	disorderfs_fuse_operations.listxattr = [] (const char* path, char* list, size_t size) -> int {
+		ssize_t res = listxattr((root + path).c_str(), list, size);
+		return res >= 0 ? res : -errno;
 	};
-	disorderfs_fuse_operations.removexattr = [] (const char *, const char *) -> int {
+	disorderfs_fuse_operations.removexattr = [] (const char* path, const char* name) -> int {
+		return wrap(removexattr((root + path).c_str(), name));
 	};
-	*/
 	disorderfs_fuse_operations.opendir = [] (const char* path, struct fuse_file_info* info) -> int {
 		std::unique_ptr<Dirents> dirents{new Dirents};
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/disorderfs.git



More information about the Reproducible-commits mailing list