ceph: convert encode/decode macros to inlines
This avoids the fugly pass by reference and makes the code a bit easier to read. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
535bbb5307
commit
c89136ea42
6 changed files with 137 additions and 132 deletions
|
@ -45,9 +45,9 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end)
|
|||
|
||||
ceph_decode_need(&p, end, sizeof(fsid) + 2*sizeof(u32), bad);
|
||||
ceph_decode_copy(&p, &fsid, sizeof(fsid));
|
||||
ceph_decode_32(&p, epoch);
|
||||
epoch = ceph_decode_32(&p);
|
||||
|
||||
ceph_decode_32(&p, num_mon);
|
||||
num_mon = ceph_decode_32(&p);
|
||||
ceph_decode_need(&p, end, num_mon*sizeof(m->mon_inst[0]), bad);
|
||||
|
||||
if (num_mon >= CEPH_MAX_MON)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue