From fa0ad231745846918b2625d0e1a89c0a5c3c24dc Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Wed, 11 Mar 2015 14:20:48 +0530 Subject: libgfapi : anonymous fd support Anonymous fd's are floating fd assigned to a glusterfs client without a explicit file open. Here either it will create a new anonymous fd or existing anonymous fd in the client stack for requested file.The anonymous fd's are mainly used for IO's. This patch introduces two api's glfs_h_anonymous_read and glfs_h_anonymous_write which performs read and write respectively Change-Id: Id646f2220e8387b2f8bb244c848dc1db6761444f BUG: 1204651 Signed-off-by: Jiffin Tony Thottan Reviewed-by: Niels de Vos Reviewed-on: http://review.gluster.org/9971 Tested-by: Gluster Build System --- tests/basic/gfapi/anonymous_fd.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tests/basic/gfapi/anonymous_fd.sh (limited to 'tests/basic/gfapi/anonymous_fd.sh') diff --git a/tests/basic/gfapi/anonymous_fd.sh b/tests/basic/gfapi/anonymous_fd.sh new file mode 100755 index 00000000000..2184f8efc8e --- /dev/null +++ b/tests/basic/gfapi/anonymous_fd.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +TEST glusterd + +TEST $CLI volume create $V0 $H0:$B0/brick1; +EXPECT 'Created' volinfo_field $V0 'Status'; + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +logdir=`gluster --print-logdir` + +TEST build_tester $(dirname $0)/anonymous_fd_read_write.c -lgfapi -o $(dirname $0)/anonymous_fd +TEST ./$(dirname $0)/anonymous_fd $V0 $logdir/anonymous_fd.log + +cleanup_tester $(dirname $0)/anonymous_fd + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup; -- cgit