diff options
author | Sage Weil <sage@newdream.net> | 2009-11-04 14:39:12 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-11-04 19:36:07 -0500 |
commit | 51042122d4f85e0f8ee577a4230f172fcc57c456 (patch) | |
tree | d5ccf5f84d362b6542a86eab6b6f50112111434b /fs/ceph/rados.h | |
parent | 63f2d211954b790fea0a9caeae605c7956535af6 (diff) |
ceph: fix endian conversions for ceph_pg
The endian conversions don't quite work with the old union ceph_pg. Just
make it a regular struct, and make each field __le. This is simpler and it
has the added bonus of actually working.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/rados.h')
-rw-r--r-- | fs/ceph/rados.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/ceph/rados.h b/fs/ceph/rados.h index a48cf4ae391e..85bdef78d142 100644 --- a/fs/ceph/rados.h +++ b/fs/ceph/rados.h | |||
@@ -55,13 +55,10 @@ struct ceph_timespec { | |||
55 | * placement group. | 55 | * placement group. |
56 | * we encode this into one __le64. | 56 | * we encode this into one __le64. |
57 | */ | 57 | */ |
58 | union ceph_pg { | 58 | struct ceph_pg { |
59 | __u64 pg64; | 59 | __le16 preferred; /* preferred primary osd */ |
60 | struct { | 60 | __le16 ps; /* placement seed */ |
61 | __s16 preferred; /* preferred primary osd */ | 61 | __le32 pool; /* object pool */ |
62 | __u16 ps; /* placement seed */ | ||
63 | __u32 pool; /* object pool */ | ||
64 | } __attribute__ ((packed)) pg; | ||
65 | } __attribute__ ((packed)); | 62 | } __attribute__ ((packed)); |
66 | 63 | ||
67 | /* | 64 | /* |
@@ -117,7 +114,7 @@ static inline int ceph_stable_mod(int x, int b, int bmask) | |||
117 | * object layout - how a given object should be stored. | 114 | * object layout - how a given object should be stored. |
118 | */ | 115 | */ |
119 | struct ceph_object_layout { | 116 | struct ceph_object_layout { |
120 | __le64 ol_pgid; /* raw pg, with _full_ ps precision. */ | 117 | struct ceph_pg ol_pgid; /* raw pg, with _full_ ps precision. */ |
121 | __le32 ol_stripe_unit; /* for per-object parity, if any */ | 118 | __le32 ol_stripe_unit; /* for per-object parity, if any */ |
122 | } __attribute__ ((packed)); | 119 | } __attribute__ ((packed)); |
123 | 120 | ||