From 056bce103c31be8416bd3ede93c7258c5b3f8554 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Tue, 15 Dec 2015 00:19:41 -0500 Subject: extras: Ease creation of new xlators Add a python generator that creates a template for new xlator. Co-Authored by Jeff Darcy. Change-Id: I10820c0483794dcd450656684cf954f7b8f159e0 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/13061 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- libglusterfs/src/generator.py | 112 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/generator.py b/libglusterfs/src/generator.py index 8be68337baa..8b854b2e7f7 100755 --- a/libglusterfs/src/generator.py +++ b/libglusterfs/src/generator.py @@ -62,6 +62,8 @@ import string # proper inode_link call(s). ops = {} +xlator_cbks = {} +xlator_dumpops = {} ops['fgetxattr'] = ( ('fop-arg', 'fd', 'fd_t *'), @@ -532,6 +534,116 @@ ops['getspec'] = ( ('cbk-arg', 'spec_data', 'char *'), ) +##################################################################### +xlator_cbks['forget'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'inode', 'inode_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_cbks['release'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'fd', 'fd_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_cbks['releasedir'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'fd', 'fd_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_cbks['invalidate'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'inode', 'inode_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_cbks['client_destroy'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'client', 'client_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_cbks['client_disconnect'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'client', 'client_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_cbks['ictxmerge'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'fd', 'fd_t *'), + ('fn-arg', 'inode', 'inode_t *'), + ('fn-arg', 'linked_inode', 'inode_t *'), + ('ret-val', 'void', ''), +) + +##################################################################### +xlator_dumpops['priv'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['inode'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['fd'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['inodectx'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'ino', 'inode_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['fdctx'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'fd', 'fd_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['priv_to_dict'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'dict', 'dict_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['inode_to_dict'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'dict', 'dict_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['fd_to_dict'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'dict', 'dict_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['inodectx_to_dict'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'ino', 'inode_t *'), + ('fn-arg', 'dict', 'dict_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['fdctx_to_dict'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('fn-arg', 'fd', 'fd_t *'), + ('fn-arg', 'dict', 'dict_t *'), + ('ret-val', 'int32_t', '0'), +) + +xlator_dumpops['history'] = ( + ('fn-arg', 'this', 'xlator_t *'), + ('ret-val', 'int32_t', '0'), +) + def get_error_arg (type_str): if type_str.find(" *") != -1: return "NULL" -- cgit