From: Venky Shankar <vshankar@redhat.com>
To: jlayton@redhat.com, idryomov@gmail.com, lhenriques@suse.de
Cc: pdonnell@redhat.com, ceph-devel@vger.kernel.org,
Venky Shankar <vshankar@redhat.com>
Subject: [PATCH v3 2/5] ceph: rename parse_fsid() to ceph_parse_fsid() and export
Date: Thu, 8 Jul 2021 14:12:44 +0530 [thread overview]
Message-ID: <20210708084247.182953-3-vshankar@redhat.com> (raw)
In-Reply-To: <20210708084247.182953-1-vshankar@redhat.com>
... as it is too generic. also, use __func__ when logging
rather than hardcoding the function name.
Signed-off-by: Venky Shankar <vshankar@redhat.com>
---
include/linux/ceph/libceph.h | 1 +
net/ceph/ceph_common.c | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index e50dba429819..37ab639b5012 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -298,6 +298,7 @@ extern bool libceph_compatible(void *data);
extern const char *ceph_msg_type_name(int type);
extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
extern void *ceph_kvmalloc(size_t size, gfp_t flags);
+extern int ceph_parse_fsid(const char *str, struct ceph_fsid *fsid);
struct fs_parameter;
struct fc_log;
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 0f74ceeddf48..31cbe671121c 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -217,14 +217,14 @@ void *ceph_kvmalloc(size_t size, gfp_t flags)
return p;
}
-static int parse_fsid(const char *str, struct ceph_fsid *fsid)
+int ceph_parse_fsid(const char *str, struct ceph_fsid *fsid)
{
int i = 0;
char tmp[3];
int err = -EINVAL;
int d;
- dout("parse_fsid '%s'\n", str);
+ dout("%s '%s'\n", __func__, str);
tmp[2] = 0;
while (*str && i < 16) {
if (ispunct(*str)) {
@@ -244,9 +244,10 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
if (i == 16)
err = 0;
- dout("parse_fsid ret %d got fsid %pU\n", err, fsid);
+ dout("%s ret %d got fsid %pU\n", __func__, err, fsid);
return err;
}
+EXPORT_SYMBOL(ceph_parse_fsid);
/*
* ceph options
@@ -465,7 +466,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
break;
case Opt_fsid:
- err = parse_fsid(param->string, &opt->fsid);
+ err = ceph_parse_fsid(param->string, &opt->fsid);
if (err) {
error_plog(&log, "Failed to parse fsid: %d", err);
return err;
--
2.27.0
next prev parent reply other threads:[~2021-07-08 8:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 8:42 [PATCH v3 0/5] ceph: new mount device syntax Venky Shankar
2021-07-08 8:42 ` [PATCH v3 1/5] ceph: generalize addr/ip parsing based on delimiter Venky Shankar
2021-07-12 11:16 ` Jeff Layton
2021-07-08 8:42 ` Venky Shankar [this message]
2021-07-08 8:42 ` [PATCH v3 3/5] ceph: new device mount syntax Venky Shankar
2021-07-08 8:42 ` [PATCH v3 4/5] ceph: record updated mon_addr on remount Venky Shankar
2021-07-08 8:42 ` [PATCH v3 5/5] doc: document new CephFS mount device syntax Venky Shankar
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=20210708084247.182953-3-vshankar@redhat.com \
--to=vshankar@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@redhat.com \
--cc=lhenriques@suse.de \
--cc=pdonnell@redhat.com \
/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).