template<typename T>
struct ceph_le {
+private:
T v;
+public:
ceph_le<T>& operator=(T nv) {
v = mswab(nv);
return *this;
}
operator T() const { return mswab(v); }
+ friend inline bool operator==(ceph_le a, ceph_le b) {
+ return a.v == b.v;
+ }
} __attribute__ ((packed));
-template<typename T>
-inline bool operator==(ceph_le<T> a, ceph_le<T> b) {
- return a.v == b.v;
-}
-
using ceph_le64 = ceph_le<__u64>;
using ceph_le32 = ceph_le<__u32>;
using ceph_le16 = ceph_le<__u16>;
return v;
}
- /*
-#define cpu_to_le64(x) (x)
-#define cpu_to_le32(x) (x)
-#define cpu_to_le16(x) (x)
- */
-#define le64_to_cpu(x) ((uint64_t)x)
-#define le32_to_cpu(x) ((__u32)x)
-#define le16_to_cpu(x) ((__u16)x)