From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Subject: [PATCH 3/4] btrfs-progs: replace a confusing raw number with a macro
Date: Thu, 17 Jul 2014 10:40:38 +0800 [thread overview]
Message-ID: <1405564839-28702-3-git-send-email-guihc.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1405564839-28702-1-git-send-email-guihc.fnst@cn.fujitsu.com>
The raw number 36 for the uuid string length is somewhat confusing,
use a macro to define replace it.
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
---
cmds-scrub.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cmds-scrub.c b/cmds-scrub.c
index a604b25..03eb9ba 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -48,6 +48,8 @@ static const char * const scrub_cmd_group_usage[] = {
NULL
};
+#define UUID_LEN_STR 36
+
#define SCRUB_DATA_FILE "/var/lib/btrfs/scrub.status"
#define SCRUB_PROGRESS_SOCKET_PATH "/var/lib/btrfs/scrub.progress"
#define SCRUB_FILE_VERSION_PREFIX "scrub status"
@@ -550,7 +552,7 @@ again:
;
if (i + j + 1 >= avail)
_SCRUB_INVALID;
- if (j != 36)
+ if (j != UUID_LEN_STR)
_SCRUB_INVALID;
l[i + j] = '\0';
ret = uuid_parse(l + i, p[curr]->fsid);
--
1.8.1.4
next prev parent reply other threads:[~2014-07-17 2:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 2:40 [PATCH 1/4] btrfs-progs: adjust the return values for scrub Gui Hecheng
2014-07-17 2:40 ` [PATCH 2/4] btrfs-progs: remove unnecessary judgment for fd in scrub Gui Hecheng
2014-07-30 6:07 ` Satoru Takeuchi
2014-07-17 2:40 ` Gui Hecheng [this message]
2014-07-29 12:16 ` [PATCH 3/4] btrfs-progs: replace a confusing raw number with a macro David Sterba
2014-07-29 12:19 ` David Sterba
2014-07-30 1:17 ` Gui Hecheng
2014-07-17 2:40 ` [PATCH 4/4] btrfs-progs: correct manpage option description for scrub Gui Hecheng
2014-07-30 5:20 ` Satoru Takeuchi
2014-07-30 5:39 ` Gui Hecheng
2014-07-30 6:09 ` Satoru Takeuchi
2014-07-30 7:32 ` [PATCH v2] " Gui Hecheng
2014-07-30 10:26 ` Duncan
2014-07-31 1:25 ` Gui Hecheng
2014-07-31 12:24 ` David Sterba
2014-07-30 6:03 ` [PATCH 1/4] btrfs-progs: adjust the return values " Satoru Takeuchi
2014-07-30 6:36 ` Satoru Takeuchi
2014-07-30 7:27 ` Gui Hecheng
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=1405564839-28702-3-git-send-email-guihc.fnst@cn.fujitsu.com \
--to=guihc.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).