summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/generator.py')
-rwxr-xr-xlibglusterfs/src/generator.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/libglusterfs/src/generator.py b/libglusterfs/src/generator.py
index c9311ea3856..3072382c7a5 100755
--- a/libglusterfs/src/generator.py
+++ b/libglusterfs/src/generator.py
@@ -714,7 +714,7 @@ def get_error_arg (type_str):
return "NULL"
return "-1"
-def get_subs (names, types):
+def get_subs (names, types, cbktypes=None):
sdict = {}
sdict["@SHORT_ARGS@"] = string.join(names,", ")
# Convert two separate tuples to one of (name, type) sub-tuples.
@@ -725,6 +725,9 @@ def get_subs (names, types):
sdict["@LONG_ARGS@"] = string.join(as_strings,",\n\t")
# So much more readable than string.join(map(string.join,zip(...))))
sdict["@ERROR_ARGS@"] = string.join(map(get_error_arg,types),", ")
+ if cbktypes is not None:
+ sdict["@CBK_ERROR_ARGS@"] = string.join(map(
+ get_error_arg,cbktypes),", ")
return sdict
def generate (tmpl, name, subs):
@@ -732,6 +735,8 @@ def generate (tmpl, name, subs):
if name == "writev":
# More spurious inconsistency.
text = text.replace("@UPNAME@","WRITE")
+ elif name == "readv":
+ text = text.replace("@UPNAME@","READ")
else:
text = text.replace("@UPNAME@",name.upper())
for old, new in subs[name].iteritems():
@@ -747,7 +752,8 @@ for name, args in ops.iteritems():
# Create the necessary substitution strings for fops.
arg_names = [ a[1] for a in args if a[0] == 'fop-arg']
arg_types = [ a[2] for a in args if a[0] == 'fop-arg']
- fop_subs[name] = get_subs(arg_names,arg_types)
+ cbk_types = [ a[2] for a in args if a[0] == 'cbk-arg']
+ fop_subs[name] = get_subs(arg_names,arg_types,cbk_types)
# Same thing for callbacks.
arg_names = [ a[1] for a in args if a[0] == 'cbk-arg']