libceph: update osd request/reply encoding
Use the new version of the encoding for osd requests and replies. In the process, update the way we are tracking request ops and reply lengths and results in the struct ceph_osd_request. Update the rbd and fs/ceph users appropriately. The main changes are: - we keep pointers into the request memory for fields we need to update each time the request is sent out over the wire - we keep information about the result in an array in the request struct where the users can easily get at it. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
This commit is contained in:
		
					parent
					
						
							
								2169aea649
							
						
					
				
			
			
				commit
				
					
						1b83bef24c
					
				
			
		
					 6 changed files with 220 additions and 167 deletions
				
			
		| 
						 | 
				
			
			@ -47,6 +47,9 @@ struct ceph_osd {
 | 
			
		|||
	struct list_head o_keepalive_item;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define CEPH_OSD_MAX_OP 10
 | 
			
		||||
 | 
			
		||||
/* an in-flight request */
 | 
			
		||||
struct ceph_osd_request {
 | 
			
		||||
	u64             r_tid;              /* unique for this client */
 | 
			
		||||
| 
						 | 
				
			
			@ -63,9 +66,23 @@ struct ceph_osd_request {
 | 
			
		|||
	struct ceph_connection *r_con_filling_msg;
 | 
			
		||||
 | 
			
		||||
	struct ceph_msg  *r_request, *r_reply;
 | 
			
		||||
	int               r_result;
 | 
			
		||||
	int               r_flags;     /* any additional flags for the osd */
 | 
			
		||||
	u32               r_sent;      /* >0 if r_request is sending/sent */
 | 
			
		||||
	int               r_num_ops;
 | 
			
		||||
 | 
			
		||||
	/* encoded message content */
 | 
			
		||||
	struct ceph_osd_op *r_request_ops;
 | 
			
		||||
	/* these are updated on each send */
 | 
			
		||||
	__le32           *r_request_osdmap_epoch;
 | 
			
		||||
	__le32           *r_request_flags;
 | 
			
		||||
	__le64           *r_request_pool;
 | 
			
		||||
	void             *r_request_pgid;
 | 
			
		||||
	__le32           *r_request_attempts;
 | 
			
		||||
	struct ceph_eversion *r_request_reassert_version;
 | 
			
		||||
 | 
			
		||||
	int               r_result;
 | 
			
		||||
	int               r_reply_op_len[CEPH_OSD_MAX_OP];
 | 
			
		||||
	s32               r_reply_op_result[CEPH_OSD_MAX_OP];
 | 
			
		||||
	int               r_got_reply;
 | 
			
		||||
	int		  r_linger;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue