提交 a8b763a9 编写于 作者: S Sage Weil

ceph: use %pU to print uuid (fsid)

Signed-off-by: NSage Weil <sage@newdream.net>
上级 f0b18d9f
...@@ -361,8 +361,8 @@ int ceph_debugfs_client_init(struct ceph_client *client) ...@@ -361,8 +361,8 @@ int ceph_debugfs_client_init(struct ceph_client *client)
int ret = 0; int ret = 0;
char name[80]; char name[80];
snprintf(name, sizeof(name), FSID_FORMAT ".client%lld", snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
PR_FSID(&client->fsid), client->monc.auth->global_id); client->monc.auth->global_id);
client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir); client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
if (!client->debugfs_dir) if (!client->debugfs_dir)
......
...@@ -151,7 +151,7 @@ static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt) ...@@ -151,7 +151,7 @@ static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt)
struct ceph_mount_args *args = client->mount_args; struct ceph_mount_args *args = client->mount_args;
if (args->flags & CEPH_OPT_FSID) if (args->flags & CEPH_OPT_FSID)
seq_printf(m, ",fsid=" FSID_FORMAT, PR_FSID(&args->fsid)); seq_printf(m, ",fsid=%pU", &args->fsid);
if (args->flags & CEPH_OPT_NOSHARE) if (args->flags & CEPH_OPT_NOSHARE)
seq_puts(m, ",noshare"); seq_puts(m, ",noshare");
if (args->flags & CEPH_OPT_DIRSTAT) if (args->flags & CEPH_OPT_DIRSTAT)
...@@ -408,7 +408,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid) ...@@ -408,7 +408,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
if (i == 16) if (i == 16)
err = 0; err = 0;
dout("parse_fsid ret %d got fsid " FSID_FORMAT, err, PR_FSID(fsid)); dout("parse_fsid ret %d got fsid %pU", err, fsid);
return err; return err;
} }
...@@ -727,13 +727,13 @@ int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid) ...@@ -727,13 +727,13 @@ int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)
{ {
if (client->have_fsid) { if (client->have_fsid) {
if (ceph_fsid_compare(&client->fsid, fsid)) { if (ceph_fsid_compare(&client->fsid, fsid)) {
pr_err("bad fsid, had " FSID_FORMAT " got " FSID_FORMAT, pr_err("bad fsid, had %pU got %pU",
PR_FSID(&client->fsid), PR_FSID(fsid)); &client->fsid, fsid);
return -1; return -1;
} }
} else { } else {
pr_info("client%lld fsid " FSID_FORMAT "\n", pr_info("client%lld fsid %pU\n", client->monc.auth->global_id,
client->monc.auth->global_id, PR_FSID(fsid)); fsid);
memcpy(&client->fsid, fsid, sizeof(*fsid)); memcpy(&client->fsid, fsid, sizeof(*fsid));
ceph_debugfs_client_init(client); ceph_debugfs_client_init(client);
client->have_fsid = true; client->have_fsid = true;
......
...@@ -746,13 +746,6 @@ extern struct kmem_cache *ceph_file_cachep; ...@@ -746,13 +746,6 @@ extern struct kmem_cache *ceph_file_cachep;
extern const char *ceph_msg_type_name(int type); extern const char *ceph_msg_type_name(int type);
extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
#define FSID_FORMAT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" \
"%02x%02x%02x%02x%02x%02x"
#define PR_FSID(f) (f)->fsid[0], (f)->fsid[1], (f)->fsid[2], (f)->fsid[3], \
(f)->fsid[4], (f)->fsid[5], (f)->fsid[6], (f)->fsid[7], \
(f)->fsid[8], (f)->fsid[9], (f)->fsid[10], (f)->fsid[11], \
(f)->fsid[12], (f)->fsid[13], (f)->fsid[14], (f)->fsid[15]
/* inode.c */ /* inode.c */
extern const struct inode_operations ceph_file_iops; extern const struct inode_operations ceph_file_iops;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册