summaryrefslogtreecommitdiffstats
path: root/fs/ceph/rados.h
diff options
context:
space:
mode:
authorSage Weil2009-11-04 20:39:12 +0100
committerSage Weil2009-11-05 01:36:07 +0100
commit51042122d4f85e0f8ee577a4230f172fcc57c456 (patch)
treed5ccf5f84d362b6542a86eab6b6f50112111434b /fs/ceph/rados.h
parentceph: use fixed endian encoding for ceph_entity_addr (diff)
downloadkernel-qcow2-linux-51042122d4f85e0f8ee577a4230f172fcc57c456.tar.gz
kernel-qcow2-linux-51042122d4f85e0f8ee577a4230f172fcc57c456.tar.xz
kernel-qcow2-linux-51042122d4f85e0f8ee577a4230f172fcc57c456.zip
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.h13
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 {
* placement group.
* we encode this into one __le64.
*/
-union ceph_pg {
- __u64 pg64;
- struct {
- __s16 preferred; /* preferred primary osd */
- __u16 ps; /* placement seed */
- __u32 pool; /* object pool */
- } __attribute__ ((packed)) pg;
+struct ceph_pg {
+ __le16 preferred; /* preferred primary osd */
+ __le16 ps; /* placement seed */
+ __le32 pool; /* object pool */
} __attribute__ ((packed));
/*
@@ -117,7 +114,7 @@ static inline int ceph_stable_mod(int x, int b, int bmask)
* object layout - how a given object should be stored.
*/
struct ceph_object_layout {
- __le64 ol_pgid; /* raw pg, with _full_ ps precision. */
+ struct ceph_pg ol_pgid; /* raw pg, with _full_ ps precision. */
__le32 ol_stripe_unit; /* for per-object parity, if any */
} __attribute__ ((packed));