Displaying 20 results from an estimated 23 matches for "nr_qgroups".
2015 Jun 17
1
Re: [PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
...btrfs qgroup show' is like:
> + *
> + * qgroupid rfer excl
> + * -------- ---- ----
> + * 0/5 9249849344 9249849344
> *
> - * qgroupid rfer excl
> - * -------- ---- ----
> */
> size_t nr_qgroups = count_strings (lines) - 2;
> guestfs_int_btrfsqgroup_list *ret = NULL;
> ret = malloc (sizeof *ret);
> if (!ret) {
> reply_with_perror ("malloc");
> - goto error;
> + return NULL;
> }
>
> ret->guestfs_int_btrfsqgroup_list_len = n...
2015 Jun 17
6
[PATCH v4 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of
macro CLEANUP_FREE_STRING_LIST
v4: remove some redundant strdup
v3: fix test case failure
v2: properly initialize lines
Chen Hanxiao (3):
do_btrfs_qgroup_show: fix a bad return value
do_btrfs_subvolume_list: fix a bad return value
btrfs: use CLEANUP_FREE_STRING_LIST for list free
daemon/btrfs.c | 70
2015 Jun 17
0
[PATCH v4 1/3] do_btrfs_qgroup_show: fix a bad return value
...;
- /* line 0 and 1 are:
+ /* Output of `btrfs qgroup show' is like:
+ *
+ * qgroupid rfer excl
+ * -------- ---- ----
+ * 0/5 9249849344 9249849344
*
- * qgroupid rfer excl
- * -------- ---- ----
*/
size_t nr_qgroups = count_strings (lines) - 2;
guestfs_int_btrfsqgroup_list *ret = NULL;
ret = malloc (sizeof *ret);
if (!ret) {
reply_with_perror ("malloc");
- goto error;
+ return NULL;
}
ret->guestfs_int_btrfsqgroup_list_len = nr_qgroups;
@@ -1293,38 +1295,32 @@ do_btrfs_q...
2014 Dec 05
0
[PATCH 09/11] New API: btrfs_qgroup_show
...out, &err, argv);
+ if (r == -1) {
+ reply_with_error ("%s: %s", path, err);
+ return NULL;
+ }
+
+ lines = split_lines (out);
+ if (!lines)
+ return NULL;
+
+ /* line 0 and 1 are:
+ *
+ * qgroupid rfer excl
+ * -------- ---- ----
+ */
+ size_t nr_qgroups = count_strings (lines) - 2;
+ guestfs_int_btrfsqgroup_list *ret = NULL;
+ ret = malloc (sizeof *ret);
+ if (!ret) {
+ reply_with_perror ("malloc");
+ goto error;
+ }
+
+ ret->guestfs_int_btrfsqgroup_list_len = nr_qgroups;
+ ret->guestfs_int_btrfsqgroup_list_val =
+ c...
2015 Jun 18
2
[PATCH v5 1/2] do_btrfs_qgroup_show: fix a bad return value
...;
- /* line 0 and 1 are:
+ /* Output of `btrfs qgroup show' is like:
+ *
+ * qgroupid rfer excl
+ * -------- ---- ----
+ * 0/5 9249849344 9249849344
*
- * qgroupid rfer excl
- * -------- ---- ----
*/
size_t nr_qgroups = count_strings (lines) - 2;
guestfs_int_btrfsqgroup_list *ret = NULL;
ret = malloc (sizeof *ret);
if (!ret) {
reply_with_perror ("malloc");
- goto error;
+ return NULL;
}
ret->guestfs_int_btrfsqgroup_list_len = nr_qgroups;
@@ -1300,31 +1302,23 @@ do_btrfs_q...
2015 Jun 17
2
[PATCH] btrfs: keep calloc and its error message match
...);
if (ret->guestfs_int_btrfssubvolume_list_val == NULL) {
- reply_with_perror ("malloc");
+ reply_with_perror ("calloc");
goto error;
}
@@ -1292,7 +1292,7 @@ do_btrfs_qgroup_show (const char *path)
ret->guestfs_int_btrfsqgroup_list_val =
calloc (nr_qgroups, sizeof (struct guestfs_int_btrfsqgroup));
if (ret->guestfs_int_btrfsqgroup_list_val == NULL) {
- reply_with_perror ("malloc");
+ reply_with_perror ("calloc");
goto error;
}
--
2.1.0
2015 Jun 23
1
[PATCH] btrfs: remove redundant whitespace
...s)
goto error;
}
- struct guestfs_int_btrfssubvolume *this =
+ struct guestfs_int_btrfssubvolume *this =
&ret->guestfs_int_btrfssubvolume_list_val[i];
#if __WORDSIZE == 64
@@ -1298,7 +1298,7 @@ do_btrfs_qgroup_show (const char *path)
for (i = 0; i < nr_qgroups; ++i) {
char *line = lines[i + 2];
- struct guestfs_int_btrfsqgroup *this =
+ struct guestfs_int_btrfsqgroup *this =
&ret->guestfs_int_btrfsqgroup_list_val[i];
uint64_t dummy1, dummy2;
char *p;
--
2.1.0
2014 Dec 02
21
[PATCH 0/8] btrfs support part2: qgroup commands
Hi,
This series adds support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
Hu Tao (8):
New API: btrfs_subvolume_get_default
New API: btrfs_subvolume_show
New API: btrfs_quota_enable
New API: btrfs_quota_disable
New API: btrfs_quota_rescan
New API: btrfs_qgroup_limit
New API: btrfs_qgroup_create
New API:
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v3 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v3:
- don't intialize fs_buf (patch 1)
- check the return value of sysroot_path (patch 1)
- check fs_buf rather than fs (patch 1)
- fprintf (stderr,...) -> reply_with_error()
v2:
- add tests for new APIs
- combine
2015 Jun 12
1
[PATCH] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines;
path_buf = sysroot_path (path);
if (path_buf == NULL) {
@@ -1323,11 +1321,9 @@ do_btrfs_qgroup_show (const char *path)
this->btrfsqgroup_id = line;
}
- free (lines);
return ret;
error:
- free_stringslen (lines, nr_qgroups + 2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
@@ -1707,7 +1703,7 @@ do_btrfs_balance_status (const char *path)
char *out;
int r;
guestfs_int_btrfsbalance *ret;
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines;
size_t nlines;
const cha...
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...STRING_LIST char **lines = NULL;
int r;
- char **lines;
path_buf = sysroot_path (path);
if (path_buf == NULL) {
@@ -1323,11 +1321,9 @@ do_btrfs_qgroup_show (const char *path)
this->btrfsqgroup_id = line;
}
- free (lines);
return ret;
error:
- free_stringslen (lines, nr_qgroups + 2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
@@ -1704,10 +1700,10 @@ do_btrfs_balance_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
cha...
2015 Jun 15
0
[PATCH v3 1/3] do_btrfs_qgroup_show: fix a bad return value
...group_show (const char *path)
goto error;
}
*p = '\0';
- this->btrfsqgroup_id = line;
+ this->btrfsqgroup_id = strdup (line);
+ if (this->btrfsqgroup_id == NULL)
+ goto error;
}
- free (lines);
return ret;
error:
- free_stringslen (lines, nr_qgroups + 2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
--
2.1.0
2015 Jun 17
0
Re: [PATCH] btrfs: keep calloc and its error message match
...lume_list_val == NULL) {
> - reply_with_perror ("malloc");
> + reply_with_perror ("calloc");
> goto error;
> }
>
> @@ -1292,7 +1292,7 @@ do_btrfs_qgroup_show (const char *path)
> ret->guestfs_int_btrfsqgroup_list_val =
> calloc (nr_qgroups, sizeof (struct guestfs_int_btrfsqgroup));
> if (ret->guestfs_int_btrfsqgroup_list_val == NULL) {
> - reply_with_perror ("malloc");
> + reply_with_perror ("calloc");
> goto error;
> }
LGTM, so pushed with the amend above to the commit message....
2014 Dec 11
14
[PATCH v2 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v2 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v2:
- add tests for new APIs
- combine btrfs_quota_enable and btrfs_quota_disable
- following APIs changed to operate on Mountable_or_Path:
btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan.
Hu Tao (11):
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...s)
{
- const size_t nr_devices = count_strings (devices);
+ const size_t nr_devices = guestfs_int_count_strings (devices);
if (nr_devices == 0)
return 0;
@@ -1391,7 +1391,7 @@ do_btrfs_qgroup_show (const char *path)
* 0/5 9249849344 9249849344
*
*/
- const size_t nr_qgroups = count_strings (lines) - 2;
+ const size_t nr_qgroups = guestfs_int_count_strings (lines) - 2;
guestfs_int_btrfsqgroup_list *ret = NULL;
ret = malloc (sizeof *ret);
if (!ret) {
@@ -1821,7 +1821,7 @@ do_btrfs_balance_status (const char *path)
if (!lines)
return NULL;
- nlines =...
2015 Jun 15
7
[PATCH v3 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of
macro CLEANUP_FREE_STRING_LIST
v3: fix test case failure
v2: properly initialize lines
Chen Hanxiao (3):
do_btrfs_qgroup_show: fix a bad return value
do_btrfs_subvolume_list: fix a bad return value
btrfs: use CLEANUP_FREE_STRING_LIST for list free
daemon/btrfs.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...*fs)
goto error;
}
-error:
+ error:
if (fs_buf && umount (fs_buf, fs) != 0)
return -1;
return r;
@@ -1412,7 +1412,7 @@ do_btrfs_qgroup_show (const char *path)
return ret;
-error:
+ error:
if (ret->guestfs_int_btrfsqgroup_list_val) {
for (i = 0; i < nr_qgroups; ++i)
free (ret->guestfs_int_btrfsqgroup_list_val[i].btrfsqgroup_id);
@@ -1890,7 +1890,7 @@ do_btrfs_balance_status (const char *path)
pcre_free (re);
return ret;
-error:
+ error:
free (ret->btrfsbalance_status);
free (ret);
pcre_free (re);
@@ -1979,49 +1979,49 @@ do_b...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
I believe this addresses everything raised in comments on that
patch series.
Rich.
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought.
We have lots of utility functions, spread all over the repository,
with not a lot of structure. This moves many of them under common/
and structures them so there are clear dependencies.
This doesn't complete the job by any means. Other items I had on my
to-do list for this change were:
- Split up mllib/common_utils into:
-