aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-04-28 10:07:27 -0400
committerIlya Dryomov <idryomov@gmail.com>2016-05-25 19:15:28 -0400
commit1907920324f1f3ebb6618344417c03a2863bba01 (patch)
tree537d0a98db34205484f05337c25f51b9128987dd /include/linux/ceph
parent922dab6134178cae317ae00de86376cba59f3147 (diff)
libceph: support for sending notifies
Implement ceph_osdc_notify() for sending notifies. Due to the fact that the current messenger can't do read-in into pagelists (it can only do write-out from them), I had to go with a page vector for a NOTIFY_COMPLETE payload, for now. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/osd_client.h20
-rw-r--r--include/linux/ceph/rados.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index cd2dcb8939de..63054fae4f15 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -115,6 +115,11 @@ struct ceph_osd_req_op {
115 struct ceph_osd_data request_data; 115 struct ceph_osd_data request_data;
116 } notify_ack; 116 } notify_ack;
117 struct { 117 struct {
118 u64 cookie;
119 struct ceph_osd_data request_data;
120 struct ceph_osd_data response_data;
121 } notify;
122 struct {
118 u64 expected_object_size; 123 u64 expected_object_size;
119 u64 expected_write_size; 124 u64 expected_write_size;
120 } alloc_hint; 125 } alloc_hint;
@@ -202,6 +207,7 @@ struct ceph_osd_linger_request {
202 struct ceph_osd_client *osdc; 207 struct ceph_osd_client *osdc;
203 u64 linger_id; 208 u64 linger_id;
204 bool committed; 209 bool committed;
210 bool is_watch; /* watch or notify */
205 211
206 struct ceph_osd *osd; 212 struct ceph_osd *osd;
207 struct ceph_osd_request *reg_req; 213 struct ceph_osd_request *reg_req;
@@ -220,14 +226,20 @@ struct ceph_osd_linger_request {
220 struct list_head scan_item; 226 struct list_head scan_item;
221 227
222 struct completion reg_commit_wait; 228 struct completion reg_commit_wait;
229 struct completion notify_finish_wait;
223 int reg_commit_error; 230 int reg_commit_error;
231 int notify_finish_error;
224 int last_error; 232 int last_error;
225 233
226 u32 register_gen; 234 u32 register_gen;
235 u64 notify_id;
227 236
228 rados_watchcb2_t wcb; 237 rados_watchcb2_t wcb;
229 rados_watcherrcb_t errcb; 238 rados_watcherrcb_t errcb;
230 void *data; 239 void *data;
240
241 struct page ***preply_pages;
242 size_t *preply_len;
231}; 243};
232 244
233struct ceph_osd_client { 245struct ceph_osd_client {
@@ -397,5 +409,13 @@ int ceph_osdc_notify_ack(struct ceph_osd_client *osdc,
397 u64 cookie, 409 u64 cookie,
398 void *payload, 410 void *payload,
399 size_t payload_len); 411 size_t payload_len);
412int ceph_osdc_notify(struct ceph_osd_client *osdc,
413 struct ceph_object_id *oid,
414 struct ceph_object_locator *oloc,
415 void *payload,
416 size_t payload_len,
417 u32 timeout,
418 struct page ***preply_pages,
419 size_t *preply_len);
400#endif 420#endif
401 421
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 204c8c944703..5c0da61cb763 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -477,6 +477,9 @@ struct ceph_osd_op {
477 __le32 gen; /* registration generation */ 477 __le32 gen; /* registration generation */
478 } __attribute__ ((packed)) watch; 478 } __attribute__ ((packed)) watch;
479 struct { 479 struct {
480 __le64 cookie;
481 } __attribute__ ((packed)) notify;
482 struct {
480 __le64 offset, length; 483 __le64 offset, length;
481 __le64 src_offset; 484 __le64 src_offset;
482 } __attribute__ ((packed)) clonerange; 485 } __attribute__ ((packed)) clonerange;