From 70a098be18a889e5af603f14bfad41c9ce34b0b5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 8 Sep 2009 16:42:09 -0700 Subject: [PATCH] kclient: kill ceph_fsid_t typedef --- src/include/ceph_fs.h | 8 ++++---- src/include/rados.h | 8 +++++--- src/include/types.h | 6 +++--- src/kernel/mds_client.c | 2 +- src/kernel/mdsmap.c | 2 +- src/kernel/mdsmap.h | 2 +- src/kernel/mon_client.c | 2 +- src/kernel/mon_client.h | 2 +- src/kernel/osd_client.c | 2 +- src/kernel/osdmap.c | 2 +- src/kernel/osdmap.h | 2 +- src/kernel/super.h | 12 ++++++------ src/osd/osd_types.h | 2 +- 13 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index 39b8b3ed8bd8a..f5b8c60aa9502 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -296,7 +296,7 @@ ceph_full_name_hash(const char *name, unsigned int len) struct ceph_mon_statfs { __le64 have_version; - ceph_fsid_t fsid; + struct ceph_fsid fsid; __le64 tid; } __attribute__ ((packed)); @@ -306,7 +306,7 @@ struct ceph_statfs { } __attribute__ ((packed)); struct ceph_mon_statfs_reply { - ceph_fsid_t fsid; + struct ceph_fsid fsid; __le64 tid; __le64 version; struct ceph_statfs st; @@ -314,13 +314,13 @@ struct ceph_mon_statfs_reply { struct ceph_osd_getmap { __le64 have_version; - ceph_fsid_t fsid; + struct ceph_fsid fsid; __le32 start; } __attribute__ ((packed)); struct ceph_mds_getmap { __le64 have_version; - ceph_fsid_t fsid; + struct ceph_fsid fsid; } __attribute__ ((packed)); struct ceph_client_mount { diff --git a/src/include/rados.h b/src/include/rados.h index a83cf35a7914b..a871577ed752d 100644 --- a/src/include/rados.h +++ b/src/include/rados.h @@ -11,10 +11,12 @@ /* * fs id */ -typedef struct { unsigned char fsid[16]; } ceph_fsid_t; +struct ceph_fsid { + unsigned char fsid[16]; +}; -static inline int ceph_fsid_compare(const ceph_fsid_t *a, - const ceph_fsid_t *b) +static inline int ceph_fsid_compare(const struct ceph_fsid *a, + const struct ceph_fsid *b) { return memcmp(a, b, sizeof(*a)); } diff --git a/src/include/types.h b/src/include/types.h index 5376dae1082fd..f166cc5b2000c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -197,7 +197,7 @@ struct ltstr #include "encoding.h" -WRITE_RAW_ENCODER(ceph_fsid_t) +WRITE_RAW_ENCODER(ceph_fsid) WRITE_RAW_ENCODER(ceph_file_layout) WRITE_RAW_ENCODER(ceph_pg_pool) WRITE_RAW_ENCODER(ceph_mds_session_head) @@ -234,7 +234,7 @@ typedef __u32 epoch_t; // map epoch (32bits -> 13 epochs/second for 10 ye #define O_LAZY 01000000 - +typedef struct ceph_fsid ceph_fsid_t; // -------------------------------------- // identify individual mount clients by 64bit value @@ -389,7 +389,7 @@ inline ostream& operator<<(ostream& out, const SnapContext& snapc) { // -- -inline ostream& operator<<(ostream& out, const ceph_fsid_t& f) { +inline ostream& operator<<(ostream& out, const ceph_fsid& f) { char b[37]; sprintf(b, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", f.fsid[0], f.fsid[1], f.fsid[2], f.fsid[3], f.fsid[4], f.fsid[5], f.fsid[6], f.fsid[7], diff --git a/src/kernel/mds_client.c b/src/kernel/mds_client.c index 06b940f98e832..c641eb33425de 100644 --- a/src/kernel/mds_client.c +++ b/src/kernel/mds_client.c @@ -2778,7 +2778,7 @@ void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc, struct ceph_msg *msg) void *p = msg->front.iov_base; void *end = p + msg->front.iov_len; struct ceph_mdsmap *newmap, *oldmap; - ceph_fsid_t fsid; + struct ceph_fsid fsid; int err = -EINVAL; ceph_decode_need(&p, end, sizeof(fsid)+2*sizeof(u32), bad); diff --git a/src/kernel/mdsmap.c b/src/kernel/mdsmap.c index 081dd5117feca..f13e1a5fbd9e7 100644 --- a/src/kernel/mdsmap.c +++ b/src/kernel/mdsmap.c @@ -87,7 +87,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ceph_decode_8(p, infoversion); ceph_decode_32(p, namelen); /* skip mds name */ *p += namelen; - + ceph_decode_need(p, end, 5*sizeof(u32) + sizeof(u64) + sizeof(addr) + sizeof(struct ceph_timespec), diff --git a/src/kernel/mdsmap.h b/src/kernel/mdsmap.h index b9f311a82f647..ea8a0f5275879 100644 --- a/src/kernel/mdsmap.h +++ b/src/kernel/mdsmap.h @@ -4,7 +4,7 @@ #include "types.h" /* - * mds map - describe servers in the mds cluster. + * mds map - describe servers in the mds cluster. * * we limit fields to those the client actually xcares about */ diff --git a/src/kernel/mon_client.c b/src/kernel/mon_client.c index 521c0366b255f..a96a8aada0fa0 100644 --- a/src/kernel/mon_client.c +++ b/src/kernel/mon_client.c @@ -35,7 +35,7 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end) { struct ceph_monmap *m = 0; int i, err = -EINVAL; - ceph_fsid_t fsid; + struct ceph_fsid fsid; u32 epoch, num_mon; u16 version; diff --git a/src/kernel/mon_client.h b/src/kernel/mon_client.h index 5d6994d105d46..d2d87dc5c660c 100644 --- a/src/kernel/mon_client.h +++ b/src/kernel/mon_client.h @@ -12,7 +12,7 @@ struct ceph_mount_args; * The monitor map enumerates the set of all monitors. */ struct ceph_monmap { - ceph_fsid_t fsid; + struct ceph_fsid fsid; u32 epoch; u32 num_mon; struct ceph_entity_inst mon_inst[0]; diff --git a/src/kernel/osd_client.c b/src/kernel/osd_client.c index f532f7e815608..6366dcfe836da 100644 --- a/src/kernel/osd_client.c +++ b/src/kernel/osd_client.c @@ -848,7 +848,7 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg) u32 epoch; struct ceph_osdmap *newmap = NULL, *oldmap; int err; - ceph_fsid_t fsid; + struct ceph_fsid fsid; dout("handle_map have %u\n", osdc->osdmap ? osdc->osdmap->epoch : 0); p = msg->front.iov_base; diff --git a/src/kernel/osdmap.c b/src/kernel/osdmap.c index 3c88e5cfefc25..18574c3b76c9d 100644 --- a/src/kernel/osdmap.c +++ b/src/kernel/osdmap.c @@ -519,7 +519,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, { struct ceph_osdmap *newmap = map; struct crush_map *newcrush = NULL; - ceph_fsid_t fsid; + struct ceph_fsid fsid; u32 epoch = 0; struct ceph_timespec modified; u32 len, pool; diff --git a/src/kernel/osdmap.h b/src/kernel/osdmap.h index b2721ae375519..df9203054d4f4 100644 --- a/src/kernel/osdmap.h +++ b/src/kernel/osdmap.h @@ -31,7 +31,7 @@ struct ceph_pg_mapping { }; struct ceph_osdmap { - ceph_fsid_t fsid; + struct ceph_fsid fsid; u32 epoch; u32 mkfs_epoch; struct ceph_timespec created, modified; diff --git a/src/kernel/super.h b/src/kernel/super.h index 73540d053d09a..4638c338b17ce 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -52,7 +52,7 @@ struct ceph_mount_args { int flags; int mount_timeout; int caps_wanted_delay_min, caps_wanted_delay_max; - ceph_fsid_t fsid; + struct ceph_fsid fsid; struct ceph_entity_addr my_addr; int wsize; int rsize; /* max readahead */ @@ -116,7 +116,7 @@ struct ceph_client { struct mutex mount_mutex; /* serialize mount attempts */ struct ceph_mount_args mount_args; - ceph_fsid_t fsid; + struct ceph_fsid fsid; struct super_block *sb; @@ -770,22 +770,22 @@ extern struct kmem_cache *ceph_file_cachep; extern const char *ceph_msg_type_name(int type); -static inline __le64 __ceph_fsid_minor(ceph_fsid_t *fsid) +static inline __le64 __ceph_fsid_minor(struct ceph_fsid *fsid) { return get_unaligned_le64(&fsid->fsid[8]); } -static inline __le64 __ceph_fsid_major(ceph_fsid_t *fsid) +static inline __le64 __ceph_fsid_major(struct ceph_fsid *fsid) { return get_unaligned_le64(&fsid->fsid[0]); } -static inline void __ceph_fsid_set_minor(ceph_fsid_t *fsid, __le64 val) +static inline void __ceph_fsid_set_minor(struct ceph_fsid *fsid, __le64 val) { put_unaligned_le64(val, &fsid->fsid[8]); } -static inline void __ceph_fsid_set_major(ceph_fsid_t *fsid, __le64 val) +static inline void __ceph_fsid_set_major(struct ceph_fsid *fsid, __le64 val) { put_unaligned_le64(val, &fsid->fsid[0]); } diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 375605e681e90..72cf18f33d697 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -877,7 +877,7 @@ inline ostream& operator<<(ostream& out, ObjectExtent &ex) class OSDSuperblock { public: nstring magic; - ceph_fsid_t fsid; + ceph_fsid fsid; int32_t whoami; // my role in this fs. epoch_t current_epoch; // most recent epoch epoch_t oldest_map, newest_map; // oldest/newest maps we have. -- 2.39.5