Signed-off-by: Tony Asleson <tasle...@redhat.com> --- c_binding/lsm_mgmt.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp index 54a3b2d..3b91402 100644 --- a/c_binding/lsm_mgmt.cpp +++ b/c_binding/lsm_mgmt.cpp @@ -1849,6 +1849,16 @@ int lsm_fs_file_clone(lsm_connect *c, lsm_fs *fs, const char *src_file_name, return jobCheck(c, rc, response, job); } +static Value _create_fs_file_flag_params(lsm_fs *fs, lsm_string_list *files, + lsm_flags flags) +{ + std::map<std::string, Value> p; + p["fs"] = fs_to_value(fs); + p["files"] = string_list_to_value(files); + p["flags"] = Value(flags); + return Value(p); +} + int lsm_fs_child_dependency( lsm_connect *c, lsm_fs *fs, lsm_string_list *files, uint8_t *yes, lsm_flag flags) { @@ -1870,12 +1880,8 @@ int lsm_fs_child_dependency( lsm_connect *c, lsm_fs *fs, lsm_string_list *files, } try { - std::map<std::string, Value> p; - p["fs"] = fs_to_value(fs); - p["files"] = string_list_to_value(files); - p["flags"] = Value(flags); - Value parameters(p); + Value parameters = _create_fs_file_flag_params(fs, files, flags); Value response; rc = rpc(c, "fs_child_dependency", parameters, response); @@ -1906,12 +1912,7 @@ int lsm_fs_child_dependency_delete( lsm_connect *c, lsm_fs *fs, lsm_string_list return LSM_ERR_INVALID_ARGUMENT; } - std::map<std::string, Value> p; - p["fs"] = fs_to_value(fs); - p["files"] = string_list_to_value(files); - p["flags"] = Value(flags); - - Value parameters(p); + Value parameters = _create_fs_file_flag_params(fs, files, flags); Value response; int rc = rpc(c, "fs_child_dependency_rm", parameters, response); -- 1.8.2.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Libstoragemgmt-devel mailing list Libstoragemgmt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libstoragemgmt-devel