Displaying 3 results from an estimated 3 matches for "btrfsfsshow_total_bytes".
2015 Jun 11
2
[PATCH] New API: btrfs_filesystem_show_all
...goto error;
+ }
+ p += strlen ("path ");
+ if ((this->btrfsfsshow_device = strdup (p)) == NULL)
+ goto error;
+ if (sscanf (line, "\tdevid %4d size %9s used %9s path",
+ &this->btrfsfsshow_devid,
+ this->btrfsfsshow_total_bytes,
+ this->btrfsfsshow_bytes_used) != 3) {
+ reply_with_error ("cannot parse output of filesystem show command: %s", line);
+ goto error;
+ }
+ k++;
+ }
+ }
+
+ if (label_tmp)
+ free (label_tmp);
+ if (uuid_tmp)
+ free (uuid_tmp);
+ free...
2015 Jun 11
1
Re: [PATCH] New API: btrfs_filesystem_show_all
...quot;path ");
> > + if ((this->btrfsfsshow_device = strdup (p)) == NULL)
> > + goto error;
> > + if (sscanf (line, "\tdevid %4d size %9s used %9s path",
> > + &this->btrfsfsshow_devid,
> > + this->btrfsfsshow_total_bytes,
> > + this->btrfsfsshow_bytes_used) != 3) {
>
> Why not use this sscanf to also take the device, instead of looking for
> it manually using strstr?
If sscanf for device, we still need to calculate the length of 'device' for malloc.
So strdup would be easie...
2015 Jun 11
0
Re: [PATCH] New API: btrfs_filesystem_show_all
...gt; + p += strlen ("path ");
> + if ((this->btrfsfsshow_device = strdup (p)) == NULL)
> + goto error;
> + if (sscanf (line, "\tdevid %4d size %9s used %9s path",
> + &this->btrfsfsshow_devid,
> + this->btrfsfsshow_total_bytes,
> + this->btrfsfsshow_bytes_used) != 3) {
Why not use this sscanf to also take the device, instead of looking for
it manually using strstr?
> + reply_with_error ("cannot parse output of filesystem show command: %s", line);
> + goto error;
> +...