search for: do_btrfs_subvolume_show

Displaying 20 results from an estimated 31 matches for "do_btrfs_subvolume_show".

2015 Jun 23
1
[PATCH] Modify the function: analyze_line, make it more flexible
...tatic char * -analyze_line (char *line, char **key, char **value) +analyze_line (char *line, char **key, char **value, char delimiter) { char *p = line; char *next = NULL; - char delimiter = ':'; char *del_pos = NULL; if (!line || *line == '\0') { @@ -964,7 +963,7 @@ do_btrfs_subvolume_show (const char *subvolume) * snapshots/test3 * */ - p = analyze_line(out, &key, &value); + p = analyze_line(out, &key, &value, ':'); if (!p) { reply_with_error ("truncated output: %s", out); return NULL; @@ -9...
2015 Jun 17
3
[PATCH v2 1/2] Modify public function: analyze_line, make it more flexible
...tatic char * -analyze_line (char *line, char **key, char **value) +analyze_line (char *line, char **key, char **value, char delimiter) { char *p = line; char *next = NULL; - char delimiter = ':'; char *del_pos = NULL; if (!line || *line == '\0') { @@ -964,7 +963,7 @@ do_btrfs_subvolume_show (const char *subvolume) * snapshots/test3 * */ - p = analyze_line(out, &key, &value); + p = analyze_line(out, &key, &value, ':'); if (!p) { reply_with_error ("truncated output: %s", out); return NULL; @@ -9...
2015 Jul 13
1
[PATCH] daemon: add a space after func name to fit code-style
...NOT_SUPPORTED(-1, "btrfs filesystems' UUID cannot be changed"); + NOT_SUPPORTED (-1, "btrfs filesystems' UUID cannot be changed"); r = commandr (NULL, &err, str_btrfstune, "-f", "-u", device, NULL); if (r == -1) { @@ -1063,7 +1063,7 @@ do_btrfs_subvolume_show (const char *subvolume) * snapshots/test3 * */ - p = analyze_line(out, &key, &value, ':'); + p = analyze_line (out, &key, &value, ':'); if (!p) { reply_with_error ("truncated output: %s", out); retu...
2015 Jun 16
2
[PATCH] New API: btrfs_device_stats
...ine (char *line, char **key, char **value) +analyze_line (char *line, char **key, char **value, char delim) { char *p = line; char *next = NULL; - char delimiter = ':'; + char delimiter = delim; char *del_pos = NULL; if (!line || *line == '\0') { @@ -964,7 +964,7 @@ do_btrfs_subvolume_show (const char *subvolume) * snapshots/test3 * */ - p = analyze_line(out, &key, &value); + p = analyze_line(out, &key, &value, ':'); if (!p) { reply_with_error ("truncated output: %s", out); return NULL; @@ -9...
2015 Jun 17
0
Re: [PATCH v2 1/2] Modify public function: analyze_line, make it more flexible
...**key, char **value) > +analyze_line (char *line, char **key, char **value, char delimiter) > { > char *p = line; > char *next = NULL; > - char delimiter = ':'; > char *del_pos = NULL; > > if (!line || *line == '\0') { > @@ -964,7 +963,7 @@ do_btrfs_subvolume_show (const char *subvolume) > * snapshots/test3 > * > */ > - p = analyze_line(out, &key, &value); > + p = analyze_line(out, &key, &value, ':'); > if (!p) { > reply_with_error ("truncated output: %s&q...
2015 Jun 16
0
Re: [PATCH] New API: btrfs_device_stats
...p = line; > char *next = NULL; > - char delimiter = ':'; > + char delimiter = delim; > char *del_pos = NULL; > > if (!line || *line == '\0') { Why keep the local variable 'delimiter'? Just name the argument like that. > @@ -964,7 +964,7 @@ do_btrfs_subvolume_show (const char *subvolume) > * snapshots/test3 > * > */ > - p = analyze_line(out, &key, &value); > + p = analyze_line(out, &key, &value, ':'); > if (!p) { > reply_with_error ("truncated output: %s&q...
2015 Jun 19
2
[PATCH v2 1/2] Modify the function: analyze_line, make it more flexible
...tatic char * -analyze_line (char *line, char **key, char **value) +analyze_line (char *line, char **key, char **value, char delimiter) { char *p = line; char *next = NULL; - char delimiter = ':'; char *del_pos = NULL; if (!line || *line == '\0') { @@ -964,7 +963,7 @@ do_btrfs_subvolume_show (const char *subvolume) * snapshots/test3 * */ - p = analyze_line(out, &key, &value); + p = analyze_line(out, &key, &value, ':'); if (!p) { reply_with_error ("truncated output: %s", out); return NULL; @@ -9...
2015 Jun 19
3
[PATCH v3 1/2] Modify the function: analyze_line, make it more flexible
...tatic char * -analyze_line (char *line, char **key, char **value) +analyze_line (char *line, char **key, char **value, char delimiter) { char *p = line; char *next = NULL; - char delimiter = ':'; char *del_pos = NULL; if (!line || *line == '\0') { @@ -964,7 +963,7 @@ do_btrfs_subvolume_show (const char *subvolume) * snapshots/test3 * */ - p = analyze_line(out, &key, &value); + p = analyze_line(out, &key, &value, ':'); if (!p) { reply_with_error ("truncated output: %s", out); return NULL; @@ -9...
2015 Jun 17
2
Re: [PATCH] New API: btrfs_device_stats
...iter = delim; >> char *del_pos = NULL; >> >> if (!line || *line == '\0') { > > Why keep the local variable 'delimiter'? Just name the argument like > that. I thought it is a good coding rule. OK, will remove the local >> @@ -964,7 +964,7 @@ do_btrfs_subvolume_show (const char *subvolume) >> * snapshots/test3 >> * >> */ >> - p = analyze_line(out, &key, &value); >> + p = analyze_line(out, &key, &value, ':'); >> if (!p) { >> reply_with_er...
2016 Jan 25
1
[PATCH] btrfs_subvolume_show: fix root/toplevel check w/ btrfs-progs >= 4.4
...d our check did not work anymore. Yes, parsing user messages really sucks... --- daemon/btrfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 85dbe00..c67af83 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1029,9 +1029,12 @@ do_btrfs_subvolume_show (const char *subvolume) } /* If the path is the btrfs root, `btrfs subvolume show' reports: - * <path> is btrfs root + * <path> is btrfs root [in btrfs-progs < 4.4] + * <path> is toplevel subvolume */ - if (out && strstr (out, "is btrfs...
2017 Nov 03
1
[PATCH] daemon: btrfs: remove dead check
...;key' is used in a place where this variable is already checked to be non-null. --- daemon/btrfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index f11902b21..d363ada6d 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -990,7 +990,7 @@ do_btrfs_subvolume_show (const char *subvolume) return NULL; } } else { - if (add_string (&ret, key ? key : "") == -1) + if (add_string (&ret, key) == -1) return NULL; if (value && !STREQ (value, "-")) { if (add_string (&ret,...
2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
...this behaviour. --- daemon/btrfs.c | 4 +--- daemon/devsparts.c | 8 ++++---- daemon/guestfsd.c | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 9b52aa8..d70565a 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1123,10 +1123,8 @@ do_btrfs_subvolume_show (const char *subvolume) } if (ss) { - if (add_string_nodup (&ret, ss) == -1) { - free (ss); + if (add_string_nodup (&ret, ss) == -1) return NULL; - } } else { if (add_string (&ret, "") == -1) r...
2014 Dec 02
0
[PATCH 3/8] New API: btrfs_quota_enable
...| 31 +++++++++++++++++++++++++++++++ generator/actions.ml | 9 +++++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 2cfb364..31dd806 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -995,3 +995,34 @@ char **do_btrfs_subvolume_show (const char *subvolume) return ret.argv; } + +int do_btrfs_quota_enable (const char *path) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *path_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + int r; + +...
2014 Nov 21
3
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...;xstrtol.h" > +#include "c-ctype.h" > > GUESTFSD_EXT_CMD(str_btrfs, btrfs); > GUESTFSD_EXT_CMD(str_btrfstune, btrfstune); > @@ -813,3 +814,169 @@ do_btrfs_fsck (const char *device, int64_t superblock, int repair) > > return 0; > } > + > +char **do_btrfs_subvolume_show (const char *subvolume) > +{ > + const size_t MAX_ARGS = 64; > + const char *argv[MAX_ARGS]; > + size_t i = 0; > + CLEANUP_FREE char *subvolume_buf = NULL; > + CLEANUP_FREE char *err = NULL; > + CLEANUP_FREE char *out = NULL; > + char *p, *pend, *colon; > + DECLAR...
2014 Nov 24
1
Re: [PATCH 6/6] New API: btrfs_subvolume_show
..._EXT_CMD(str_btrfstune, btrfstune); > > > > > > @@ -813,3 +814,169 @@ do_btrfs_fsck (const char *device, int64_t > > > superblock, int repair)> > > > > return 0; > > > > > > } > > > > > > + > > > +char **do_btrfs_subvolume_show (const char *subvolume) > > > +{ > > > + const size_t MAX_ARGS = 64; > > > + const char *argv[MAX_ARGS]; > > > + size_t i = 0; > > > + CLEANUP_FREE char *subvolume_buf = NULL; > > > + CLEANUP_FREE char *err = NULL; > > > + CLEANUP...
2014 Nov 21
0
[PATCH 6/6] New API: btrfs_subvolume_show
...#include "optgroups.h" #include "xstrtol.h" +#include "c-ctype.h" GUESTFSD_EXT_CMD(str_btrfs, btrfs); GUESTFSD_EXT_CMD(str_btrfstune, btrfstune); @@ -813,3 +814,169 @@ do_btrfs_fsck (const char *device, int64_t superblock, int repair) return 0; } + +char **do_btrfs_subvolume_show (const char *subvolume) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *subvolume_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + char *p, *pend, *colon; + DECLARE_STRINGSBUF (ret); + int r; + + subvolume_...
2014 Dec 02
0
[PATCH 2/8] New API: btrfs_subvolume_show
...= strchr (p, delimiter); + if (del_pos) { + *del_pos = '\0'; + + /* leading spaces and tabs */ + do { + ++del_pos; + } while (*del_pos && c_isspace (*del_pos)); + assert (value); + *value = del_pos; + } else + *value = NULL; + + return next; +} + +char **do_btrfs_subvolume_show (const char *subvolume) +{ + const size_t MAX_ARGS = 64; + const char *argv[MAX_ARGS]; + size_t i = 0; + CLEANUP_FREE char *subvolume_buf = NULL; + CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *out = NULL; + char *p, *key = NULL, *value = NULL; + DECLARE_STRINGSBUF (ret); + int r; +...
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...; - return ret.argv; - error: - if (ret.argv) - free_stringslen (ret.argv, ret.size); - return NULL; + return take_stringsbuf (&ret); } char ** diff --git a/daemon/btrfs.c b/daemon/btrfs.c index d70565a..811194d 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1016,7 +1016,7 @@ do_btrfs_subvolume_show (const char *subvolume) CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; char *p, *key = NULL, *value = NULL; - DECLARE_STRINGSBUF (ret); + CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret); int r; subvolume_buf = sysroot_path (subvolume); @@ -1147,7 +1147,7 @@ do_btr...
2014 Dec 05
1
Re: [PATCH 2/8] New API: btrfs_subvolume_show
...\0'; > + > + /* leading spaces and tabs */ > + do { > + ++del_pos; > + } while (*del_pos && c_isspace (*del_pos)); > + assert (value); > + *value = del_pos; > + } else > + *value = NULL; > + > + return next; > +} > +char **do_btrfs_subvolume_show (const char *subvolume) > +{ > + const size_t MAX_ARGS = 64; > + const char *argv[MAX_ARGS]; > + size_t i = 0; > + CLEANUP_FREE char *subvolume_buf = NULL; > + CLEANUP_FREE char *err = NULL; > + CLEANUP_FREE char *out = NULL; > + char *p, *key = NULL, *value = NULL; &...
2014 Nov 24
0
Re: [PATCH 6/6] New API: btrfs_subvolume_show
....h" > > > > GUESTFSD_EXT_CMD(str_btrfs, btrfs); > > GUESTFSD_EXT_CMD(str_btrfstune, btrfstune); > > @@ -813,3 +814,169 @@ do_btrfs_fsck (const char *device, int64_t superblock, int repair) > > > > return 0; > > } > > + > > +char **do_btrfs_subvolume_show (const char *subvolume) > > +{ > > + const size_t MAX_ARGS = 64; > > + const char *argv[MAX_ARGS]; > > + size_t i = 0; > > + CLEANUP_FREE char *subvolume_buf = NULL; > > + CLEANUP_FREE char *err = NULL; > > + CLEANUP_FREE char *out = NULL; > > +...