From 86d2e4b64b2aacbf4b0c610d06375a01233c5bc4 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 28 Oct 2016 18:47:35 +0200 Subject: [PATCH] btrfs-progs: remove extra newline from messages The common message helpers add the newline. Signed-off-by: David Sterba --- cmds-check.c | 2 +- cmds-filesystem.c | 8 ++++---- cmds-inspect-dump-tree.c | 2 +- cmds-receive.c | 8 ++++---- cmds-replace.c | 2 +- cmds-restore.c | 4 ++-- cmds-send.c | 2 +- cmds-subvolume.c | 6 +++--- image/main.c | 6 +++--- qgroup-verify.c | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index f9370e26..26ddef3a 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -4526,7 +4526,7 @@ extref: len = ref_namelen; } else { len = BTRFS_NAME_LEN; - warning("Warning: root %llu INODE %s[%llu %llu] name too long\n", + warning("root %llu INODE %s[%llu %llu] name too long", root->objectid, key->type == BTRFS_INODE_REF_KEY ? "REF" : "EXTREF", diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 41623f31..96bdc40e 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -149,7 +149,7 @@ static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) ret = ioctl(fd, BTRFS_IOC_SPACE_INFO, sargs); if (ret < 0) { - error("cannot get space info: %s\n", strerror(errno)); + error("cannot get space info: %s", strerror(errno)); free(sargs); return -errno; } @@ -875,7 +875,7 @@ devs_only: ret = btrfs_scan_devices(); if (ret) { - error("blkid device scan returned %d\n", ret); + error("blkid device scan returned %d", ret); return 1; } @@ -1116,7 +1116,7 @@ static int cmd_filesystem_defrag(int argc, char **argv) dirstream = NULL; fd = open_file_or_dir(argv[i], &dirstream); if (fd < 0) { - error("cannot open %s: %s\n", argv[i], + error("cannot open %s: %s", argv[i], strerror(errno)); defrag_global_errors++; close_file_or_dir(fd, dirstream); @@ -1130,7 +1130,7 @@ static int cmd_filesystem_defrag(int argc, char **argv) continue; } if (!(S_ISDIR(st.st_mode) || S_ISREG(st.st_mode))) { - error("%s is not a directory or a regular file\n", + error("%s is not a directory or a regular file", argv[i]); defrag_global_errors++; close_file_or_dir(fd, dirstream); diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c index 03aa0b27..df7be617 100644 --- a/cmds-inspect-dump-tree.c +++ b/cmds-inspect-dump-tree.c @@ -269,7 +269,7 @@ int cmd_inspect_dump_tree(int argc, char **argv) tree_id = treeid_from_string(optarg, &end); if (!tree_id) { - error("unrecognized tree id: %s\n", + error("unrecognized tree id: %s", optarg); exit(1); } diff --git a/cmds-receive.c b/cmds-receive.c index 781dce9b..63807d03 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -101,7 +101,7 @@ static int finish_subvol(struct btrfs_receive *r) O_RDONLY | O_NOATIME); if (subvol_fd < 0) { ret = -errno; - error("cannot open %s: %s\n", + error("cannot open %s: %s", r->cur_subvol_path, strerror(-ret)); goto out; } @@ -184,7 +184,7 @@ static int process_subvol(const char *path, const u8 *uuid, u64 ctransid, } else { ret = path_cat_out(r->cur_subvol_path, r->dest_dir_path, path); if (ret < 0) { - error("subvol: path invalid: %s\n", path); + error("subvol: path invalid: %s", path); goto out; } } @@ -707,7 +707,7 @@ static int process_write(const char *path, const void *data, u64 offset, offset + pos); if (w < 0) { ret = -errno; - error("writing to %s failed: %s\n", + error("writing to %s failed: %s", path, strerror(-ret)); goto out; } @@ -793,7 +793,7 @@ static int process_clone(const char *path, u64 offset, u64 len, ret = ioctl(r->write_fd, BTRFS_IOC_CLONE_RANGE, &clone_args); if (ret < 0) { ret = -errno; - error("failed to clone extents to %s\n%s\n", + error("failed to clone extents to %s\n%s", path, strerror(-ret)); goto out; } diff --git a/cmds-replace.c b/cmds-replace.c index d1bf057e..9345da23 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -436,7 +436,7 @@ static int print_replace_status(int fd, const char *path, int once) printf("Never started"); break; default: - error("unknown status from ioctl DEV_REPLACE_STATUS on '%s': %llu\n", + error("unknown status from ioctl DEV_REPLACE_STATUS on '%s': %llu", path, status->replace_state); return -EINVAL; } diff --git a/cmds-restore.c b/cmds-restore.c index a8c67a51..bdd35bd7 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -330,7 +330,7 @@ static int copy_one_extent(struct btrfs_root *root, int fd, inbuf = malloc(size_left); if (!inbuf) { - error("not enough memory\n"); + error("not enough memory"); return -ENOMEM; } @@ -486,7 +486,7 @@ static int set_file_xattrs(struct btrfs_root *root, u64 inode, do { ret = next_leaf(root, &path); if (ret < 0) { - error("searching for extended attributes: %d\n", + error("searching for extended attributes: %d", ret); goto out; } else if (ret) { diff --git a/cmds-send.c b/cmds-send.c index 1ca4b8e4..cae600e4 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -236,7 +236,7 @@ static void *dump_thread(void *arg) rbytes = read(sctx->send_fd, buf, sizeof(buf)); if (rbytes < 0) { ret = -errno; - error("failed to read stream from kernel: %s\n", + error("failed to read stream from kernel: %s", strerror(-ret)); goto out; } diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 4cd2e0ec..7384de45 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -923,10 +923,10 @@ static int cmd_subvol_show(int argc, char **argv) ret = get_subvol_info(fullpath, &get_ri); if (ret) { if (ret < 0) { - error("Failed to get subvol info %s: %s\n", + error("Failed to get subvol info %s: %s", fullpath, strerror(-ret)); } else { - error("Failed to get subvol info %s: %d\n", + error("Failed to get subvol info %s: %d", fullpath, ret); } return ret; @@ -1234,7 +1234,7 @@ static int cmd_subvol_sync(int argc, char **argv) } if (id < BTRFS_FIRST_FREE_OBJECTID || id > BTRFS_LAST_FREE_OBJECTID) { - error("subvolume id %s out of range\n", arg); + error("subvolume id %s out of range", arg); ret = 1; goto out; } diff --git a/image/main.c b/image/main.c index 066baf99..c464b650 100644 --- a/image/main.c +++ b/image/main.c @@ -2156,7 +2156,7 @@ static int search_for_chunk_blocks(struct mdrestore_struct *mdres, bytenr = current_cluster; while (1) { if (fseek(mdres->in, current_cluster, SEEK_SET)) { - error("seek failed: %s\n", strerror(errno)); + error("seek failed: %s", strerror(errno)); ret = -EIO; break; } @@ -2303,7 +2303,7 @@ static int build_chunk_tree(struct mdrestore_struct *mdres, break; bytenr += le32_to_cpu(item->size); if (fseek(mdres->in, le32_to_cpu(item->size), SEEK_CUR)) { - error("seek failed: %s\n", strerror(errno)); + error("seek failed: %s", strerror(errno)); return -EIO; } } @@ -2546,7 +2546,7 @@ static int restore_metadump(const char *input, FILE *out, int old_restore, } if (in != stdin && fseek(in, 0, SEEK_SET)) { - error("seek failed: %s\n", strerror(errno)); + error("seek failed: %s", strerror(errno)); goto out; } diff --git a/qgroup-verify.c b/qgroup-verify.c index aa575fb6..39762bfc 100644 --- a/qgroup-verify.c +++ b/qgroup-verify.c @@ -1496,7 +1496,7 @@ static int repair_qgroup_info(struct btrfs_fs_info *info, key.offset = count->qgroupid; ret = btrfs_search_slot(trans, root, &key, &path, 0, 1); if (ret) { - error("Could not find disk item for qgroup %llu/%llu.\n", + error("could not find disk item for qgroup %llu/%llu", btrfs_qgroup_level(count->qgroupid), btrfs_qgroup_subvid(count->qgroupid)); if (ret > 0) @@ -1550,7 +1550,7 @@ static int repair_qgroup_status(struct btrfs_fs_info *info) key.offset = 0; ret = btrfs_search_slot(trans, root, &key, &path, 0, 1); if (ret) { - error("Could not find qgroup status item\n"); + error("could not find qgroup status item"); if (ret > 0) ret = -ENOENT; goto out;