libceph: rename parse_fsid() to ceph_parse_fsid() and export
authorVenky Shankar <vshankar@redhat.com>
Wed, 14 Jul 2021 10:05:51 +0000 (15:35 +0530)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 13 Jan 2022 12:40:06 +0000 (13:40 +0100)
... as it is too generic. also, use __func__ when logging
rather than hardcoding the function name.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
include/linux/ceph/libceph.h
net/ceph/ceph_common.c

index c72285d8594e8de9649192ffb3b66a9462ac6e9d..644f224eccf75e1d18aac3333d69783158dd5c9b 100644 (file)
@@ -296,6 +296,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;
index 851b0c4c573005cc1759cfa2f45f114606343d92..decae43b4262d03775be28a46d050b46fe2f0197 100644 (file)
@@ -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
@@ -464,7 +465,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;