libceph: define ceph_msg_has_*() data macros

Define and use macros ceph_msg_has_*() to determine whether to
operate on the pages, pagelist, bio, and trail fields of a message.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Alex Elder
2013-03-01 18:00:16 -06:00
committed by Sage Weil
parent 35b6280899
commit 97fb1c7f66
2 changed files with 34 additions and 17 deletions

View File

@@ -64,6 +64,13 @@ struct ceph_messenger {
u32 required_features;
};
#define ceph_msg_has_pages(m) ((m)->pages != NULL)
#define ceph_msg_has_pagelist(m) ((m)->pagelist != NULL)
#ifdef CONFIG_BLOCK
#define ceph_msg_has_bio(m) ((m)->bio != NULL)
#endif /* CONFIG_BLOCK */
#define ceph_msg_has_trail(m) ((m)->trail != NULL)
/*
* a single message. it contains a header (src, dest, message type, etc.),
* footer (crc values, mainly), a "front" message body, and possibly a