Skip to content

Commit

Permalink
libceph: rename parse_fsid() to ceph_parse_fsid() and export
Browse files Browse the repository at this point in the history
... as it is too generic. also, use __func__ when logging
rather than hardcoding the function name.

Signed-off-by: Venky Shankar <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
vshankar authored and idryomov committed Jan 13, 2022
1 parent 2d7c86a commit 4153c7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/linux/ceph/libceph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions net/ceph/ceph_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4153c7f

Please sign in to comment.