1 #ifndef __FS_CEPH_PAGELIST_H
2 #define __FS_CEPH_PAGELIST_H
4 #include <linux/list.h>
13 static inline void ceph_pagelist_init(struct ceph_pagelist *pl)
15 INIT_LIST_HEAD(&pl->head);
16 pl->mapped_tail = NULL;
20 extern int ceph_pagelist_release(struct ceph_pagelist *pl);
22 extern int ceph_pagelist_append(struct ceph_pagelist *pl, void *d, size_t l);
24 static inline int ceph_pagelist_encode_64(struct ceph_pagelist *pl, u64 v)
26 __le64 ev = cpu_to_le64(v);
27 return ceph_pagelist_append(pl, &ev, sizeof(ev));
29 static inline int ceph_pagelist_encode_32(struct ceph_pagelist *pl, u32 v)
31 __le32 ev = cpu_to_le32(v);
32 return ceph_pagelist_append(pl, &ev, sizeof(ev));
34 static inline int ceph_pagelist_encode_16(struct ceph_pagelist *pl, u16 v)
36 __le16 ev = cpu_to_le16(v);
37 return ceph_pagelist_append(pl, &ev, sizeof(ev));
39 static inline int ceph_pagelist_encode_8(struct ceph_pagelist *pl, u8 v)
41 return ceph_pagelist_append(pl, &v, 1);
43 static inline int ceph_pagelist_encode_string(struct ceph_pagelist *pl,
46 int ret = ceph_pagelist_encode_32(pl, len);
50 return ceph_pagelist_append(pl, s, len);