search for: btrfsfsshow_bytes_used

Displaying 3 results from an estimated 3 matches for "btrfsfsshow_bytes_used".

2015 Jun 11
2
[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) { + 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 (lines); + + return ret; + +error: + free_stri...
2015 Jun 11
1
Re: [PATCH] New API: btrfs_filesystem_show_all
...w_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 easier to use. > > > + reply_with_error (&quot...
2015 Jun 11
0
Re: [PATCH] New API: btrfs_filesystem_show_all
...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; > + } > + k++; > + } > + } > + &...