aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/decode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/decode.h')
-rw-r--r--fs/ceph/decode.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ceph/decode.h b/fs/ceph/decode.h
index 91179fb2cc3f..a382aecc55bb 100644
--- a/fs/ceph/decode.h
+++ b/fs/ceph/decode.h
@@ -76,19 +76,31 @@ static inline void ceph_decode_copy(void **p, void *pv, size_t n)
76 * struct ceph_timespec <-> struct timespec 76 * struct ceph_timespec <-> struct timespec
77 */ 77 */
78static inline void ceph_decode_timespec(struct timespec *ts, 78static inline void ceph_decode_timespec(struct timespec *ts,
79 struct ceph_timespec *tv) 79 const struct ceph_timespec *tv)
80{ 80{
81 ts->tv_sec = le32_to_cpu(tv->tv_sec); 81 ts->tv_sec = le32_to_cpu(tv->tv_sec);
82 ts->tv_nsec = le32_to_cpu(tv->tv_nsec); 82 ts->tv_nsec = le32_to_cpu(tv->tv_nsec);
83} 83}
84static inline void ceph_encode_timespec(struct ceph_timespec *tv, 84static inline void ceph_encode_timespec(struct ceph_timespec *tv,
85 struct timespec *ts) 85 const struct timespec *ts)
86{ 86{
87 tv->tv_sec = cpu_to_le32(ts->tv_sec); 87 tv->tv_sec = cpu_to_le32(ts->tv_sec);
88 tv->tv_nsec = cpu_to_le32(ts->tv_nsec); 88 tv->tv_nsec = cpu_to_le32(ts->tv_nsec);
89} 89}
90 90
91/* 91/*
92 * sockaddr_storage <-> ceph_sockaddr
93 */
94static inline void ceph_encode_addr(struct ceph_entity_addr *a)
95{
96 a->in_addr.ss_family = htons(a->in_addr.ss_family);
97}
98static inline void ceph_decode_addr(struct ceph_entity_addr *a)
99{
100 a->in_addr.ss_family = ntohs(a->in_addr.ss_family);
101}
102
103/*
92 * encoders 104 * encoders
93 */ 105 */
94static inline void ceph_encode_64(void **p, u64 v) 106static inline void ceph_encode_64(void **p, u64 v)