aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-07-08 16:00:18 -0400
committerSage Weil <sage@newdream.net>2010-08-01 23:11:42 -0400
commita8b763a9b34561fea8e616c1439a71913ff2c1bd (patch)
treef8c90178e33cf7138296a9f36cf2cdc2d21d0408 /fs
parentf0b18d9f22ea4e50955945661b7e165a47705249 (diff)
ceph: use %pU to print uuid (fsid)
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/debugfs.c4
-rw-r--r--fs/ceph/super.c12
-rw-r--r--fs/ceph/super.h7
3 files changed, 8 insertions, 15 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index f2f5332ddbba..968dc5a86c3e 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -361,8 +361,8 @@ int ceph_debugfs_client_init(struct ceph_client *client)
361 int ret = 0; 361 int ret = 0;
362 char name[80]; 362 char name[80];
363 363
364 snprintf(name, sizeof(name), FSID_FORMAT ".client%lld", 364 snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
365 PR_FSID(&client->fsid), client->monc.auth->global_id); 365 client->monc.auth->global_id);
366 366
367 client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir); 367 client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
368 if (!client->debugfs_dir) 368 if (!client->debugfs_dir)
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 3100c909cbb1..d80699a4dc26 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -151,7 +151,7 @@ static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt)
151 struct ceph_mount_args *args = client->mount_args; 151 struct ceph_mount_args *args = client->mount_args;
152 152
153 if (args->flags & CEPH_OPT_FSID) 153 if (args->flags & CEPH_OPT_FSID)
154 seq_printf(m, ",fsid=" FSID_FORMAT, PR_FSID(&args->fsid)); 154 seq_printf(m, ",fsid=%pU", &args->fsid);
155 if (args->flags & CEPH_OPT_NOSHARE) 155 if (args->flags & CEPH_OPT_NOSHARE)
156 seq_puts(m, ",noshare"); 156 seq_puts(m, ",noshare");
157 if (args->flags & CEPH_OPT_DIRSTAT) 157 if (args->flags & CEPH_OPT_DIRSTAT)
@@ -408,7 +408,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
408 408
409 if (i == 16) 409 if (i == 16)
410 err = 0; 410 err = 0;
411 dout("parse_fsid ret %d got fsid " FSID_FORMAT, err, PR_FSID(fsid)); 411 dout("parse_fsid ret %d got fsid %pU", err, fsid);
412 return err; 412 return err;
413} 413}
414 414
@@ -727,13 +727,13 @@ int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)
727{ 727{
728 if (client->have_fsid) { 728 if (client->have_fsid) {
729 if (ceph_fsid_compare(&client->fsid, fsid)) { 729 if (ceph_fsid_compare(&client->fsid, fsid)) {
730 pr_err("bad fsid, had " FSID_FORMAT " got " FSID_FORMAT, 730 pr_err("bad fsid, had %pU got %pU",
731 PR_FSID(&client->fsid), PR_FSID(fsid)); 731 &client->fsid, fsid);
732 return -1; 732 return -1;
733 } 733 }
734 } else { 734 } else {
735 pr_info("client%lld fsid " FSID_FORMAT "\n", 735 pr_info("client%lld fsid %pU\n", client->monc.auth->global_id,
736 client->monc.auth->global_id, PR_FSID(fsid)); 736 fsid);
737 memcpy(&client->fsid, fsid, sizeof(*fsid)); 737 memcpy(&client->fsid, fsid, sizeof(*fsid));
738 ceph_debugfs_client_init(client); 738 ceph_debugfs_client_init(client);
739 client->have_fsid = true; 739 client->have_fsid = true;
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index af62081a9535..281e458db8b3 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -746,13 +746,6 @@ extern struct kmem_cache *ceph_file_cachep;
746extern const char *ceph_msg_type_name(int type); 746extern const char *ceph_msg_type_name(int type);
747extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); 747extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
748 748
749#define FSID_FORMAT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" \
750 "%02x%02x%02x%02x%02x%02x"
751#define PR_FSID(f) (f)->fsid[0], (f)->fsid[1], (f)->fsid[2], (f)->fsid[3], \
752 (f)->fsid[4], (f)->fsid[5], (f)->fsid[6], (f)->fsid[7], \
753 (f)->fsid[8], (f)->fsid[9], (f)->fsid[10], (f)->fsid[11], \
754 (f)->fsid[12], (f)->fsid[13], (f)->fsid[14], (f)->fsid[15]
755
756/* inode.c */ 749/* inode.c */
757extern const struct inode_operations ceph_file_iops; 750extern const struct inode_operations ceph_file_iops;
758 751