Displaying 14 results from an estimated 14 matches for "del_pos".
2014 Dec 02
0
[PATCH 2/8] New API: btrfs_subvolume_show
...block, int repair)
return 0;
}
+
+/* analyze_line: analyze one line contains key:value pair.
+ * returns the next position following \n.
+ */
+static char *analyze_line (char *line, char **key, char **value)
+{
+ char *p = line;
+ char *next = NULL;
+ char delimiter = ':';
+ char *del_pos = NULL;
+
+ if (!line || *line == '\0') {
+ *key = NULL;
+ *value = NULL;
+ return NULL;
+ }
+
+ next = strchr (p, '\n');
+ if (next) {
+ *next = '\0';
+ ++next;
+ }
+
+ /* leading spaces and tabs */
+ while (*p && c_isspace (*p))
+ ++p;
+
+...
2014 Dec 05
1
Re: [PATCH 2/8] New API: btrfs_subvolume_show
...ne, so:
static char *
analyze_line (char *line, char **key, char **value)
The reason for this is to allow you to easily grep function
declarations in the source:
git grep ^analyze_line
> +{
> + char *p = line;
> + char *next = NULL;
> + char delimiter = ':';
> + char *del_pos = NULL;
> +
> + if (!line || *line == '\0') {
> + *key = NULL;
> + *value = NULL;
> + return NULL;
> + }
> +
> + next = strchr (p, '\n');
> + if (next) {
> + *next = '\0';
> + ++next;
> + }
> +
> + /* leading spa...
2014 Nov 26
7
[PATCH v2 0/5] btrfs support part1: subvolume commands
Hi,
This is the part1 of improving btrfs support. This series adds missing
parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and
adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show.
Other parts will follow.
Regards,
Hu
changes:
v2:
- add 'once_had_no_optargs = true' for btrfs_subvolume_snapshot and
btrfs_subvolume_create
- improved documents
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:
2015 Jun 23
1
[PATCH] Modify the function: analyze_line, make it more flexible
...4_t superblock, int repair)
* returns the next position following \n.
*/
static 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, ':');
i...
2015 Jun 17
3
[PATCH v2 1/2] Modify public function: analyze_line, make it more flexible
...4_t superblock, int repair)
* returns the next position following \n.
*/
static 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, ':');
i...
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
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):
2015 Jun 16
2
[PATCH] New API: btrfs_device_stats
...air)
* returns the next position following \n.
*/
static char *
-analyze_line (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, ':');
i...
2015 Jun 17
0
Re: [PATCH v2 1/2] Modify public function: analyze_line, make it more flexible
...ext position following \n.
> */
> static 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,...
2015 Jun 16
0
Re: [PATCH] New API: btrfs_device_stats
...gt; */
> static char *
> -analyze_line (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') {
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
> *
> *...
2015 Jun 19
2
[PATCH v2 1/2] Modify the function: analyze_line, make it more flexible
...4_t superblock, int repair)
* returns the next position following \n.
*/
static 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, ':');
i...
2015 Jun 19
3
[PATCH v3 1/2] Modify the function: analyze_line, make it more flexible
...4_t superblock, int repair)
* returns the next position following \n.
*/
static 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, ':');
i...
2015 Jun 17
2
Re: [PATCH] New API: btrfs_device_stats
...; -analyze_line (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') {
>
> 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 *sub...