aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-25 19:11:12 -0500
committerSage Weil <sage@inktank.com>2013-02-26 18:02:50 -0500
commit1b83bef24c6746a146d39915a18fb5425f2facb0 (patch)
treea765aeb136f4c7e354c01314e5fdfb776d503fb7 /include/linux/ceph
parent2169aea649c08374bec7d220a3b8f64712275356 (diff)
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>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/osd_client.h19
-rw-r--r--include/linux/ceph/rados.h38
2 files changed, 18 insertions, 39 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index ad8899fc3157..1dd5d466b6f9 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -47,6 +47,9 @@ struct ceph_osd {
47 struct list_head o_keepalive_item; 47 struct list_head o_keepalive_item;
48}; 48};
49 49
50
51#define CEPH_OSD_MAX_OP 10
52
50/* an in-flight request */ 53/* an in-flight request */
51struct ceph_osd_request { 54struct ceph_osd_request {
52 u64 r_tid; /* unique for this client */ 55 u64 r_tid; /* unique for this client */
@@ -63,9 +66,23 @@ struct ceph_osd_request {
63 struct ceph_connection *r_con_filling_msg; 66 struct ceph_connection *r_con_filling_msg;
64 67
65 struct ceph_msg *r_request, *r_reply; 68 struct ceph_msg *r_request, *r_reply;
66 int r_result;
67 int r_flags; /* any additional flags for the osd */ 69 int r_flags; /* any additional flags for the osd */
68 u32 r_sent; /* >0 if r_request is sending/sent */ 70 u32 r_sent; /* >0 if r_request is sending/sent */
71 int r_num_ops;
72
73 /* encoded message content */
74 struct ceph_osd_op *r_request_ops;
75 /* these are updated on each send */
76 __le32 *r_request_osdmap_epoch;
77 __le32 *r_request_flags;
78 __le64 *r_request_pool;
79 void *r_request_pgid;
80 __le32 *r_request_attempts;
81 struct ceph_eversion *r_request_reassert_version;
82
83 int r_result;
84 int r_reply_op_len[CEPH_OSD_MAX_OP];
85 s32 r_reply_op_result[CEPH_OSD_MAX_OP];
69 int r_got_reply; 86 int r_got_reply;
70 int r_linger; 87 int r_linger;
71 88
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index d784c8dfb09a..68c96a508ac2 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -416,43 +416,5 @@ struct ceph_osd_op {
416 __le32 payload_len; 416 __le32 payload_len;
417} __attribute__ ((packed)); 417} __attribute__ ((packed));
418 418
419/*
420 * osd request message header. each request may include multiple
421 * ceph_osd_op object operations.
422 */
423struct ceph_osd_request_head {
424 __le32 client_inc; /* client incarnation */
425 struct ceph_object_layout layout; /* pgid */
426 __le32 osdmap_epoch; /* client's osdmap epoch */
427
428 __le32 flags;
429
430 struct ceph_timespec mtime; /* for mutations only */
431 struct ceph_eversion reassert_version; /* if we are replaying op */
432
433 __le32 object_len; /* length of object name */
434
435 __le64 snapid; /* snapid to read */
436 __le64 snap_seq; /* writer's snap context */
437 __le32 num_snaps;
438
439 __le16 num_ops;
440 struct ceph_osd_op ops[]; /* followed by ops[], obj, ticket, snaps */
441} __attribute__ ((packed));
442
443struct ceph_osd_reply_head {
444 __le32 client_inc; /* client incarnation */
445 __le32 flags;
446 struct ceph_object_layout layout;
447 __le32 osdmap_epoch;
448 struct ceph_eversion reassert_version; /* for replaying uncommitted */
449
450 __le32 result; /* result code */
451
452 __le32 object_len; /* length of object name */
453 __le32 num_ops;
454 struct ceph_osd_op ops[0]; /* ops[], object */
455} __attribute__ ((packed));
456
457 419
458#endif 420#endif