summaryrefslogtreecommitdiffstats
path: root/doc/legacy/get_put_api_using_xattr.txt
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2012-04-09 23:11:52 +0530
committerAnand Avati <avati@redhat.com>2012-04-11 10:25:56 -0700
commit076830c068fb39bbc3e863c89a4253cbea36357e (patch)
tree842884d8db9a40d5a53e5171c852a84daa8e0f65 /doc/legacy/get_put_api_using_xattr.txt
parentdf8e2f53b70f4f49af70df308010dddfe5ca35ec (diff)
doc: Move outdated documentation to legacy
Change-Id: I0ceba9a993e8b1cdef4ff6a784bfd69c08107d88 BUG: 811311 Signed-off-by: Vijay Bellur <vijay@gluster.com> Reviewed-on: http://review.gluster.com/3116 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'doc/legacy/get_put_api_using_xattr.txt')
-rw-r--r--doc/legacy/get_put_api_using_xattr.txt22
1 files changed, 22 insertions, 0 deletions
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.<filename> -v <data> <dirpath>
+ void *get(dirpath/filename): getfattr -n glusterfs.file.<filename> <dirpath>
+
+
+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 <path>/<name>, 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 <path>/<name>, reads the complete content of the file. file is closed after read.
+