From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Fan Chengniang <fancn.fnst@cn.fujitsu.com>
Subject: [PATCH 1/2] btrfs-progs:correct the return value
Date: Tue, 10 Feb 2015 18:23:13 +0800 [thread overview]
Message-ID: <1423563803-8996-2-git-send-email-yangds.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1423563803-8996-1-git-send-email-yangds.fnst@cn.fujitsu.com>
From: Fan Chengniang <fancn.fnst@cn.fujitsu.com>
the return values 12 and 13 are not used spectially except as
return value. No description and definition about them. so I
change them to generic errno
Signed-off-by: Fan Chengniang <fancn.fnst@cn.fujitsu.com>
---
qgroup.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qgroup.c b/qgroup.c
index d59f4bb..5a4e393 100644
--- a/qgroup.c
+++ b/qgroup.c
@@ -21,6 +21,7 @@
#include "ctree.h"
#include "ioctl.h"
#include "utils.h"
+#include <errno.h>
#define BTRFS_QGROUP_NFILTERS_INCREASE (2 * BTRFS_QGROUP_FILTER_MAX)
#define BTRFS_QGROUP_NCOMPS_INCREASE (2 * BTRFS_QGROUP_COMP_MAX)
@@ -1294,7 +1295,7 @@ qgroup_inherit_realloc(struct btrfs_qgroup_inherit **inherit, int n, int pos)
out = calloc(sizeof(*out) + sizeof(out->qgroups[0]) * (nitems + n), 1);
if (out == NULL) {
fprintf(stderr, "ERROR: Not enough memory\n");
- return 13;
+ return -ENOMEM;
}
if (*inherit) {
@@ -1322,7 +1323,7 @@ int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)
if (qgroupid == 0) {
fprintf(stderr, "ERROR: bad qgroup specification\n");
- return 12;
+ return -EINVAL;
}
if (*inherit)
@@ -1349,7 +1350,7 @@ int qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg,
if (!p) {
bad:
fprintf(stderr, "ERROR: bad copy specification\n");
- return 12;
+ return -EINVAL;
}
*p = 0;
qgroup_src = parse_qgroupid(arg);
--
1.8.4.2
next prev parent reply other threads:[~2015-02-10 10:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 10:23 [PATCH 0/9] Btrfs: qgroup: part-1: bug fixes for qgroup inherit Dongsheng Yang
2015-02-10 10:23 ` Dongsheng Yang [this message]
2015-02-27 15:37 ` [PATCH 1/2] btrfs-progs:correct the return value David Sterba
2015-02-10 10:23 ` [PATCH 1/9] btrfs: qgroup: move WARN_ON() to the correct location Dongsheng Yang
2015-03-02 22:05 ` Josef Bacik
2015-02-10 10:23 ` [PATCH 2/2] btrfs-progs:set max_rfer and max_excl on creating new subvolume Dongsheng Yang
2015-02-10 10:23 ` [PATCH 2/9] btrfs: qgroup: inherit limit info from srcgroup in creating snapshot Dongsheng Yang
2015-03-02 22:10 ` Josef Bacik
2015-02-10 10:23 ` [PATCH 3/9] btrfs: qgroup: update qgroup in memory at the same time when we update it in btree Dongsheng Yang
2015-02-10 10:23 ` [PATCH 4/9] btrfs: qgroup: consolidate the parameter of fucntion update_qgroup_limit_item() Dongsheng Yang
2015-02-10 10:23 ` [PATCH 5/9] btrfs: qgroup: update limit info in function btrfs_run_qgroups() Dongsheng Yang
2015-02-10 10:23 ` [PATCH 6/9] btrfs: qgroup: fix limit args override whole limit struct Dongsheng Yang
2015-02-10 10:23 ` [PATCH 7/9] Btrfs: qgroup: make the btree for qgroup increase from left to right Dongsheng Yang
2015-02-10 10:23 ` [PATCH 8/9] Btrfs: qgroup: cleanup, remove an unsued parameter in btrfs_create_qgroup() Dongsheng Yang
2015-02-10 10:23 ` [PATCH 9/9] btrfs: qgroup: obtain quota status Dongsheng Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423563803-8996-2-git-send-email-yangds.fnst@cn.fujitsu.com \
--to=yangds.fnst@cn.fujitsu.com \
--cc=fancn.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).