diff options
Diffstat (limited to 'tests/volume.rc')
-rw-r--r-- | tests/volume.rc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/volume.rc b/tests/volume.rc index 1cee648993b..1ca17ab3456 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -796,3 +796,15 @@ function count_sh_entries() { ls $1/.glusterfs/indices/xattrop | grep -v "xattrop-" | wc -l } + +function get_fd_count { + local vol=$1 + local host=$2 + local brick=$3 + local fname=$4 + local gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $brick/$fname)) + local statedump=$(generate_brick_statedump $vol $host $brick) + local count=$(grep "gfid=$gfid_str" $statedump -A2 | grep fd-count | cut -f2 -d'=' | tail -1) + rm -f $statedump + echo $count +} |