Dieter Ries
2012-Sep-30 14:18 UTC
[PATCH 0/3] btrfs-progs: Some cosmetic changes (mainly) to btrfsck
Hi, this patch series implements some mainly cosmetic changes to btrfs-progs, most in btrfsck. As this is my first contribution here, I''d kindly ask you for feedback, and if work like this is appreciated in general. Cheers, Dieter Dieter Ries (3): btrfs-progs: Remove redundant "Btrfs" string from version string btrfs-progs: btrfsck: Print which filesystem to be checked to stdout btrfs-progs: btrfsck: Print feedback about fscking to stdout. btrfsck.c | 21 ++++++++++++++++----- version.sh | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) -- 1.7.3.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Dieter Ries
2012-Sep-30 14:18 UTC
[PATCH 1/3] btrfs-progs: Remove redundant "Btrfs" string from version string
In the first line of version.sh, $v was set to "Btrfs vx.yy", and in the end "Btrfs $v" was echoed to the version.h file. This resulted in the version string "Btrfs Btrfs vx.yy". This patch removes the second occurrence of "Btrfs". Signed-off-by: Dieter Ries <mail@dieterries.net> --- version.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/version.sh b/version.sh index af3e441..2c1aff1 100644 --- a/version.sh +++ b/version.sh @@ -46,7 +46,7 @@ fi echo "#ifndef __BUILD_VERSION" > .build-version.h echo "#define __BUILD_VERSION" >> .build-version.h -echo "#define BTRFS_BUILD_VERSION \"Btrfs $v\"" >> .build-version.h +echo "#define BTRFS_BUILD_VERSION \"$v\"" >> .build-version.h echo "#endif" >> .build-version.h diff -q version.h .build-version.h >& /dev/null -- 1.7.3.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Dieter Ries
2012-Sep-30 14:18 UTC
[PATCH 2/3] btrfs-progs: btrfsck: Print which filesystem to be checked to stdout
This patch makes btrfsck print the filesystem, which is to be checked, to stdout. This should be helpful when analyzing (copied and pasted) output of btrfsck. Signed-off-by: Dieter Ries <mail@dieterries.net> --- btrfsck.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/btrfsck.c b/btrfsck.c index 088b9f4..dde63e7 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -3538,6 +3538,8 @@ int main(int ac, char **av) } else if(ret) { fprintf(stderr, "%s is currently mounted. Aborting.\n", av[optind]); return -EBUSY; + } else { + printf("Checking filesystem on %s\n",av[optind]); } info = open_ctree_fs_info(av[optind], bytenr, rw, 1); -- 1.7.3.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Dieter Ries
2012-Sep-30 14:18 UTC
[PATCH 3/3] btrfs-progs: btrfsck: Print feedback about fscking to stdout.
Status reports of the checking process should be printed to stdout instead of stderr, as that is normal program output and not related to problems in btrfsck. This patch changes this behaviour and adds the output "Done!" after each of the parts. Signed-off-by: Dieter Ries <mail@dieterries.net> --- btrfsck.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/btrfsck.c b/btrfsck.c index dde63e7..245ba7d 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -3557,7 +3557,7 @@ int main(int ac, char **av) root = info->fs_root; - fprintf(stderr, "checking extents\n"); + printf("checking extents... "); if (rw) trans = btrfs_start_transaction(root, 1); @@ -3565,22 +3565,31 @@ int main(int ac, char **av) fprintf(stderr, "Reinit crc root\n"); ret = btrfs_fsck_reinit_root(trans, info->csum_root); if (ret) { + printf("\n"); fprintf(stderr, "crc root initialization failed\n"); return -EIO; } goto out; } ret = check_extents(trans, root, repair); - if (ret) + if (ret) { fprintf(stderr, "Errors found in extent allocation tree\n"); + printf("\n"); + } + else + printf("Done!\n"); - fprintf(stderr, "checking fs roots\n"); + printf("checking fs roots... "); ret = check_fs_roots(root, &root_cache); - if (ret) + if (ret) { + printf("\n"); goto out; + else + printf("Done!\n"); - fprintf(stderr, "checking root refs\n"); + printf("checking root refs... "); ret = check_root_refs(root, &root_cache); + printf("Done!\n"); out: free_root_recs(&root_cache); if (rw) { -- 1.7.3.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html