> +static void print_df(struct btrfs_ioctl_space_args *sargs)
> +{
> + char description[80];
> + char *total_bytes;
> + char *used_bytes;
> + u64 flags;
> + u64 i;
> + int written;
> + char g_str[64];
> + int g_sz;
>
> + for (i = 0; i < sargs->total_spaces; i++) {
> + flags = sargs->spaces[i].flags;
> + written = 0;
> memset(description, 0, 80);
>
> + strcpy(g_str, group_type_str(flags));
> + g_sz = strlen(g_str);
> + snprintf(description, g_sz + 1, "%s", g_str);
> + written += g_sz;
> + strcpy(g_str, group_profile_str(flags));
> + g_sz = strlen(g_str);
> + snprintf(description+written, g_sz + 3, ", %s", g_str);
> + written += g_sz + 2;
> + total_bytes = pretty_size(sargs->spaces[i].total_bytes);
> + used_bytes = pretty_size(sargs->spaces[i].used_bytes);
> + printf("%s: total=%s, used=%s\n", description, total_bytes,
> + used_bytes);
This seems to be a whole lot of code for a simple iterating printf:
struct space_type_thingy_whatver *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));
}
- z
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html