This patch includes a number of very trivial consistency and language fixes: - Standardize collie error messages printed to stderr to begin with a initial capital like other standard unix tools and the C library. (Messages written to the sheep.log are already standardized to be uncapitalised.) - Ensure all error messages are printed to stderr not stdout. - Fix some awkward wording, typos and grammatical issues in the messages. - Arrange for all of the tabular output from different collie commands to be similarly formatted and headings capitalised. - Spell VDI as 'VDI' not 'vdi' nor 'Vdi' in messages and comments. Signed-off-by: Chris Webb <chris at arachsys.com> --- collie/cluster.c | 36 ++++++---- collie/collie.c | 61 +++++++--------- collie/common.c | 20 +++--- collie/node.c | 16 ++--- collie/treeview.c | 4 +- collie/vdi.c | 175 +++++++++++++++++++++++----------------------- include/sheep.h | 2 +- include/sheepdog_proto.h | 24 +++--- sheep/group.c | 6 +- sheep/journal.c | 2 +- sheep/ops.c | 4 +- sheep/store.c | 2 +- sheep/vdi.c | 14 ++-- 13 files changed, 181 insertions(+), 185 deletions(-) diff --git a/collie/cluster.c b/collie/cluster.c index 162eb8a..f0284ae 100644 --- a/collie/cluster.c +++ b/collie/cluster.c @@ -57,12 +57,13 @@ static int cluster_format(int argc, char **argv) close(fd); if (ret) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return EXIT_SYSFAIL; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "%s\n", sd_strerror(rsp->result)); + fprintf(stderr, "Format failed: %s\n", + sd_strerror(rsp->result)); return EXIT_FAILURE; } @@ -163,12 +164,13 @@ static int cluster_shutdown(int argc, char **argv) close(fd); if (ret) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return EXIT_SYSFAIL; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "%s\n", sd_strerror(rsp->result)); + fprintf(stderr, "Shutdown failed: %s\n", + sd_strerror(rsp->result)); return EXIT_FAILURE; } @@ -176,12 +178,12 @@ static int cluster_shutdown(int argc, char **argv) } #define RECOVER_PRINT \ -"CAUTION!Please assure me that you have tried booting up all the\n\ -cluster nodes before you run this command.\n\n\ -In two cases you need to recover the cluster manually:\n\ -\t1) The master node is failed to boot in different epoch condition.\n\ -\t2) Some nodes are failed to boot after the cluster is shutdown-ed.\n\ -\nPlease type to continue [Yes/No]: " +"Caution! Please try starting all the cluster nodes normally before\n\ +running this command.\n\n\ +The cluster may need to be recovered manually if:\n\ + - the master node fails to start because of epoch mismatch; or\n\ + - some nodes fail to start after a cluster shutdown.\n\n\ +Are you sure you want to continue? [yes/no]: " static int cluster_recover(int argc, char **argv) { @@ -219,12 +221,13 @@ static int cluster_recover(int argc, char **argv) close(fd); if (ret) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return EXIT_SYSFAIL; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "%s\n", sd_strerror(rsp->result)); + fprintf(stderr, "Recovery failed: %s\n", + sd_strerror(rsp->result)); return EXIT_FAILURE; } @@ -234,7 +237,7 @@ static int cluster_recover(int argc, char **argv) static struct subcommand cluster_cmd[] = { {"info", NULL, "aprh", "show cluster information", 0, cluster_info}, - {"format", NULL, "cHaph", "create a Sheepdog storage", + {"format", NULL, "cHaph", "create a Sheepdog store", 0, cluster_format}, {"shutdown", NULL, "aph", "stop Sheepdog", SUBCMD_FLAG_NEED_NODELIST, cluster_shutdown}, @@ -251,8 +254,11 @@ static int cluster_parser(int ch, char *opt) switch (ch) { case 'c': copies = strtol(opt, &p, 10); - if (opt == p || copies < 1 || copies > SD_MAX_REDUNDANCY) { - fprintf(stderr, "copies must be from 1 through %d\n", + if (opt == p || copies < 1) { + fprintf(stderr, "There must be at least one copy of data\n"); + exit(EXIT_FAILURE); + } else if (copies > SD_MAX_REDUNDANCY) { + fprintf(stderr, "Redundancy may not exceed %d copies\n", SD_MAX_REDUNDANCY); exit(EXIT_FAILURE); } diff --git a/collie/collie.c b/collie/collie.c index fbe9956..408f98d 100644 --- a/collie/collie.c +++ b/collie/collie.c @@ -32,7 +32,7 @@ static const struct sd_option collie_options[] = { single spaces and print all sizes in decimal bytes"}, {'h', "help", 0, "display this help and exit"}, - /* vdi options */ + /* VDI options */ {'P', "prealloc", 0, "preallocate all the data objects"}, {'i', "index", 1, "specify the index of data objects"}, {'s', "snapshot", 1, "specify a snapshot id or tag name"}, @@ -40,9 +40,10 @@ static const struct sd_option collie_options[] = { {'d', "delete", 0, "delete a key"}, /* cluster options */ - {'c', "copies", 1, "set the number of data redundancy"}, - {'H', "nohalt", 0, "serve the IO rquests even lack of enough redundant nodes"}, - {'f', "force", 0, "never promt, you know well what you are doing"}, + {'c', "copies", 1, "specify the data redundancy (number of copies)"}, + {'H', "nohalt", 0, "serve IO requests even if there are too few\n\ + nodes for the configured redundancy"}, + {'f', "force", 0, "do not prompt for confirmation"}, { 0, NULL, 0, NULL }, }; @@ -91,14 +92,15 @@ static int update_node_list(int max_nodes, int epoch) } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "%s\n", sd_strerror(rsp->result)); + fprintf(stderr, "Failed to update node list: %s\n", + sd_strerror(rsp->result)); ret = -1; goto out; } nr_nodes = size / sizeof(*ent); if (nr_nodes == 0) { - fprintf(stderr, "there is no active sheep daemons\n"); + fprintf(stderr, "There are no active sheep daemons\n"); exit(EXIT_FAILURE); } @@ -135,7 +137,7 @@ static const struct sd_option *find_opt(int ch) if (collie_options[i].val == ch) return collie_options + i; } - fprintf(stderr, "internal error\n"); + fprintf(stderr, "Internal error\n"); exit(EXIT_SYSFAIL); } @@ -193,7 +195,7 @@ static unsigned long setup_command(struct command *commands, char *cmd, char *su } if (!found) { - fprintf(stderr, "'%s' is not a valid command\n", cmd); + fprintf(stderr, "Invalid command '%s'\n", cmd); usage(commands, EXIT_USAGE); } @@ -209,10 +211,11 @@ static unsigned long setup_command(struct command *commands, char *cmd, char *su } if (!command_fn) { - fprintf(stderr, "'%s' is not a valid subcommand\n", subcmd); - fprintf(stderr, "'%s' supports the following subcommands:\n", cmd); + if (strcmp(subcmd, "help") && strcmp(subcmd, "--help")) + fprintf(stderr, "Invalid command '%s %s'\n", cmd, subcmd); + fprintf(stderr, "Available %s commands:\n", cmd); for (s = commands[i].sub; s->name; s++) - fprintf(stderr, "%s\n", s->name); + fprintf(stderr, " %s %s\n", cmd, s->name); exit(EXIT_USAGE); } @@ -226,12 +229,11 @@ static void usage(struct command *commands, int status) char name[64]; if (status) - fprintf(stderr, "Try `%s --help' for more information.\n", program_name); + fprintf(stderr, "Try '%s --help' for more information.\n", program_name); else { + printf("Sheepdog administrator utility\n"); printf("Usage: %s <command> <subcommand> [options]\n", program_name); - printf("Sheepdog Administrator Utilty\n"); - printf("\n"); - printf("Command syntax:\n"); + printf("\nAvailable commands:\n"); for (i = 0; commands[i].name; i++) { for (s = commands[i].sub; s->name; s++) { sprintf(name, "%s %s", commands[i].name, s->name); @@ -239,8 +241,8 @@ static void usage(struct command *commands, int status) } } printf("\n"); - printf("For more information, " - "type \"%s <command> <subcommand> --help\".\n", program_name); + printf("For more information, run " + "'%s <command> <subcommand> --help'.\n", program_name); } exit(status); } @@ -251,13 +253,7 @@ static void subcommand_usage(char *cmd, char *subcmd, int status) const struct sd_option *sd_opt; char name[64]; - printf("%s %s - %s\n", cmd, subcmd, command_desc); - printf("\n"); - printf("Usage:\n"); - printf(" %s %s %s", program_name, cmd, subcmd); - if (command_arg) - printf(" %s", command_arg); - + printf("Usage: %s %s %s", program_name, cmd, subcmd); for (i = 0; i < len; i++) { sd_opt = find_opt(command_options[i]); if (sd_opt->has_arg) @@ -265,10 +261,9 @@ static void subcommand_usage(char *cmd, char *subcmd, int status) else printf(" [-%c]", sd_opt->val); } - printf("\n"); - printf("\n"); - - printf("Command parameters:\n"); + if (command_arg) + printf(" %s", command_arg); + printf("\nOptions:\n"); for (i = 0; i < len; i++) { sd_opt = find_opt(command_options[i]); sprintf(name, "-%c, --%s", sd_opt->val, sd_opt->name); @@ -313,7 +308,7 @@ int main(int argc, char **argv) case 'p': sdport = strtol(optarg, &p, 10); if (optarg == p || sdport < 1 || sdport > UINT16_MAX) { - fprintf(stderr, "invalid port number: %s\n", optarg); + fprintf(stderr, "Invalid port number '%s'\n", optarg); exit(EXIT_USAGE); } break; @@ -341,15 +336,13 @@ int main(int argc, char **argv) if (flags & SUBCMD_FLAG_NEED_NODELIST) { ret = update_node_list(SD_MAX_NODES, 0); if (ret < 0) { - fprintf(stderr, "failed to get node list\n"); + fprintf(stderr, "Failed to get node list\n"); exit(EXIT_SYSFAIL); } } - if (flags & SUBCMD_FLAG_NEED_THIRD_ARG && argc == optind) { - fprintf(stderr, "'%s %s' needs the third argument\n", argv[1], argv[2]); - exit(EXIT_USAGE); - } + if (flags & SUBCMD_FLAG_NEED_THIRD_ARG && argc == optind) + subcommand_usage(argv[1], argv[2], EXIT_USAGE); return command_fn(argc, argv); } diff --git a/collie/common.c b/collie/common.c index 8260bd2..32ba0b6 100644 --- a/collie/common.c +++ b/collie/common.c @@ -52,7 +52,7 @@ int sd_read_object(uint64_t oid, void *data, unsigned int datalen, fd = connect_to(sdhost, sdport); if (fd < 0) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return SD_RES_EIO; } @@ -68,12 +68,12 @@ int sd_read_object(uint64_t oid, void *data, unsigned int datalen, close(fd); if (ret) { - fprintf(stderr, "failed to read object, %lx\n", oid); + fprintf(stderr, "Failed to read object %lx\n", oid); return SD_RES_EIO; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read object, %lx %s\n", oid, + fprintf(stderr, "Failed to read object %lx %s\n", oid, sd_strerror(rsp->result)); return rsp->result; } @@ -91,7 +91,7 @@ int sd_write_object(uint64_t oid, uint64_t cow_oid, void *data, unsigned int dat fd = connect_to(sdhost, sdport); if (fd < 0) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return SD_RES_EIO; } @@ -112,12 +112,12 @@ int sd_write_object(uint64_t oid, uint64_t cow_oid, void *data, unsigned int dat close(fd); if (ret) { - fprintf(stderr, "failed to write object, %lx\n", oid); + fprintf(stderr, "Failed to write object %lx\n", oid); return SD_RES_EIO; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "failed to write object, %lx %s\n", oid, - sd_strerror(rsp->result)); + fprintf(stderr, "Failed to write object %lx: %s\n", oid, + sd_strerror(rsp->result)); return rsp->result; } @@ -162,11 +162,11 @@ int parse_vdi(vdi_parser_func_t func, size_t size, void *data) memset(&i, 0, sizeof(i)); ret = sd_read_object(oid, &i, SD_INODE_HEADER_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read a inode header\n"); + fprintf(stderr, "Failed to read inode header\n"); continue; } - if (i.name[0] == '\0') /* this vdi is deleted */ + if (i.name[0] == '\0') /* this VDI has been deleted */ continue; if (size > SD_INODE_HEADER_SIZE) { @@ -179,7 +179,7 @@ int parse_vdi(vdi_parser_func_t func, size_t size, void *data) rlen, SD_INODE_HEADER_SIZE); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read inode\n"); + fprintf(stderr, "Failed to read inode\n"); continue; } } diff --git a/collie/node.c b/collie/node.c index a30a013..a8804f8 100644 --- a/collie/node.c +++ b/collie/node.c @@ -25,10 +25,8 @@ static int node_list(int argc, char **argv) { int i; - if (!raw_output) { - printf(" Idx - Host:Port Vnodes Zone\n"); - printf("---------------------------------------------\n"); - } + if (!raw_output) + printf("M Id Host:Port V-Nodes Zone\n"); for (i = 0; i < nr_nodes; i++) { char data[128]; @@ -38,13 +36,13 @@ static int node_list(int argc, char **argv) if (i == master_idx) { if (highlight) printf(TEXT_BOLD); - printf(raw_output ? "* %d %s %d %d\n" : "* %4d - %-20s\t%d%11d\n", + printf(raw_output ? "* %d %s %d %d\n" : "* %4d %-20s\t%2d%11d\n", i, data, node_list_entries[i].nr_vnodes, node_list_entries[i].zone); if (highlight) printf(TEXT_NORMAL); } else - printf(raw_output ? "- %d %s %d %d\n" : " %4d - %-20s\t%d%11d\n", + printf(raw_output ? "- %d %s %d %d\n" : "- %4d %-20s\t%2d%11d\n", i, data, node_list_entries[i].nr_vnodes, node_list_entries[i].zone); } @@ -100,7 +98,7 @@ static int node_info(int argc, char **argv) } if (success == 0) { - fprintf(stderr, "cannot get information from any nodes\n"); + fprintf(stderr, "Cannot get information from any nodes\n"); return EXIT_SYSFAIL; } @@ -110,7 +108,7 @@ static int node_info(int argc, char **argv) size_to_str(total_size - total_avail, avail_str, sizeof(avail_str)); size_to_str(total_vdi_size, vdi_size_str, sizeof(vdi_size_str)); printf(raw_output ? "Total %s %s %d%% %s\n" - : "\nTotal\t%s\t%s\t%3d%%, total virtual VDI Size\t%s\n", + : "Total\t%s\t%s\t%3d%%\n\nTotal virtual image size\t%s\n", total_str, avail_str, (int)(((double)(total_size - total_avail) / total_size) * 100), vdi_size_str); @@ -121,7 +119,7 @@ static int node_info(int argc, char **argv) static struct subcommand node_cmd[] = { {"list", NULL, "aprh", "list nodes", SUBCMD_FLAG_NEED_NODELIST, node_list}, - {"info", NULL, "aprh", "show each node information", + {"info", NULL, "aprh", "show information about each node", SUBCMD_FLAG_NEED_NODELIST, node_info}, {NULL,}, }; diff --git a/collie/treeview.c b/collie/treeview.c index 2270018..b1d2242 100644 --- a/collie/treeview.c +++ b/collie/treeview.c @@ -59,7 +59,7 @@ static struct vdi_tree *new_vdi(const char *name, const char *label, vdi = malloc(sizeof(struct vdi_tree)); if (!vdi) { - fprintf(stderr, "malloc\n"); + fprintf(stderr, "Failed to allocate memory\n"); return NULL; } strcpy(vdi->name, name); @@ -184,7 +184,7 @@ void dump_tree(void) width = malloc(sizeof(int) * depth); more = malloc(sizeof(int) * depth); if (!width || !more) { - fprintf(stderr, "out of memory\n"); + fprintf(stderr, "Failed to allocate memory\n"); return; } diff --git a/collie/vdi.c b/collie/vdi.c index 91a7264..8260eba 100644 --- a/collie/vdi.c +++ b/collie/vdi.c @@ -53,7 +53,7 @@ static int parse_option_size(const char *value, uint64_t *ret) *ret = (uint64_t) sizef; break; default: - fprintf(stderr, "invalid parameter, %s\n", value); + fprintf(stderr, "Invalid size '%s'\n", value); fprintf(stderr, "You may use k, M, G or T suffixes for " "kilobytes, megabytes, gigabytes and terabytes.\n"); return -1; @@ -124,7 +124,7 @@ static void print_vdi_tree(uint32_t vid, char *name, char * tag, uint32_t snapid char buf[128]; if (is_current(i)) - strcpy(buf, "(You Are Here)"); + strcpy(buf, "(you are here)"); else { ti = i->ctime >> 32; localtime_r(&ti, &tm); @@ -155,11 +155,11 @@ static void print_vdi_graph(uint32_t vid, char *name, char * tag, uint32_t snapi " group = \"%s\",\n" " label = \"", vid, name); - printf("name: %10s\\n" - "tag : %10x\\n" - "size: %10s\\n" - "date: %10s\\n" - "time: %10s", + printf("Name: %10s\\n" + "Tag: %10x\\n" + "Size: %10s\\n" + "Date: %10s\\n" + "Time: %10s", name, snapid, size_str, dbuf, tbuf); if (is_current(i)) @@ -196,18 +196,18 @@ static void do_print_obj(char *sheep, uint64_t oid, struct sd_obj_rsp *rsp, { switch (rsp->result) { case SD_RES_SUCCESS: - printf("%s: has the object (should be %d copies)\n", + printf("%s has the object (should be %d copies)\n", sheep, rsp->copies); break; case SD_RES_NO_OBJ: - printf("%s: doesn't have\n", sheep); + printf("%s doesn't have the object\n", sheep); break; case SD_RES_OLD_NODE_VER: case SD_RES_NEW_NODE_VER: - printf("the node list has changed, try again\n"); + fprintf(stderr, "The node list has changed: please try again\n"); break; default: - printf("%s: hit an unexpected error, %d\n", + fprintf(stderr, "%s: hit an unexpected error (%d)\n", sheep, rsp->result); break; } @@ -237,10 +237,10 @@ static void get_data_oid(char *sheep, uint64_t oid, struct sd_obj_rsp *rsp, break; case SD_RES_OLD_NODE_VER: case SD_RES_NEW_NODE_VER: - printf("the node list has changed, try again\n"); + fprintf(stderr, "The node list has changed: please try again\n"); break; default: - printf("%s: hit an expected error, %d\n", + fprintf(stderr, "%s: hit an unexpected error (%d)\n", sheep, rsp->result); break; } @@ -254,7 +254,7 @@ static void parse_objs(uint64_t oid, obj_parser_func_t func, void *data, unsigne buf = zalloc(size); if (!buf) { - fprintf(stderr, "out of memory\n"); + fprintf(stderr, "Failed to allocate memory\n"); return; } @@ -283,7 +283,7 @@ static void parse_objs(uint64_t oid, obj_parser_func_t func, void *data, unsigne sprintf(name + strlen(name), ":%d", node_list_entries[i].port); if (ret) - printf("%s: can't connect\n", name); + fprintf(stderr, "Failed to connect to %s\n", name); else func(name, oid, rsp, buf, data); } @@ -296,10 +296,8 @@ static int vdi_list(int argc, char **argv) { char *vdiname = argv[optind]; - if (!raw_output) { - printf(" name id size used shared creation time vdi id\n"); - printf("------------------------------------------------------------------\n"); - } + if (!raw_output) + printf(" Name Id Size Used Shared Creation time VDI id\n"); if (vdiname) { struct get_vdi_info info; @@ -372,8 +370,8 @@ static int find_vdi_name(char *vdiname, uint32_t snapid, const char *tag, } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "cannot get vdi info, %s, %s %d %s\n", - sd_strerror(rsp->result), vdiname, snapid, tag); + fprintf(stderr, "Cannot get VDI info for %s %d %s: %s\n", + vdiname, snapid, tag, sd_strerror(rsp->result)); ret = -1; goto out; } @@ -396,7 +394,7 @@ static int do_vdi_create(char *vdiname, int64_t vdi_size, uint32_t base_vid, fd = connect_to(sdhost, sdport); if (fd < 0) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return EXIT_SYSFAIL; } @@ -420,12 +418,13 @@ static int do_vdi_create(char *vdiname, int64_t vdi_size, uint32_t base_vid, close(fd); if (ret) { - fprintf(stderr, "failed to send a request\n"); + fprintf(stderr, "Failed to send a request\n"); return EXIT_SYSFAIL; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "%s, %s\n", sd_strerror(rsp->result), vdiname); + fprintf(stderr, "Failed to create VDI %s: %s\n", vdiname, + sd_strerror(rsp->result)); return EXIT_FAILURE; } @@ -446,14 +445,14 @@ static int vdi_create(int argc, char **argv) char *buf = NULL; if (!argv[optind]) { - fprintf(stderr, "please specify the size of vdi\n"); + fprintf(stderr, "Please specify the VDI size\n"); return EXIT_USAGE; } ret = parse_option_size(argv[optind], &size); if (ret < 0) return EXIT_USAGE; if (size > SD_MAX_VDI_SIZE) { - fprintf(stderr, "too big image size, %s\n", argv[optind]); + fprintf(stderr, "VDI size is too large\n"); return EXIT_USAGE; } @@ -464,14 +463,14 @@ static int vdi_create(int argc, char **argv) inode = malloc(sizeof(*inode)); buf = zalloc(SD_DATA_OBJ_SIZE); if (!inode || !buf) { - fprintf(stderr, "oom\n"); + fprintf(stderr, "Failed to allocate memory\n"); ret = EXIT_SYSFAIL; goto out; } ret = sd_read_object(vid_to_vdi_oid(vid), inode, sizeof(*inode), 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read a newly created vdi object\n"); + fprintf(stderr, "Failed to read a newly created VDI object\n"); ret = EXIT_FAILURE; goto out; } @@ -512,20 +511,20 @@ static int vdi_snapshot(int argc, char **argv) struct sheepdog_inode *inode = (struct sheepdog_inode *)buf; if (vdi_cmd_data.snapshot_id != 0) { - fprintf(stderr, "please specify a non-integer value for " + fprintf(stderr, "Please specify a non-integer value for " "a snapshot tag name\n"); return EXIT_USAGE; } ret = find_vdi_name(vdiname, 0, "", &vid, 0); if (ret < 0) { - fprintf(stderr, "failed to open vdi %s\n", vdiname); + fprintf(stderr, "Failed to open VDI %s\n", vdiname); return EXIT_FAILURE; } ret = sd_read_object(vid_to_vdi_oid(vid), inode, SD_INODE_HEADER_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read an inode header\n"); + fprintf(stderr, "Failed to read an inode header\n"); return EXIT_FAILURE; } @@ -550,15 +549,14 @@ static int vdi_clone(int argc, char **argv) dst_vdi = argv[optind]; if (!dst_vdi) { - fprintf(stderr, "a dst vdi must be specified\n"); + fprintf(stderr, "Destination VDI name must be specified\n"); ret = EXIT_USAGE; goto out; } if (!vdi_cmd_data.snapshot_id && !vdi_cmd_data.snapshot_tag[0]) { - fprintf(stderr, "it is not supported to create a clone image of " - "the non-snapshot vdi\n"); - fprintf(stderr, "please specify a '-s' option\n"); + fprintf(stderr, "Only snapshot VDIs can be cloned\n"); + fprintf(stderr, "Please specify the '-s' option\n"); ret = EXIT_USAGE; goto out; } @@ -566,20 +564,20 @@ static int vdi_clone(int argc, char **argv) ret = find_vdi_name(src_vdi, vdi_cmd_data.snapshot_id, vdi_cmd_data.snapshot_tag, &base_vid, 0); if (ret < 0) { - fprintf(stderr, "failed to open vdi %s\n", src_vdi); + fprintf(stderr, "Failed to open VDI %s\n", src_vdi); ret = EXIT_FAILURE; goto out; } inode = malloc(sizeof(*inode)); if (!inode) { - fprintf(stderr, "oom\n"); + fprintf(stderr, "Failed to allocate memory\n"); ret = EXIT_SYSFAIL; goto out; } ret = sd_read_object(vid_to_vdi_oid(base_vid), inode, SD_INODE_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read a base inode\n"); + fprintf(stderr, "Failed to read a base inode\n"); ret = EXIT_FAILURE; goto out; } @@ -590,7 +588,7 @@ static int vdi_clone(int argc, char **argv) buf = zalloc(SD_DATA_OBJ_SIZE); if (!buf) { - fprintf(stderr, "oom\n"); + fprintf(stderr, "Failed to allocate memory\n"); ret = EXIT_SYSFAIL; goto out; } @@ -641,31 +639,31 @@ static int vdi_resize(int argc, char **argv) struct sheepdog_inode *inode = (struct sheepdog_inode *)buf; if (!argv[optind]) { - fprintf(stderr, "please specify a new size of vdi\n"); + fprintf(stderr, "Please specify the new size for the VDI\n"); return EXIT_USAGE; } ret = parse_option_size(argv[optind], &new_size); if (ret < 0) return EXIT_USAGE; if (new_size > SD_MAX_VDI_SIZE) { - fprintf(stderr, "too big image size, %s\n", argv[optind]); + fprintf(stderr, "New VDI size is too large\n"); return EXIT_USAGE; } ret = find_vdi_name(vdiname, 0, "", &vid, 0); if (ret < 0) { - fprintf(stderr, "failed to open vdi %s\n", vdiname); + fprintf(stderr, "Failed to open VDI %s\n", vdiname); return EXIT_FAILURE; } ret = sd_read_object(vid_to_vdi_oid(vid), inode, SD_INODE_HEADER_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read an inode header\n"); + fprintf(stderr, "Failed to read an inode header\n"); return EXIT_FAILURE; } if (new_size < inode->vdi_size) { - fprintf(stderr, "shrinking is not implemented\n"); + fprintf(stderr, "Shrinking VDIs is not implemented\n"); return EXIT_USAGE; } inode->vdi_size = new_size; @@ -673,7 +671,7 @@ static int vdi_resize(int argc, char **argv) ret = sd_write_object(vid_to_vdi_oid(vid), 0, inode, SD_INODE_HEADER_SIZE, 0, 0, inode->nr_copies, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to update an inode header\n"); + fprintf(stderr, "Failed to update an inode header\n"); return EXIT_FAILURE; } @@ -712,12 +710,13 @@ static int vdi_delete(int argc, char **argv) close(fd); if (ret) { - fprintf(stderr, "failed to connect\n"); + fprintf(stderr, "Failed to connect\n"); return EXIT_SYSFAIL; } if (rsp->result != SD_RES_SUCCESS) { - fprintf(stderr, "%s: %s\n", vdiname, sd_strerror(rsp->result)); + fprintf(stderr, "Failed to delete %s: %s\n", vdiname, + sd_strerror(rsp->result)); if (rsp->result == SD_RES_NO_VDI) return EXIT_MISSING; else @@ -745,7 +744,7 @@ static int vdi_object(int argc, char **argv) vid = info.vid; if (vid == 0) { - printf("No such vdi\n"); + fprintf(stderr, "VDI not found\n"); return EXIT_MISSING; } @@ -777,7 +776,7 @@ static int vdi_object(int argc, char **argv) printf("The inode object 0x%" PRIx32 " idx %u is not allocated\n", vid, idx); } else - printf("failed to read the inode object 0x%" PRIx32 "\n", vid); + fprintf(stderr, "Failed to read the inode object 0x%" PRIx32 "\n", vid); } return EXIT_SUCCESS; @@ -805,7 +804,7 @@ static int find_vdi_attr_oid(char *vdiname, char *tag, uint32_t snapid, fd = connect_to(sdhost, sdport); if (fd < 0) { - fprintf(stderr, "failed to connect\n\n"); + fprintf(stderr, "Failed to connect\n\n"); return SD_RES_EIO; } @@ -855,7 +854,7 @@ static int vdi_setattr(int argc, char **argv) key = argv[optind++]; if (!key) { - fprintf(stderr, "please specify the name of key\n"); + fprintf(stderr, "Please specify the attribute key\n"); return EXIT_USAGE; } @@ -863,7 +862,7 @@ static int vdi_setattr(int argc, char **argv) if (!value && !vdi_cmd_data.delete) { value = malloc(SD_MAX_VDI_ATTR_VALUE_LEN); if (!value) { - fprintf(stderr, "failed to allocate memory\n"); + fprintf(stderr, "Failed to allocate memory\n"); return EXIT_SYSFAIL; } @@ -872,7 +871,7 @@ reread: ret = read(STDIN_FILENO, value + offset, SD_MAX_VDI_ATTR_VALUE_LEN - offset); if (ret < 0) { - fprintf(stderr, "failed to read from stdin, %m\n"); + fprintf(stderr, "Failed to read attribute value from stdin: %m\n"); return EXIT_SYSFAIL; } if (ret > 0) { @@ -891,16 +890,16 @@ reread: vdi_cmd_data.exclusive, vdi_cmd_data.delete); if (ret) { if (ret == SD_RES_VDI_EXIST) { - fprintf(stderr, "the attribute already exists, %s\n", key); + fprintf(stderr, "The attribute '%s' already exists\n", key); return EXIT_EXISTS; } else if (ret == SD_RES_NO_OBJ) { - fprintf(stderr, "no such attribute, %s\n", key); + fprintf(stderr, "Attribute '%s' not found\n", key); return EXIT_MISSING; } else if (ret == SD_RES_NO_VDI) { - fprintf(stderr, "vdi not found\n"); + fprintf(stderr, "VDI not found\n"); return EXIT_MISSING; } else - fprintf(stderr, "failed to set attr, %s\n", + fprintf(stderr, "Failed to set attribute: %s\n", sd_strerror(ret)); return EXIT_FAILURE; } @@ -918,7 +917,7 @@ static int vdi_getattr(int argc, char **argv) key = argv[optind++]; if (!key) { - fprintf(stderr, "please specify the name of key\n"); + fprintf(stderr, "Please specify the attribute key\n"); return EXIT_USAGE; } @@ -926,13 +925,13 @@ static int vdi_getattr(int argc, char **argv) vdi_cmd_data.snapshot_id, key, NULL, 0, &vid, &attr_oid, &nr_copies, 0, 0, 0); if (ret == SD_RES_NO_OBJ) { - fprintf(stderr, "no such attribute, %s\n", key); + fprintf(stderr, "Attribute '%s' not found\n", key); return EXIT_MISSING; } else if (ret == SD_RES_NO_VDI) { - fprintf(stderr, "vdi not found\n"); + fprintf(stderr, "VDI not found\n"); return EXIT_MISSING; } else if (ret) { - fprintf(stderr, "failed to find attr oid, %s\n", + fprintf(stderr, "Failed to find attribute oid: %s\n", sd_strerror(ret)); return EXIT_MISSING; } @@ -941,7 +940,7 @@ static int vdi_getattr(int argc, char **argv) ret = sd_read_object(oid, &vattr, SD_ATTR_OBJ_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read attr oid, %s\n", + fprintf(stderr, "Failed to read attribute oid: %s\n", sd_strerror(ret)); return EXIT_SYSFAIL; } @@ -965,7 +964,7 @@ static int vdi_read(int argc, char **argv) if (ret < 0) return EXIT_USAGE; if (offset % 512 != 0) { - fprintf(stderr, "offset must be block-aligned\n"); + fprintf(stderr, "Read offset must be block-aligned\n"); return EXIT_USAGE; } if (argv[optind]) { @@ -973,7 +972,7 @@ static int vdi_read(int argc, char **argv) if (ret < 0) return EXIT_USAGE; if (total % 512 != 0) { - fprintf(stderr, "len must be block-aligned\n"); + fprintf(stderr, "Read length must be block-aligned\n"); return EXIT_USAGE; } } @@ -982,7 +981,7 @@ static int vdi_read(int argc, char **argv) inode = malloc(sizeof(*inode)); buf = malloc(SD_DATA_OBJ_SIZE); if (!inode || !buf) { - fprintf(stderr, "oom\n"); + fprintf(stderr, "Failed to allocate memory\n"); ret = EXIT_SYSFAIL; goto out; } @@ -990,19 +989,19 @@ static int vdi_read(int argc, char **argv) ret = find_vdi_name(vdiname, vdi_cmd_data.snapshot_id, vdi_cmd_data.snapshot_tag, &vid, 0); if (ret < 0) { - fprintf(stderr, "failed to open vdi %s\n", vdiname); + fprintf(stderr, "Failed to open VDI %s\n", vdiname); ret = EXIT_FAILURE; goto out; } ret = sd_read_object(vid_to_vdi_oid(vid), inode, SD_INODE_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read an inode\n"); + fprintf(stderr, "Failed to read an inode\n"); ret = EXIT_FAILURE; goto out; } if (inode->vdi_size < offset) { - fprintf(stderr, "offset beyond end of vdi\n"); + fprintf(stderr, "Read offset is beyond the end of the VDI\n"); ret = EXIT_FAILURE; goto out; } @@ -1018,7 +1017,7 @@ static int vdi_read(int argc, char **argv) oid = vid_to_data_oid(inode->data_vdi_id[idx], idx); ret = sd_read_object(oid, buf, len, offset); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read vdi\n"); + fprintf(stderr, "Failed to read VDI\n"); ret = EXIT_FAILURE; goto out; } @@ -1029,7 +1028,7 @@ static int vdi_read(int argc, char **argv) while (remain) { ret = write(STDOUT_FILENO, buf + (len - remain), len); if (ret < 0) { - fprintf(stderr, "failed to output, %m\n"); + fprintf(stderr, "Failed to write to stdout: %m\n"); ret = EXIT_SYSFAIL; goto out; } @@ -1065,7 +1064,7 @@ static int vdi_write(int argc, char **argv) if (ret < 0) return EXIT_USAGE; if (offset % 512 != 0) { - fprintf(stderr, "offset must be block-aligned\n"); + fprintf(stderr, "Write offset must be block-aligned\n"); return EXIT_USAGE; } if (argv[optind]) { @@ -1073,7 +1072,7 @@ static int vdi_write(int argc, char **argv) if (ret < 0) return EXIT_USAGE; if (total % 512 != 0) { - fprintf(stderr, "len must be block-aligned\n"); + fprintf(stderr, "Write length must be block-aligned\n"); return EXIT_USAGE; } } @@ -1082,26 +1081,26 @@ static int vdi_write(int argc, char **argv) inode = malloc(sizeof(*inode)); buf = malloc(SD_DATA_OBJ_SIZE); if (!inode || !buf) { - fprintf(stderr, "oom\n"); + fprintf(stderr, "Failed to allocate memory\n"); ret = EXIT_SYSFAIL; goto out; } ret = find_vdi_name(vdiname, 0, "", &vid, 0); if (ret < 0) { - fprintf(stderr, "failed to open vdi %s\n", vdiname); + fprintf(stderr, "Failed to open VDI %s\n", vdiname); ret = EXIT_FAILURE; goto out; } ret = sd_read_object(vid_to_vdi_oid(vid), inode, SD_INODE_SIZE, 0); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to read an inode\n"); + fprintf(stderr, "Failed to read an inode\n"); ret = EXIT_FAILURE; goto out; } if (inode->vdi_size < offset) { - fprintf(stderr, "offset beyond end of vdi\n"); + fprintf(stderr, "Write offset is beyond the end of the VDI\n"); ret = EXIT_FAILURE; goto out; } @@ -1138,7 +1137,7 @@ static int vdi_write(int argc, char **argv) break; } else if (ret < 0) { - fprintf(stderr, "%m\n"); + fprintf(stderr, "Failed to read from stdin: %m\n"); ret = EXIT_SYSFAIL; goto out; } @@ -1150,7 +1149,7 @@ static int vdi_write(int argc, char **argv) ret = sd_write_object(oid, old_oid, buf, len, offset, flags, inode->nr_copies, create); if (ret != SD_RES_SUCCESS) { - fprintf(stderr, "failed to write vdi\n"); + fprintf(stderr, "Failed to write VDI\n"); ret = EXIT_FAILURE; goto out; } @@ -1181,31 +1180,31 @@ out: } static struct subcommand vdi_cmd[] = { - {"create", "<vdiname> <size>", "Paph", "create a image", + {"create", "<vdiname> <size>", "Paph", "create an image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_create}, {"snapshot", "<vdiname>", "saph", "create a snapshot", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_snapshot}, - {"clone", "<src vdi> <dst vdi>", "sPaph", "create a clone image", + {"clone", "<src vdi> <dst vdi>", "sPaph", "clone an image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_clone}, - {"delete", "<vdiname>", "saph", "delete a image", + {"delete", "<vdiname>", "saph", "delete an image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_delete}, {"list", "[vdiname]", "aprh", "list images", SUBCMD_FLAG_NEED_NODELIST, vdi_list}, {"tree", NULL, "aph", "show images in tree view format", SUBCMD_FLAG_NEED_NODELIST, vdi_tree}, - {"graph", NULL, "aph", "show images with Graphviz dot format", + {"graph", NULL, "aph", "show images in Graphviz dot format", SUBCMD_FLAG_NEED_NODELIST, vdi_graph}, {"object", "<vdiname>", "isaph", "show object information in the image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_object}, - {"setattr", "<vdiname> <key> [value]", "dxaph", "set a vdi attribute", + {"setattr", "<vdiname> <key> [value]", "dxaph", "set a VDI attribute", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_setattr}, - {"getattr", "<vdiname> <key>", "aph", "get a vdi attribute", + {"getattr", "<vdiname> <key>", "aph", "get a VDI attribute", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_getattr}, - {"resize", "<vdiname> <new size>", "aph", "resize a image", + {"resize", "<vdiname> <new size>", "aph", "resize an image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_resize}, - {"read", "<vdiname> [<offset> [<len>]]", "saph", "read data from a image", + {"read", "<vdiname> [<offset> [<len>]]", "saph", "read data from an image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_read}, - {"write", "<vdiname> [<offset> [<len>]]", "aph", "write data to a image", + {"write", "<vdiname> [<offset> [<len>]]", "aph", "write data to an image", SUBCMD_FLAG_NEED_NODELIST|SUBCMD_FLAG_NEED_THIRD_ARG, vdi_write}, {NULL,}, }; @@ -1221,7 +1220,7 @@ static int vdi_parser(int ch, char *opt) case 'i': vdi_cmd_data.index = strtol(opt, &p, 10); if (opt == p) { - fprintf(stderr, "the index must be an integer\n"); + fprintf(stderr, "The index must be an integer\n"); exit(EXIT_FAILURE); } break; diff --git a/include/sheep.h b/include/sheep.h index 8d4840c..c4a1c14 100644 --- a/include/sheep.h +++ b/include/sheep.h @@ -48,7 +48,7 @@ concurrent accesses to non-snapshot VDIs. */ #define SD_FLAG_CMD_WEAK_CONSISTENCY 0x0040 -/* flags for vdi attribute operations */ +/* flags for VDI attribute operations */ #define SD_FLAG_CMD_CREAT 0x0100 #define SD_FLAG_CMD_EXCL 0x0200 #define SD_FLAG_CMD_DEL 0x0400 diff --git a/include/sheepdog_proto.h b/include/sheepdog_proto.h index fc667b6..b664223 100644 --- a/include/sheepdog_proto.h +++ b/include/sheepdog_proto.h @@ -36,22 +36,22 @@ #define SD_RES_UNKNOWN 0x01 /* Unknown error */ #define SD_RES_NO_OBJ 0x02 /* No object found */ #define SD_RES_EIO 0x03 /* I/O error */ -#define SD_RES_VDI_EXIST 0x04 /* Vdi exists already */ +#define SD_RES_VDI_EXIST 0x04 /* VDI exists already */ #define SD_RES_INVALID_PARMS 0x05 /* Invalid parameters */ #define SD_RES_SYSTEM_ERROR 0x06 /* System error */ -#define SD_RES_VDI_LOCKED 0x07 /* Vdi is locked */ -#define SD_RES_NO_VDI 0x08 /* No vdi found */ -#define SD_RES_NO_BASE_VDI 0x09 /* No base vdi found */ -#define SD_RES_VDI_READ 0x0A /* Cannot read requested vdi */ -#define SD_RES_VDI_WRITE 0x0B /* Cannot write requested vdi */ -#define SD_RES_BASE_VDI_READ 0x0C /* Cannot read base vdi */ -#define SD_RES_BASE_VDI_WRITE 0x0D /* Cannot write base vdi */ +#define SD_RES_VDI_LOCKED 0x07 /* VDI is locked */ +#define SD_RES_NO_VDI 0x08 /* No VDI found */ +#define SD_RES_NO_BASE_VDI 0x09 /* No base VDI found */ +#define SD_RES_VDI_READ 0x0A /* Cannot read requested VDI */ +#define SD_RES_VDI_WRITE 0x0B /* Cannot write requested VDI */ +#define SD_RES_BASE_VDI_READ 0x0C /* Cannot read base VDI */ +#define SD_RES_BASE_VDI_WRITE 0x0D /* Cannot write base VDI */ #define SD_RES_NO_TAG 0x0E /* Requested tag is not found */ #define SD_RES_STARTUP 0x0F /* Sheepdog is on starting up */ -#define SD_RES_VDI_NOT_LOCKED 0x10 /* Vdi is not locked */ +#define SD_RES_VDI_NOT_LOCKED 0x10 /* VDI is not locked */ #define SD_RES_SHUTDOWN 0x11 /* Sheepdog is shutting down */ #define SD_RES_NO_MEM 0x12 /* Cannot allocate memory */ -#define SD_RES_FULL_VDI 0x13 /* we already have the maximum vdis */ +#define SD_RES_FULL_VDI 0x13 /* we already have the maximum VDIs */ #define SD_RES_VER_MISMATCH 0x14 /* Protocol version mismatch */ #define SD_RES_NO_SPACE 0x15 /* Server has no room for new objects */ #define SD_RES_WAIT_FOR_FORMAT 0x16 /* Sheepdog is waiting for a format operation */ @@ -65,8 +65,8 @@ * * 0 - 19 (20 bits): data object space * 20 - 31 (12 bits): reserved data object space - * 32 - 55 (24 bits): vdi object space - * 56 - 59 ( 4 bits): reserved vdi object space + * 32 - 55 (24 bits): VDI object space + * 56 - 59 ( 4 bits): reserved VDI object space * 60 - 63 ( 4 bits): object type indentifier space */ diff --git a/sheep/group.c b/sheep/group.c index 4cf81cb..dbfa9c8 100644 --- a/sheep/group.c +++ b/sheep/group.c @@ -466,12 +466,12 @@ static int get_vdi_bitmap_from(struct sheepdog_node_list_entry *node) fd = connect_to(host, node->port); if (fd < 0) { - vprintf(SDOG_ERR, "unable to get the vdi bitmap from %s: %m\n", host); + vprintf(SDOG_ERR, "unable to get the VDI bitmap from %s: %m\n", host); ret = -SD_RES_EIO; goto out; } - vprintf(SDOG_ERR, "getting the vdi bitmap from %s\n", host); + vprintf(SDOG_ERR, "getting the VDI bitmap from %s\n", host); memset(&hdr, 0, sizeof(hdr)); hdr.opcode = SD_OP_READ_VDIS; @@ -486,7 +486,7 @@ static int get_vdi_bitmap_from(struct sheepdog_node_list_entry *node) close(fd); if (ret || rsp->result != SD_RES_SUCCESS) { - vprintf(SDOG_ERR, "unable to get the vdi bitmap (%d, %d)\n", ret, + vprintf(SDOG_ERR, "unable to get the VDI bitmap (%d, %d)\n", ret, rsp->result); goto out; } diff --git a/sheep/journal.c b/sheep/journal.c index 790ebb6..b2f0e8b 100644 --- a/sheep/journal.c +++ b/sheep/journal.c @@ -172,7 +172,7 @@ static int jrnl_apply_to_target_object(struct jrnl_descriptor *jd) return SD_RES_NO_MEM; } - /* Flush out journal to disk (vdi object) */ + /* Flush out journal to disk (VDI object) */ retsize = pread64(jd->fd, &jd->head, sizeof(jd->head), 0); retsize = pread64(jd->fd, buf, jd->head.size, sizeof(jd->head)); retsize = pwrite64(jd->target_fd, buf, jd->head.size, jd->head.offset); diff --git a/sheep/ops.c b/sheep/ops.c index fd836c1..ea5d1c4 100644 --- a/sheep/ops.c +++ b/sheep/ops.c @@ -195,8 +195,8 @@ static int cluster_get_vdi_attr(const struct sd_req *req, struct sd_rsp *rsp, if (ret != SD_RES_SUCCESS) return ret; - /* the curernt vdi id can change if we take the snapshot, - so we use the hash value of the vdi name as the vdi id */ + /* the current VDI id can change if we take a snapshot, + so we use the hash value of the VDI name as the VDI id */ vid = fnv_64a_buf(vattr->name, strlen(vattr->name), FNV1A_64_INIT); vid &= SD_NR_VDIS - 1; ret = get_vdi_attr(hdr->epoch, data, hdr->data_length, vid, diff --git a/sheep/store.c b/sheep/store.c index 92ba8ec..010d640 100644 --- a/sheep/store.c +++ b/sheep/store.c @@ -1899,7 +1899,7 @@ static int init_epoch_path(const char *base_path) if (!is_vdi_obj(oid)) continue; - vprintf(SDOG_DEBUG, "found the vdi object %" PRIx64 "\n", oid); + vprintf(SDOG_DEBUG, "found the VDI object %" PRIx64 "\n", oid); set_bit(oid_to_vid(oid), sys->vdi_inuse); } diff --git a/sheep/vdi.c b/sheep/vdi.c index 84ab539..f00ce04 100644 --- a/sheep/vdi.c +++ b/sheep/vdi.c @@ -296,12 +296,12 @@ int add_vdi(uint32_t epoch, char *data, int data_len, uint64_t size, if (is_snapshot) { if (ret != SD_RES_SUCCESS) { if (ret == SD_RES_NO_VDI) - vprintf(SDOG_CRIT, "vdi %s does not exist\n", name); + vprintf(SDOG_CRIT, "VDI %s does not exist\n", name); return ret; } nr = right_nr; } else { - /* we already have the same vdi or met other errors. */ + /* we already have the same VDI or met other errors. */ if (ret != SD_RES_NO_VDI) { if (ret == SD_RES_SUCCESS) ret = SD_RES_VDI_EXIST; @@ -311,7 +311,7 @@ int add_vdi(uint32_t epoch, char *data, int data_len, uint64_t size, if (deleted_nr == SD_NR_VDIS) nr = right_nr; else - nr = deleted_nr; /* we can recycle a deleted vdi */ + nr = deleted_nr; /* we can recycle a deleted VDI */ next_snapid = 1; } @@ -461,7 +461,7 @@ static void delete_one(struct work *work, int idx) 0, sys->nr_sobjs); if (ret != SD_RES_SUCCESS) { - eprintf("cannot find vdi object\n"); + eprintf("cannot find VDI object\n"); goto out; } @@ -524,7 +524,7 @@ again: SD_INODE_HEADER_SIZE, 0, sys->nr_sobjs); if (ret != SD_RES_SUCCESS) { - eprintf("cannot find vdi object\n"); + eprintf("cannot find VDI object\n"); goto err; } @@ -567,7 +567,7 @@ next: SD_INODE_HEADER_SIZE, 0, sys->nr_sobjs); if (ret != SD_RES_SUCCESS) { - eprintf("cannot find vdi object\n"); + eprintf("cannot find VDI object\n"); vid = 0; goto out; } @@ -724,7 +724,7 @@ int get_vdi_attr(uint32_t epoch, struct sheepdog_vdi_attr *vattr, int data_len, (*attrid)++; } - dprintf("there is no space for new vdis\n"); + dprintf("there is no space for new VDIs\n"); ret = SD_RES_FULL_VDI; out: free_ordered_sd_vnode_list(entries); -- 1.7.5.4 |