From 076830c068fb39bbc3e863c89a4253cbea36357e Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 9 Apr 2012 23:11:52 +0530 Subject: doc: Move outdated documentation to legacy Change-Id: I0ceba9a993e8b1cdef4ff6a784bfd69c08107d88 BUG: 811311 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.com/3116 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- doc/legacy/get_put_api_using_xattr.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/legacy/get_put_api_using_xattr.txt (limited to 'doc/legacy/get_put_api_using_xattr.txt') diff --git a/doc/legacy/get_put_api_using_xattr.txt b/doc/legacy/get_put_api_using_xattr.txt new file mode 100644 index 000000000..243f9f1ae --- /dev/null +++ b/doc/legacy/get_put_api_using_xattr.txt @@ -0,0 +1,22 @@ +GlusterFS get/put API interface provided through extended attributes: + +API usage: + int put(dirpath/filename, data): setfattr -n glusterfs.file. -v + void *get(dirpath/filename): getfattr -n glusterfs.file. + + +internals: +* unify handling setxattr/getxattr + - setxattr + unify's setxattr forwards setxattr call to all the child nodes with XATTR_REPLACE flag, except namespace. setxattr will succeeds only on the child node on which the file already exists. if the setxattr operation fails on all child nodes, it indicates that the file does not already exist on any of the child nodes. unify follows the same rules as it follows for create, but using setxattr call itself with XATTR_CREATE flag. unify sends a setxattr to namespace first, with zero length data. if namespace setxattr succeeds, unify schedules setxattr to one of the child nodes. + + - getxattr + unify's getxattr forwards getxattr call to all the child nodes. wait for completion of operation on all the child nodes, and returns success if getxattr succeeded one child node. + +* posix handling setxattr/getxattr + - setxattr + posix setxattr does a open with O_CREAT|O_TRUNC on the /, writes value of the setxattr as data into the file and closes the file. when data is null, posix setxattr avoids doing write. file is closed after write. + + - getxattr + posix getxattr does open with O_RDONLY on the /, reads the complete content of the file. file is closed after read. + -- cgit