Message ID | 1404961513-14614-3-git-send-email-quwenruo@cn.fujitsu.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
(2014/07/10 12:05), Qu Wenruo wrote: > When editing cmds-filesystem.c, I found cmd_filesystem_df() uses 7 > spaces as indent instead of 1 tab (or 8 spaces). which makes indent > quite embarrassing. > Such problem is especillay hard to detect when reviewing patches, > since the leading '+' makes a tab only 7 spaces long, makeing 7 spaces > look the same with a tab. > > This patch fixes all the 7 spaces indent. > > Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> > --- > cmds-filesystem.c | 79 +++++++++++++++++++++++++++---------------------------- > ctree.h | 15 ++++++----- > utils.c | 10 +++---- > 3 files changed, 52 insertions(+), 52 deletions(-) > > diff --git a/cmds-filesystem.c b/cmds-filesystem.c > index 4b2d27e..0a9b62a 100644 > --- a/cmds-filesystem.c > +++ b/cmds-filesystem.c > @@ -114,23 +114,23 @@ static const char * const filesystem_cmd_group_usage[] = { > }; > > static const char * const cmd_filesystem_df_usage[] = { > - "btrfs filesystem df <path>", > - "Show space usage information for a mount point", > - NULL > + "btrfs filesystem df <path>", > + "Show space usage information for a mount point", > + NULL > }; > > static void print_df(struct btrfs_ioctl_space_args *sargs) > { > - u64 i; > - struct btrfs_ioctl_space_info *sp = sargs->spaces; > - > - for (i = 0; i < sargs->total_spaces; i++, sp++) { > - printf("%s, %s: total=%s, used=%s\n", > - group_type_str(sp->flags), > - group_profile_str(sp->flags), > - pretty_size(sp->total_bytes), > - pretty_size(sp->used_bytes)); > - } > + u64 i; > + struct btrfs_ioctl_space_info *sp = sargs->spaces; > + > + for (i = 0; i < sargs->total_spaces; i++, sp++) { > + printf("%s, %s: total=%s, used=%s\n", > + group_type_str(sp->flags), > + group_profile_str(sp->flags), > + pretty_size(sp->total_bytes), > + pretty_size(sp->used_bytes)); > + } > } > > static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) > @@ -183,33 +183,32 @@ static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) > > static int cmd_filesystem_df(int argc, char **argv) > { > - struct btrfs_ioctl_space_args *sargs = NULL; > - int ret; > - int fd; > - char *path; > - DIR *dirstream = NULL; > - > - if (check_argc_exact(argc, 2)) > - usage(cmd_filesystem_df_usage); > - > - path = argv[1]; > - > - fd = open_file_or_dir(path, &dirstream); > - if (fd < 0) { > - fprintf(stderr, "ERROR: can't access '%s'\n", path); > - return 1; > - } > - ret = get_df(fd, &sargs); > - > - if (!ret && sargs) { > - print_df(sargs); > - free(sargs); > - } else { > - fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); > - } > - > - close_file_or_dir(fd, dirstream); > - return !!ret; > + struct btrfs_ioctl_space_args *sargs = NULL; > + int ret; > + int fd; > + char *path; > + DIR *dirstream = NULL; > + > + if (check_argc_exact(argc, 2)) > + usage(cmd_filesystem_df_usage); > + > + path = argv[1]; > + > + fd = open_file_or_dir(path, &dirstream); > + if (fd < 0) { > + fprintf(stderr, "ERROR: can't access '%s'\n", path); > + return 1; > + } > + ret = get_df(fd, &sargs); > + if (!ret && sargs) { > + print_df(sargs); > + free(sargs); > + } else { > + fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); > + } > + > + close_file_or_dir(fd, dirstream); > + return !!ret; > } > > static int match_search_item_kernel(__u8 *fsid, char *mnt, char *label, > diff --git a/ctree.h b/ctree.h > index 35d3633..83d85b3 100644 > --- a/ctree.h > +++ b/ctree.h > @@ -939,10 +939,10 @@ struct btrfs_block_group_cache { > }; > > struct btrfs_extent_ops { > - int (*alloc_extent)(struct btrfs_root *root, u64 num_bytes, > - u64 hint_byte, struct btrfs_key *ins); > - int (*free_extent)(struct btrfs_root *root, u64 bytenr, > - u64 num_bytes); > + int (*alloc_extent)(struct btrfs_root *root, u64 num_bytes, > + u64 hint_byte, struct btrfs_key *ins); > + int (*free_extent)(struct btrfs_root *root, u64 bytenr, > + u64 num_bytes); > }; > > struct btrfs_device; > @@ -2117,9 +2117,10 @@ BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_exclusive, > static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb, > struct btrfs_item *e) > { > - unsigned long offset; > - offset = offsetof(struct btrfs_file_extent_item, disk_bytenr); > - return btrfs_item_size(eb, e) - offset; > + unsigned long offset; > + > + offset = offsetof(struct btrfs_file_extent_item, disk_bytenr); > + return btrfs_item_size(eb, e) - offset; > } > > /* this returns the number of file bytes represented by the inline item. > diff --git a/utils.c b/utils.c > index 07173ee..356bdce 100644 > --- a/utils.c > +++ b/utils.c > @@ -1485,15 +1485,15 @@ char *__strncpy__null(char *dest, const char *src, size_t n) > */ > static int check_label(const char *input) > { > - int len = strlen(input); > + int len = strlen(input); > > - if (len > BTRFS_LABEL_SIZE - 1) { > + if (len > BTRFS_LABEL_SIZE - 1) { > fprintf(stderr, "ERROR: Label %s is too long (max %d)\n", > input, BTRFS_LABEL_SIZE - 1); > - return -1; > - } > + return -1; > + } > > - return 0; > + return 0; > } > > static int set_label_unmounted(const char *dev, const char *label) > -- 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
On Thu, Jul 10, 2014 at 11:05:12AM +0800, Qu Wenruo wrote: > When editing cmds-filesystem.c, I found cmd_filesystem_df() uses 7 > spaces as indent instead of 1 tab (or 8 spaces). which makes indent > quite embarrassing. > Such problem is especillay hard to detect when reviewing patches, > since the leading '+' makes a tab only 7 spaces long, makeing 7 spaces > look the same with a tab. > > This patch fixes all the 7 spaces indent. The whitespace changes cause patch conflicts and I'm inclined not to add them or postpone after the patch queue is relatively calm. -- 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
diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 4b2d27e..0a9b62a 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -114,23 +114,23 @@ static const char * const filesystem_cmd_group_usage[] = { }; static const char * const cmd_filesystem_df_usage[] = { - "btrfs filesystem df <path>", - "Show space usage information for a mount point", - NULL + "btrfs filesystem df <path>", + "Show space usage information for a mount point", + NULL }; static void print_df(struct btrfs_ioctl_space_args *sargs) { - u64 i; - struct btrfs_ioctl_space_info *sp = sargs->spaces; - - for (i = 0; i < sargs->total_spaces; i++, sp++) { - printf("%s, %s: total=%s, used=%s\n", - group_type_str(sp->flags), - group_profile_str(sp->flags), - pretty_size(sp->total_bytes), - pretty_size(sp->used_bytes)); - } + u64 i; + struct btrfs_ioctl_space_info *sp = sargs->spaces; + + for (i = 0; i < sargs->total_spaces; i++, sp++) { + printf("%s, %s: total=%s, used=%s\n", + group_type_str(sp->flags), + group_profile_str(sp->flags), + pretty_size(sp->total_bytes), + pretty_size(sp->used_bytes)); + } } static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) @@ -183,33 +183,32 @@ static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) static int cmd_filesystem_df(int argc, char **argv) { - struct btrfs_ioctl_space_args *sargs = NULL; - int ret; - int fd; - char *path; - DIR *dirstream = NULL; - - if (check_argc_exact(argc, 2)) - usage(cmd_filesystem_df_usage); - - path = argv[1]; - - fd = open_file_or_dir(path, &dirstream); - if (fd < 0) { - fprintf(stderr, "ERROR: can't access '%s'\n", path); - return 1; - } - ret = get_df(fd, &sargs); - - if (!ret && sargs) { - print_df(sargs); - free(sargs); - } else { - fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); - } - - close_file_or_dir(fd, dirstream); - return !!ret; + struct btrfs_ioctl_space_args *sargs = NULL; + int ret; + int fd; + char *path; + DIR *dirstream = NULL; + + if (check_argc_exact(argc, 2)) + usage(cmd_filesystem_df_usage); + + path = argv[1]; + + fd = open_file_or_dir(path, &dirstream); + if (fd < 0) { + fprintf(stderr, "ERROR: can't access '%s'\n", path); + return 1; + } + ret = get_df(fd, &sargs); + if (!ret && sargs) { + print_df(sargs); + free(sargs); + } else { + fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); + } + + close_file_or_dir(fd, dirstream); + return !!ret; } static int match_search_item_kernel(__u8 *fsid, char *mnt, char *label, diff --git a/ctree.h b/ctree.h index 35d3633..83d85b3 100644 --- a/ctree.h +++ b/ctree.h @@ -939,10 +939,10 @@ struct btrfs_block_group_cache { }; struct btrfs_extent_ops { - int (*alloc_extent)(struct btrfs_root *root, u64 num_bytes, - u64 hint_byte, struct btrfs_key *ins); - int (*free_extent)(struct btrfs_root *root, u64 bytenr, - u64 num_bytes); + int (*alloc_extent)(struct btrfs_root *root, u64 num_bytes, + u64 hint_byte, struct btrfs_key *ins); + int (*free_extent)(struct btrfs_root *root, u64 bytenr, + u64 num_bytes); }; struct btrfs_device; @@ -2117,9 +2117,10 @@ BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_exclusive, static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb, struct btrfs_item *e) { - unsigned long offset; - offset = offsetof(struct btrfs_file_extent_item, disk_bytenr); - return btrfs_item_size(eb, e) - offset; + unsigned long offset; + + offset = offsetof(struct btrfs_file_extent_item, disk_bytenr); + return btrfs_item_size(eb, e) - offset; } /* this returns the number of file bytes represented by the inline item. diff --git a/utils.c b/utils.c index 07173ee..356bdce 100644 --- a/utils.c +++ b/utils.c @@ -1485,15 +1485,15 @@ char *__strncpy__null(char *dest, const char *src, size_t n) */ static int check_label(const char *input) { - int len = strlen(input); + int len = strlen(input); - if (len > BTRFS_LABEL_SIZE - 1) { + if (len > BTRFS_LABEL_SIZE - 1) { fprintf(stderr, "ERROR: Label %s is too long (max %d)\n", input, BTRFS_LABEL_SIZE - 1); - return -1; - } + return -1; + } - return 0; + return 0; } static int set_label_unmounted(const char *dev, const char *label)
When editing cmds-filesystem.c, I found cmd_filesystem_df() uses 7 spaces as indent instead of 1 tab (or 8 spaces). which makes indent quite embarrassing. Such problem is especillay hard to detect when reviewing patches, since the leading '+' makes a tab only 7 spaces long, makeing 7 spaces look the same with a tab. This patch fixes all the 7 spaces indent. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> --- cmds-filesystem.c | 79 +++++++++++++++++++++++++++---------------------------- ctree.h | 15 ++++++----- utils.c | 10 +++---- 3 files changed, 52 insertions(+), 52 deletions(-)